Git Product home page Git Product logo

pypeit's Introduction

image

PypeIt forks stars

github PyPI pypi_downloads License

docs CITests Coverage

DOI_latest JOSS

PypeIt is a Python package for semi-automated reduction of astronomical spectroscopic data. Its algorithms build on decades-long development of previous data reduction pipelines by the developers. The reduction procedure - including a complete list of the input parameters and available functionality - is provided by our online documentation.

PypeIt is designed to be used by both advanced spectroscopists with prior data reduction expertise and astronomers with no prior experience of data reduction. It is highly configurable and designed to be applied to any standard slit-imaging spectrograph, including long-slit, multi-slit, as well as cross-dispersed echelle spectra. The spectrographs that PypeIt can be used with are listed here.

Also note that this link contains some useful information about reducing data with certain instruments that you might also find helpful.

In addition to our primary code base, we maintain an extensive development suite primarily used to perform multiple layers of code testing, from basic unit tests to full end-to-end tests of all our command-line scripts. If you are new to PypeIt, you are encouraged to pull example data from the DevSuite for your instrument when learning how to use the software.


Community

As a project, PypeIt is committed to fostering a welcoming, diverse, and inclusive community. As a member of this community you are expected to read and follow our Code of Conduct.

Along with our extensive online documentation, we encourage the PypeIt user base to communicate via our PypeIt Users Slack. All are welcome to join using this invitation link.

If you find a bug (particularly one that is experienced by others in the Users Slack) or have a feature request, please submit an issue.


Citation

If you use PypeIt in your research, please cite the following publications (we provide the relevant BibTeX entries for your convenience):

  • Prochaska et al. (2020, JOSS): arXiv, JOSS
  • Prochaska et al. (2020, Zenodo): Zenodo

If there is no place to include the relevant citations in the text of the publication, please include the following acknowledgement (provided in latex and using the provided BibTeX entries):

This research made use of \ttfamily{PypeIt},\footnote{\url{https://pypeit.readthedocs.io/en/latest/}}
a Python package for semi-automated reduction of astronomical slit-based spectroscopy
\citep{pypeit:joss_pub, pypeit:zenodo}.

Funding

PypeIt receives direct funding from the following sources:

  • NASA ADAP (A20-0412, 20-1018)
  • W.M. Keck Observatory
  • University of California Observatories

We also rely on important in-kind contributions from individuals at Caltech, the Multiple Mirror Observatory, and elsewhere.


Developers

PypeIt is an open-source, community developed package. Astronomers are encouraged to join the project and should review our Code of Conduct and Development Guidelines. We would also appreciate if you contact the lead developers (JXP, JFH) before beginning development activities.

The following persons have contributed substantially to the development of PypeIt.

  • J Xavier Prochaska (JXP)
  • Joseph F. Hennawi (JFH)
  • Kyle B. Westfall
  • Ryan J. Cooke
  • Feige Wang
  • Tiffany Hsyu
  • Frederick B. Davies
  • Emanuele Paolo Farina
  • Debora Pelliccia
  • James Reichwein
  • Milan Roberson
  • Timothy Pickering
  • Timothy Ellsworth-Bowers
  • Gregory Simonian
  • Heather Martin

pypeit's People

Contributors

adwasser avatar afloers avatar alexavillaume avatar badpandabear avatar bpholden avatar debora-pe avatar dmyang42 avatar emastro avatar feigewang avatar finagle29 avatar freddavies avatar gregosimo avatar hnmartin avatar jhennawi avatar jhod0 avatar kbwestfall avatar kthyng avatar marijana777 avatar mattcwilde avatar ntejos avatar profxj avatar raindogjones avatar rcooke-ast avatar shanebechtel avatar suksien avatar sunilsimha avatar tbowers7 avatar tepickering avatar thespacedoctor avatar tiffanyhsyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pypeit's Issues

Automatic file identification

Generate routines (and provide a settings option) to automatically identify the type of frame, so that we don't have to rely on headers.

index selection bug in arsort.match_science

In arsort.match_science, the time difference is calculated between each frame and a target science frame (line 437). This value should be less than that specified in spect['fits']['calwin']. The next line gets the indices satisfying that criterion, but then we should set the indices of interest to n[w] rather than the intersection of n (the indices corresponding to the frames) and w (the indices of n which match the time window). The time_window_fix branch makes that switch, but someone should check this to make sure it makes sense.

Fix 2 bugs in arutils

Line 783:
warnings.warn(msg, pu.RankWarning)
pu is not defined

Line 199:
tpixt, num = arcyarc.detections_sigma(yval,np.array([rms]*mid_row.shape[0]),np.zeros(yval.shape[0],dtype=np.int),siglev/2.0,siglev)

mid_row is not defined

Change the input filename extension?

At the moment only a ".red" file is allowed to be read in. But this might be a confusing extension if there's a red and a blue arm of the instrument, and red/blue is in the filename.

Please propose your favourite alternatives! Here are some suggestions:

.reduce
.pypit
.input
.in

I quite like ".pypit", but I'm not married to it...

Tracing

Consider reducing trace orders polyorder to 2 (or 1) for amrlsd

I don't think any of the standard instruments need polyorder=3.

cannot find settings.lris_blue, settings.lris_red files when running ./pypit_test

I use python3.5, and retrieved and installed all the most updated packages on Github.

When I run "./pypit_test lris" in test_suite, it says:

"No such file or directory:
[BUG] :: There appears to be a bug on Line 514 of arload.py with error:
[Errno 2] No such file or directory: '/Users/zhengcai/software/PYPIT/build/lib.macosx-10.5-x86_64-3.5/pypit/settings.lris_blue'
---> please contact the authors"

    I checked and found settings.* is actually in here: 

/Users/zhengcai/software/PYPIT/pypit/

    How can let PYPIT find this directory "/Users/zhengcai/software/PYPIT/pypit/" as default? 

I already added the following lines into ~/.cshrc

setenv TST_PYPIT /Users/zhengcai/software/PYPIT/test_suite/
setenv PYPIT /Users/zhengcai/software/PYPIT/pypit
setenv PYPIT_CALIBS /Users/zhengcai/software/PYPIT-development-suite/PYPIT_CALIBS

PYPIT / APF cookbook

A cookbook needs to be written (likely by me) for reducing APF data with PYPIT. Use the test case - after ingested - for cookbook.

recnorm

Consider whether this line in arproc.flatnorm:

            for i in xrange(recmean.size):
                recframe[i,:] /= recmean[i]

should be

            for i in xrange(recmean.size):
                recframe[:,i] /= recmean[i]

Can't install NIST folder

Running python setup.py install fails with
error: can't copy 'pypit/data/arc_lines/NIST': doesn't exist or not a regular file

Didn't notice it since I was installing through symlinks. Can probably just specify the directory in the keyword, trying with branch install_fix.

wtilt nan's in artrace

There are NAN's entering in the calculation of wtilt
in artrace.py at line 1087:

        if wmask.size != 0:
            wtilt[xint:xint+2*sz+1, j] = np.sqrt(2.0) / (1.4826 * np.median(np.abs(ytfit-model)[wmask]))

This leads to NANs for the tilts.
Not sure why, nor how to mitigate.

This is occurring in the Kast blue test suite.

DEIMOS

I'm working on a branch for developing the DEIMOS settings. It might be a good idea to have a separate branch for developing MOS reductions in general, which can then be merged into instrument-specific development.

WHT

Am starting a new branch for reducing WHT ISIS data

QA as Notebooks

It is possible to create ipython notebooks (.ipynb files)
that one can then run (automatically or manually).

Consider having some/all QA in this mode.

xdb vs pdb

I propose that throughout the code we use following debug import statement:

try:
from xastropy.xutils import xdebug as xdb
except:
import pdb as xdb

It would save us the trouble of changing xdb to pdb inline (and vice versa), especially if someone does not have xastropy installed. Then, throughout the code we consistently use: xdb.set_trace()

Any objections to me implementing this in my coming PR?

Arc lamps

We should attempt to set the linelist to match the lamps
that were indicated to be on in the header (when possible).

PYPIT / APF - scatter light

The APF contains an image of the pupil in the red part of the spectrum. This will likely need to be addressed when both reducing science and calibration images.

I include an example in the image below. This is a science frame so the tertiary hole is visible.

redrascal

Mac OSX El Capitan issues

Hey Ryan,
GSL, if installed by anaconda, causes issues in the test suite due to some relative paths (@rpath) that appear in .so files. This is an issue with the El Capitan operating system in particular (which introduced system integrity protection).
If you were able to change those relative paths to full paths (every installer should have defined the GSL_PATH and LD_LIBRARY_PATH environment variables in their rc files (see the new installation documentation I added), this issue would go away and people who installed GSL with anaconda could avoid some ugly hacks.

Thanks!
Camille

Scale in comb_frames

Should add a scaling option to comb_frames.

Distinct from weight [which was intended to only work with weightmean, I think]

xrange and range

It appears that Python3's range is the same as Python2's xrange.
There is no equivalent of Python2's range in Python3.

To be Python3 compliant we should replace all xrange instances with range
and I leave it to @rcooke-ast to decide whether to rename range as xrange throughout the package.

arsort.sort_data can't deal with single string input for canbe

See diff for [https://github.com/PYPIT/PYPIT/commit/f2918b22b8a91052e0f4e34dd49226cccba27ee8]

If canbe is a single string instead of a list of strings, the current version will attempt to loop through that string, .e.g, if canbe = 'pixflat', then cb = 'p'

arload.load_headers is failing to recognize strings with spaces

The line below replaces spaces with an empty string, and so any header entries with strings fail to be matched.

[https://github.com/PYPIT/PYPIT/commit/2718b76bc795ec008daf667315233e6f5152d402#diff-73e36695d52ea8945cfe778bacd5530fR578]

Is this addition necessary for the WHT settings? If not, the branch iss111 reverts the change.

Docstring documentation

Be able to get from dosctring documentation what kind of modes (e.g. armed, armlsd etc.), spectrographs (e.g. kast_blue, kast_red, lris_blue, etc.) are available.

arflags output

We should write the arflags as a JSON file (or YAML)
as part of the standard outputs. This would really save
the input parameters (i.e. including the defaults).

Deal with 1 pixel offset in LRIS with 2x binning in spatial

Here are the relevant lines in LowRedux:

;;Begin - MF Jan 2011: Original line
; imagecol = ncol-namps_(prepix+postpix)/xbin
; Updated line:
IF (strcmp(instrument, 'LRIS')) and (strmid(sxpar(hdr, 'DATE'), 0, 10) GT '2010-12-10') THEN BEGIN
IF xbin EQ 2 THEN imagecol = ncol-namps_(prepix+postpix-1)/xbin $
ELSE IF xbin EQ 1 THEN imagecol = ncol-namps_(prepix+postpix)/xbin
;;
;; JFH 12-29-2013: the prepix + postpix = 87 for the new chip, so we need this -1
;; for xbin =2
ENDIF ELSE imagecol = ncol-namps_(prepix+postpix)/xbin
;Note that this might be a problem even before 2010-12-10 for binned data.
;;End - MF Jan 2011

Scripts

remove .py from scripts
do some updates to handle the refactoring

I've started a branch on this

CR Rej in arcomb

Two things as regards flats:

  1. I think rej_cosmicray = 20.0 allows in way too many CRs
  2. Should consider adding a grow option (as defualt even). 1 pixel would probably be enough.

Arc line saturation

Deal with saturated arc lines (remove from
wavelength analysis).

Decide if MK_SATMASK is fine for long slit

LRISb Flexure

Mauna Kea sky can be very dark.
Likely requires its own sky spectrum for LRISb.

Internal Masters

I don't think the code is properly making use of internally stored master frames,
i.e. the calibrations are being re-made for each exposure. Am going to investigate
in a branch named reuse_master

Docs

I've opened another branch for docs more_docs.

Please use it.

File type in header

When we generate a FITS file with PYPIT, let's
be sure to add metadata describing it, e.g. "SPEC_1D"
and not rely on the filename.

Arc pixel offset

This will be a band-aid for now, but I am going to open a branch
to calculate the offset input id_pix and those calculated.

Variance

Need to examine the variance image and related
products in PYPIT.

Current results are markedly different from LowRedux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.