Skip to content

Commit

Permalink
Merge pull request #15 from JarronL/py3_060
Browse files Browse the repository at this point in the history
Python 3; WebbPSF 0.6.0
  • Loading branch information
JarronL committed Dec 10, 2017
2 parents 00c838f + d7a49fa commit 2bd6e9e
Show file tree
Hide file tree
Showing 81 changed files with 11,577 additions and 5,445 deletions.
41 changes: 41 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Revision History
================

v0.6.0 (Oct 2017)
-----------------

- Support for Python 3
- Updated code comments for ``sphinx`` and ``readthedocs`` documentation
- Create ``setup.py`` install file
- Modify grism PSF shapes due to aperture shape
- Detector frames times based on ASIC microcode build 10
- Headers for DMS data

v0.5.0 (Feb 2017)
-----------------

- Initial GitHub release
- Match version numbering to ``WebbPSF`` equivalent
- ND Acquisition mode
- Ramp settings optimizer
- Can now simulate ramps with detector noise
- Query Euclid's IPAC server for position-dependent Zodiacal emission
- Added example Jupyter notebooks

v0.1.2 (Jan 2017)
-----------------
- Observations subclass for coronagraphs and direct imaging

v0.1.1 (Sep 2016)
-----------------
- Add support for LW slitless grism
- Add support for extended sources

v0.1.0 (Aug 2016)
-----------------
- Rewrite of ``SimNRC`` and rename ``pynrc``
- Object oriented ``multiaccum``, ``DetectorOps``, and ``NIRCam`` classes
- Create separate detector instances in ``NIRCam`` class


-----------------------
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017 Jarron Leisenring
Copyright (c) 2017 Jarron Leisenring & contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include LICENSE
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ pyNRC - A JWST NIRCam ETC
**!!Under Development!!**

pyNRC is a set of Python-based tools for planning observations with JWST NIRCam,
such as an ETC, ~~rudimentary overhead calculator~~ (TBI), and simple image slope
simulator.
pyNRC works for a vareity NIRCam observing modes including direct imaging,
such as an ETC, ~~rudimentary overhead calculator~~ (TBI), simple image slope
simulator, and full-blown DMS simulator.

The module works for a vareity NIRCam observing modes including direct imaging,
coronagraphic imaging, slitless grism spectroscopy, ~~DHS observations~~ (TBI),
and weak lens imaging.
All PSFs are generated via WebbPSF (https://webbpsf.readthedocs.io/en/stable/) to reproduce
All PSFs are generated via WebbPSF (https://webbpsf.readthedocs.io) to reproduce
realistic JWST images and spectra.

**Note**: pyNRC allows for more modes than are officially allowed by the Observatory,
Expand Down Expand Up @@ -43,15 +44,11 @@ startup file, such as ``.bashrc``:

- ``export PYNRC_PATH="/Users/Bob/pynrc_data/"``

You can grab the required data files at: http://mips.as.arizona.edu/~jleisenring/pynrc/pynrc_data_v0.5.0.tar. One of the directories includes speckle maps for computing contrasts. These files can either be computed directly via the generate_speckle_maps.ipynb or downloaded at http://mips.as.arizona.edu/~jleisenring/pynrc/speckle_maps.tar.
You can grab the required data files at: http://mips.as.arizona.edu/~jleisenring/pynrc/pynrc_data_v0.6.0.tar.

## Requirements

+ Python 2.7.x (3.x compatability not guaranteed, but vetting welcome!)
+ WebbPSF >=0.5.0 (https://pythonhosted.org/webbpsf/)
+ Astropy >=1.2.0 (http://www.astropy.org/)
+ Pysynphot >=0.9.8.2 (https://pysynphot.readthedocs.io)
+ Others???

#### Recommended
+ Seaborn >=0.7.0 (https://seaborn.pydata.org/)
+ Python >=2.7.0 or >=3.5
+ WebbPSF >=0.6.0 (https://pythonhosted.org/webbpsf/)
+ Astropy >=1.3.0 (http://www.astropy.org/)
+ Pysynphot >=0.9.8.0 (https://pysynphot.readthedocs.io)
44 changes: 44 additions & 0 deletions TODO.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Planned Updates
---------------

FoV aware positions
+++++++++++++++++++
- Background roll off at grism edges
- Filter location relative offsets
- SIAF info
- Subarray positions
- SCA Gaps and Module gaps

Detector updates in ngNRC.py
++++++++++++++++++++++++++++
- Pixel non-linearity
- Intrapixel Capacitance (IPC)
- Post-pixel Coupling (PPC) due to ADC "smearing"
- Persistence/latent image
- Optical distortions
- QE variations across a pixel's surface
- RTN Noise
- Flat field variations

PSF Related
+++++++++++
- Actual coronagraphic throughput from FITS files
- Include dispersion of coronagraph PSF
- PSF Jitter options
- Bar Mask offsets (using nrc.options['bar_offset'])
- PSF convolution based on geometric spot size

Observation Classes
+++++++++++++++++++
- Grism time series
- Photometric time series (incl. weak lens)
- Wide-field grism
- Wide field imaging (esp. SW modules)

Miscellaneous
+++++++++++++
- Random cosmic ray hits in exposure simulator
- Ramp optimizer warning for large number of group loops?
- multi-thread ramp optimizer?
- DHS mode

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = pynrc
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7 changes: 7 additions & 0 deletions docs/api/detector_classes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Detector Classes
================

.. toctree::

pynrc.DetectorOps.rst
pynrc.multiaccum.rst
111 changes: 111 additions & 0 deletions docs/api/math_tools.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
.. currentmodule:: pynrc

Math Tools
==============

.. rubric:: Coordinates Summary

.. autosummary::

~pynrc.maths.coords.dist_image
~pynrc.maths.coords.xy_to_rtheta
~pynrc.maths.coords.rtheta_to_xy
~pynrc.maths.coords.xy_rot
~pynrc.maths.coords.Tel2Sci_info
~pynrc.maths.coords.det_to_V2V3
~pynrc.maths.coords.V2V3_to_det
~pynrc.maths.coords.plotAxes

.. rubric:: Image Manipulation Summary

.. autosummary::

~pynrc.maths.image_manip.hist_indices
~pynrc.maths.image_manip.binned_statistic
~pynrc.maths.image_manip.frebin
~pynrc.maths.image_manip.fshift
~pynrc.maths.image_manip.fourier_imshift
~pynrc.maths.image_manip.shift_subtract
~pynrc.maths.image_manip.align_LSQ
~pynrc.maths.image_manip.scale_ref_image
~pynrc.maths.image_manip.optimal_difference
~pynrc.maths.image_manip.pad_or_cut_to_size
~pynrc.maths.image_manip.fix_nans_with_med

.. rubric:: Polynomial Fitting Summary

.. autosummary::

~pynrc.maths.fast_poly.jl_poly_fit
~pynrc.maths.fast_poly.jl_poly

.. rubric:: Robust Summary

.. autosummary::

~pynrc.maths.robust.biweightMean
~pynrc.maths.robust.checkfit
~pynrc.maths.robust.linefit
~pynrc.maths.robust.mean
~pynrc.maths.robust.medabsdev
~pynrc.maths.robust.mode
~pynrc.maths.robust.polyfit
~pynrc.maths.robust.std


----------------------------

``pynrc.maths.coords``
--------------------------

.. autofunction:: pynrc.maths.coords.dist_image
.. autofunction:: pynrc.maths.coords.xy_to_rtheta
.. autofunction:: pynrc.maths.coords.rtheta_to_xy
.. autofunction:: pynrc.maths.coords.xy_rot
.. autofunction:: pynrc.maths.coords.Tel2Sci_info
.. autofunction:: pynrc.maths.coords.det_to_V2V3
.. autofunction:: pynrc.maths.coords.V2V3_to_det
.. autofunction:: pynrc.maths.coords.plotAxes

----------------------------

``pynrc.maths.image_manip``
----------------------------

.. autofunction:: pynrc.maths.image_manip.hist_indices
.. autofunction:: pynrc.maths.image_manip.binned_statistic
.. autofunction:: pynrc.maths.image_manip.frebin
.. autofunction:: pynrc.maths.image_manip.fshift
.. autofunction:: pynrc.maths.image_manip.fourier_imshift
.. autofunction:: pynrc.maths.image_manip.shift_subtract
.. autofunction:: pynrc.maths.image_manip.align_LSQ
.. autofunction:: pynrc.maths.image_manip.scale_ref_image
.. autofunction:: pynrc.maths.image_manip.optimal_difference
.. autofunction:: pynrc.maths.image_manip.pad_or_cut_to_size
.. autofunction:: pynrc.maths.image_manip.fix_nans_with_med

----------------------------

``pynrc.maths.fast_poly``
--------------------------

.. autofunction:: pynrc.maths.fast_poly.jl_poly_fit
.. autofunction:: pynrc.maths.fast_poly.jl_poly

----------------------------

``pynrc.maths.robust``
----------------------------

Small collection of robust statistical estimators based on functions from
Henry Freudenriech (Hughes STX) statistics library (called ROBLIB) that have
been incorporated into the AstroIDL User's Library.

.. autofunction:: pynrc.maths.robust.biweightMean
.. autofunction:: pynrc.maths.robust.checkfit
.. autofunction:: pynrc.maths.robust.linefit
.. autofunction:: pynrc.maths.robust.mean
.. autofunction:: pynrc.maths.robust.medabsdev
.. autofunction:: pynrc.maths.robust.mode
.. autofunction:: pynrc.maths.robust.polyfit
.. autofunction:: pynrc.maths.robust.std
23 changes: 23 additions & 0 deletions docs/api/nghxrg.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
nghxrg
=================

.. currentmodule:: pynrc.simul.nghxrg

.. autoclass:: pynrc.simul.nghxrg.HXRGNoise
:show-inheritance:

.. rubric:: Methods Summary

.. autosummary::

~pynrc.simul.nghxrg.HXRGNoise.message
~pynrc.simul.nghxrg.HXRGNoise.mknoise
~pynrc.simul.nghxrg.HXRGNoise.pink_noise
~pynrc.simul.nghxrg.HXRGNoise.white_noise

.. rubric:: Methods Documentation

.. automethod:: message
.. automethod:: mknoise
.. automethod:: pink_noise
.. automethod:: white_noise
16 changes: 16 additions & 0 deletions docs/api/ngnrc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ngNRC
=================

.. currentmodule:: pynrc.simul.ngNRC

.. rubric:: Summary

.. autosummary::

~pynrc.simul.ngNRC.SCAnoise
~pynrc.simul.ngNRC.slope_to_ramp

.. rubric:: Documentation

.. autofunction:: pynrc.simul.ngNRC.SCAnoise
.. autofunction:: pynrc.simul.ngNRC.slope_to_ramp
41 changes: 41 additions & 0 deletions docs/api/nrc_utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.. currentmodule:: pynrc

NIRCam Tools
============

.. rubric:: Functions Summary

.. autosummary::

~nrc_utils.read_filter
~nrc_utils.psf_coeff
~nrc_utils.wfed_coeff
~nrc_utils.gen_image_coeff
~nrc_utils.bg_sensitivity
~nrc_utils.sat_limit_webbpsf
~nrc_utils.pix_noise
~nrc_utils.channel_select
~nrc_utils.grism_res
~nrc_utils.build_mask
~nrc_utils.coron_trans
~nrc_utils.offset_bar
~nrc_utils.config2
~nrc_utils.create_detops


.. rubric:: Documentation

.. autofunction:: pynrc.nrc_utils.read_filter
.. autofunction:: pynrc.nrc_utils.psf_coeff
.. autofunction:: pynrc.nrc_utils.wfed_coeff
.. autofunction:: pynrc.nrc_utils.gen_image_coeff
.. autofunction:: pynrc.nrc_utils.bg_sensitivity
.. autofunction:: pynrc.nrc_utils.sat_limit_webbpsf
.. autofunction:: pynrc.nrc_utils.pix_noise
.. autofunction:: pynrc.nrc_utils.channel_select
.. autofunction:: pynrc.nrc_utils.grism_res
.. autofunction:: pynrc.nrc_utils.build_mask
.. autofunction:: pynrc.nrc_utils.coron_trans
.. autofunction:: pynrc.nrc_utils.offset_bar
.. autofunction:: pynrc.nrc_utils.config2
.. autofunction:: pynrc.nrc_utils.create_detops
7 changes: 7 additions & 0 deletions docs/api/obs_classes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Observation Classes
===================

.. toctree::

pynrc.NIRCam.rst
pynrc.obs_coronagraphy.rst

0 comments on commit 2bd6e9e

Please sign in to comment.