pynrc


Namepynrc JSON
Version 1.3.2 PyPI version JSON
download
home_pagehttps://pynrc.readthedocs.io
SummaryJWST NIRCam ETC and Simulator
upload_time2024-10-07 14:31:26
maintainerNone
docs_urlNone
authorJarron Leisenring
requires_pythonNone
licenseMIT license
keywords jwst nircam etc simulator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ========
Overview
========

A JWST NIRCam ETC and Simulator
===============================

.. image:: https://img.shields.io/pypi/v/pynrc.svg
        :target: https://pypi.python.org/pypi/pynrc
        :alt: Badge showing current released PyPI version
        
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.5829553.svg
        :target: https://doi.org/10.5281/zenodo.5829553
        :alt: Zenodo DOI
   
.. image:: https://readthedocs.org/projects/pynrc/badge/?version=latest
        :target: https://pynrc.readthedocs.io/en/latest/?badge=latest
        :alt: Documentation Status

*Authors:* `Jarron Leisenring <https://github.com/JarronL>`_ 
(U. of Arizona, Steward Observatory)

*Contributors:* `Everett Schlawin <https://github.com/eas342>`_, 
`Jonathan Fraine <https://github.com/exowanderer>`_, 
`Jonathan Aguilar <https://github.com/aggle>`_

pyNRC is a set of Python-based tools for planning observations with JWST NIRCam, such as an ETC, a simple slope image simulator, and an enhanced data simulator compatible with the JWST pipeline.

While special attention has been placed on NIRCam coronagraphic modes, this package also works for a variety of NIRCam observing modes including:

- direct imaging 
- coronagraphic imaging
- weak lens imaging
- slitless grism spectroscopy
- DHS observations (TBI)

All PSFs are generated by `WebbPSF <https://webbpsf.readthedocs.io>`_ as implemented by the `WebbPSF Extensions <https://github.com/JarronL/webbpsf_ext>`_ package to reproduce realistic JWST images and spectra.

Documentation can be found at https://pynrc.readthedocs.io.

Similar to some of its dependencies, pyNRC requires input data files in order to generate simulations. Due to the size of these files, they are not included with this source distribution. Please see the documentation for instructions on how to to download the required data files.

.. warning:: 

  pyNRC enables more modes than are officially allowed by the Observatory, (ie., filter + coronagraphic combinations, subarray sizes, etc.). Just because you can do something with pyNRC does not mean it will be supported in flight. Check out `JDocs`_ for more information.


.. _JDocs: https://jwst-docs.stsci.edu/jwst-near-infrared-camera/nircam-observing-modes


Simulating PSFs
===============

Simulating PSFs with WebbPSF can become computationally expensive if generating new ones on the fly, especially considering JWST PSFs vary with respect to wavelength, field position, and time-dependent wavefront error drift. In an effort to speed up this process, pyNRC uses WebbPSF to generate a series of monochromatic PSF simulations, then produces polynomial fits to each oversampled pixel. Storing the coefficients rather than a library of PSFS allows for quick creation (via matrix multiplication) of PSF images for an arbitrary number of wavelengths (subject to hardware memory limitations, of course). The applications range from quickly creating PSFs for many different stellar types over wide bandpasses to generating a large number of monochromatic PSFs for spectral dispersion.

In addition, each science instrument PSF is dependent on the detector position due to field-dependent wavefront errors. Such changes are tracked in WebbPSF, but it becomes burdensome to generate new PSFs from scratch at each location, especially for large starfields. Instead, these changes can be stored by the fitting the residuals of the PSF coefficients across an instrument's field of view, then interpolating for an arbitrary location. A similar scheme can be achieved for coronagraphic occulters, where the PSF changes as the source position moves with respect to the mask.

JWST's thermal evolution (e.g., changing the angle of the sunshield after slewing to a new target) causes small but significant distortions to the telescope backplane. WebbPSF has tools to modify OPDs, but high-fidelity simulations take time to calculate. Since the change to the PSF coefficients varies smoothly with respect to WFE drift components, it's simple to parameterize the coefficient residuals in a fashion similar to the field-dependence.


Revision History
================

v1.3.2 (Oct 7, 2024)
----------------------

 - Improved handling of LWBAR in ``nrc_hci`` ``obs_hci`` classes. Specifically fixed double counting of PSF offsets along the bar.

v1.3.1 (Sept 19, 2024)
----------------------

 - Fix index transformations between image and oversampled equivalent

v1.3.0 (Sept 19, 2024)
----------------------

 - Bump to version 1.3.0 to attempt to fix PyPI upload issue

v1.2.2 (Sept 19, 2024)
----------------------

 - Bug fix in charge migration to check to break out if no saturated pixels
 - Correctly crop stellar PSF in ``obs_hci`` class while generating slope image

v1.2.1 (May 24, 2024)
---------------------

 - Bug fix for poppy requirement version. (should have been >1.1.0 rather than >1.2.0)

v1.2.0 (May 13, 2024)
---------------------

 - Bring up to date with WebbPSF v1.2.0 and webbpsf_ext v1.2.0
 - Add analysis tools for PCA and NMF PSF subtraction
 - Add a number of simulation features to match flight performance

v1.0.4 (Dec 28, 2021)
---------------------

 - check if ``im_star`` is int or float if not None
 - set ``nexposures = 1`` for level1b using ``NIRCam()`` class function
 - deprecate nghxrg.py
 - add tutorial ipynb files
 - update api docs auto generation
 - use ``webbpsf_ext`` v1.0.4

v1.0.3 (Dec 23, 2021)
---------------------

- Minor updates to seamlessly generate new releases on PyPI and new docs on readthedocs

v1.0.1 (Dec 14, 2021)
---------------------

- Default OPD JWST_OTE_OPD_RevAA_prelaunch_predicted.fits

v1.0.0 (Nov 22, 2021)
---------------------

- Updates to work with WebbPSF v1 release candidate
- Move PSF generation to new ``webbpsf_ext`` package (https://github.com/JarronL/webbpsf_ext)
- Create DMS-like level1b FITS files using pipeline data models for imaging and coronagraphy
- PSF coefficients now use Legendre polynomials by default
- Create calibration files for each SCA (darks, IPC, noise, flats, linearity, etc)
- Background roll-off at grism edges
- SIAF-aware locations

v0.9.0beta (no release)
-----------------------

- Updates to work with WebbPSF 0.9.0.
- Start working on commissioning and DMS-like data
- Add more advanced time-dependent detector effects
- BEX model isochrones for low-mass companions from Linder et al (2019)
- There was a pandemic...

v0.8.0beta (no release)
-----------------------

- Updates to work with WebbPSF 0.8.0.
- Phasing out support for Python 2
- Add info on saturation limits in terms of surface brightness 
- Include option to create grism 2nd order
- Detector pixel timing bugs
- Field-dependent WFE extrapolated beyond FoV for better sampling diversity
- Included field-dependent WFE for coronagraphy
- Added wavelength dispersion of LW coronagraphic PSF

v0.7.0 (Jun 2018)
-----------------

- Did not make it out of development before WebbPSF 0.8.0 release.
- Works with WebbPSF 0.7.0.

  - Field-dependent WFE
  - Image plane distortions

- Implemented ``jwst_backgrounds`` (not required)


v0.6.5 (Mar 2018)
-----------------

- Fixed a critical bug where the off-axis PSF size was incorrect
  when performing WFE drift calculations.

v0.6.4 (Mar 2018)
-----------------

- Off-axis PSFs now get drifted in the same way as their on-axis
  counterparts.
- Created an intermediate ``nrc_hci`` class to enable offsets of WFE drifted PSFs.


v0.6.3 (Mar 2018)
-----------------

- First PyPI release.
- Effectively the same as 0.6.2, but better documentation of packaging and distributing.


v0.6.2 (Mar 2018)
-----------------

- Implemented coronagraphic wedges, including arbitrary offsets along bar
- Renamed ``obs_coronagraphy`` to ``~pynrc.obs_hci``

  - Faster modeling of off-axis PSFs
  - Include coronagraphic features (e.g.: ND squares) in slope images
  - Roll subtracted images include option to use Roll1-Roll2
  - Fixed bug that was slowing down PSF convolution of disks

- Can now generate docs directly from Jupyter notebooks using nbsphinx extension
- Coronagraphic tutorials for docs
- Create the ``source_spectrum`` class to fit spectra to observed photometry.

v0.6.0 (Dec 2017)
-----------------

- Support for Python 3 (mostly ``map``, ``dict``, and index fixes)
- 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
- Three major changes to PSF coefficients

  - coefficients based on module (SWA, SWB, LWA, LWB), rather than filter
  - WFE drift coefficient relations
  - field-dependent coefficient relation

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 time/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

            

Raw data

            {
    "_id": null,
    "home_page": "https://pynrc.readthedocs.io",
    "name": "pynrc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "jwst nircam etc simulator",
    "author": "Jarron Leisenring",
    "author_email": "jarronl@arizona.edu",
    "download_url": "https://files.pythonhosted.org/packages/da/0a/22d038a81589885822fd2e8459207d894c2584098ebff330f44893d0f9c6/pynrc-1.3.2.tar.gz",
    "platform": null,
    "description": "========\nOverview\n========\n\nA JWST NIRCam ETC and Simulator\n===============================\n\n.. image:: https://img.shields.io/pypi/v/pynrc.svg\n        :target: https://pypi.python.org/pypi/pynrc\n        :alt: Badge showing current released PyPI version\n        \n.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.5829553.svg\n        :target: https://doi.org/10.5281/zenodo.5829553\n        :alt: Zenodo DOI\n   \n.. image:: https://readthedocs.org/projects/pynrc/badge/?version=latest\n        :target: https://pynrc.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n*Authors:* `Jarron Leisenring <https://github.com/JarronL>`_ \n(U. of Arizona, Steward Observatory)\n\n*Contributors:* `Everett Schlawin <https://github.com/eas342>`_, \n`Jonathan Fraine <https://github.com/exowanderer>`_, \n`Jonathan Aguilar <https://github.com/aggle>`_\n\npyNRC is a set of Python-based tools for planning observations with JWST NIRCam, such as an ETC, a simple slope image simulator, and an enhanced data simulator compatible with the JWST pipeline.\n\nWhile special attention has been placed on NIRCam coronagraphic modes, this package also works for a variety of NIRCam observing modes including:\n\n- direct imaging \n- coronagraphic imaging\n- weak lens imaging\n- slitless grism spectroscopy\n- DHS observations (TBI)\n\nAll PSFs are generated by `WebbPSF <https://webbpsf.readthedocs.io>`_ as implemented by the `WebbPSF Extensions <https://github.com/JarronL/webbpsf_ext>`_ package to reproduce realistic JWST images and spectra.\n\nDocumentation can be found at https://pynrc.readthedocs.io.\n\nSimilar to some of its dependencies, pyNRC requires input data files in order to generate simulations. Due to the size of these files, they are not included with this source distribution. Please see the documentation for instructions on how to to download the required data files.\n\n.. warning:: \n\n  pyNRC enables more modes than are officially allowed by the Observatory, (ie., filter + coronagraphic combinations, subarray sizes, etc.). Just because you can do something with pyNRC does not mean it will be supported in flight. Check out `JDocs`_ for more information.\n\n\n.. _JDocs: https://jwst-docs.stsci.edu/jwst-near-infrared-camera/nircam-observing-modes\n\n\nSimulating PSFs\n===============\n\nSimulating PSFs with WebbPSF can become computationally expensive if generating new ones on the fly, especially considering JWST PSFs vary with respect to wavelength, field position, and time-dependent wavefront error drift. In an effort to speed up this process, pyNRC uses WebbPSF to generate a series of monochromatic PSF simulations, then produces polynomial fits to each oversampled pixel. Storing the coefficients rather than a library of PSFS allows for quick creation (via matrix multiplication) of PSF images for an arbitrary number of wavelengths (subject to hardware memory limitations, of course). The applications range from quickly creating PSFs for many different stellar types over wide bandpasses to generating a large number of monochromatic PSFs for spectral dispersion.\n\nIn addition, each science instrument PSF is dependent on the detector position due to field-dependent wavefront errors. Such changes are tracked in WebbPSF, but it becomes burdensome to generate new PSFs from scratch at each location, especially for large starfields. Instead, these changes can be stored by the fitting the residuals of the PSF coefficients across an instrument's field of view, then interpolating for an arbitrary location. A similar scheme can be achieved for coronagraphic occulters, where the PSF changes as the source position moves with respect to the mask.\n\nJWST's thermal evolution (e.g., changing the angle of the sunshield after slewing to a new target) causes small but significant distortions to the telescope backplane. WebbPSF has tools to modify OPDs, but high-fidelity simulations take time to calculate. Since the change to the PSF coefficients varies smoothly with respect to WFE drift components, it's simple to parameterize the coefficient residuals in a fashion similar to the field-dependence.\n\n\nRevision History\n================\n\nv1.3.2 (Oct 7, 2024)\n----------------------\n\n - Improved handling of LWBAR in ``nrc_hci`` ``obs_hci`` classes. Specifically fixed double counting of PSF offsets along the bar.\n\nv1.3.1 (Sept 19, 2024)\n----------------------\n\n - Fix index transformations between image and oversampled equivalent\n\nv1.3.0 (Sept 19, 2024)\n----------------------\n\n - Bump to version 1.3.0 to attempt to fix PyPI upload issue\n\nv1.2.2 (Sept 19, 2024)\n----------------------\n\n - Bug fix in charge migration to check to break out if no saturated pixels\n - Correctly crop stellar PSF in ``obs_hci`` class while generating slope image\n\nv1.2.1 (May 24, 2024)\n---------------------\n\n - Bug fix for poppy requirement version. (should have been >1.1.0 rather than >1.2.0)\n\nv1.2.0 (May 13, 2024)\n---------------------\n\n - Bring up to date with WebbPSF v1.2.0 and webbpsf_ext v1.2.0\n - Add analysis tools for PCA and NMF PSF subtraction\n - Add a number of simulation features to match flight performance\n\nv1.0.4 (Dec 28, 2021)\n---------------------\n\n - check if ``im_star`` is int or float if not None\n - set ``nexposures = 1`` for level1b using ``NIRCam()`` class function\n - deprecate nghxrg.py\n - add tutorial ipynb files\n - update api docs auto generation\n - use ``webbpsf_ext`` v1.0.4\n\nv1.0.3 (Dec 23, 2021)\n---------------------\n\n- Minor updates to seamlessly generate new releases on PyPI and new docs on readthedocs\n\nv1.0.1 (Dec 14, 2021)\n---------------------\n\n- Default OPD JWST_OTE_OPD_RevAA_prelaunch_predicted.fits\n\nv1.0.0 (Nov 22, 2021)\n---------------------\n\n- Updates to work with WebbPSF v1 release candidate\n- Move PSF generation to new ``webbpsf_ext`` package (https://github.com/JarronL/webbpsf_ext)\n- Create DMS-like level1b FITS files using pipeline data models for imaging and coronagraphy\n- PSF coefficients now use Legendre polynomials by default\n- Create calibration files for each SCA (darks, IPC, noise, flats, linearity, etc)\n- Background roll-off at grism edges\n- SIAF-aware locations\n\nv0.9.0beta (no release)\n-----------------------\n\n- Updates to work with WebbPSF 0.9.0.\n- Start working on commissioning and DMS-like data\n- Add more advanced time-dependent detector effects\n- BEX model isochrones for low-mass companions from Linder et al (2019)\n- There was a pandemic...\n\nv0.8.0beta (no release)\n-----------------------\n\n- Updates to work with WebbPSF 0.8.0.\n- Phasing out support for Python 2\n- Add info on saturation limits in terms of surface brightness \n- Include option to create grism 2nd order\n- Detector pixel timing bugs\n- Field-dependent WFE extrapolated beyond FoV for better sampling diversity\n- Included field-dependent WFE for coronagraphy\n- Added wavelength dispersion of LW coronagraphic PSF\n\nv0.7.0 (Jun 2018)\n-----------------\n\n- Did not make it out of development before WebbPSF 0.8.0 release.\n- Works with WebbPSF 0.7.0.\n\n  - Field-dependent WFE\n  - Image plane distortions\n\n- Implemented ``jwst_backgrounds`` (not required)\n\n\nv0.6.5 (Mar 2018)\n-----------------\n\n- Fixed a critical bug where the off-axis PSF size was incorrect\n  when performing WFE drift calculations.\n\nv0.6.4 (Mar 2018)\n-----------------\n\n- Off-axis PSFs now get drifted in the same way as their on-axis\n  counterparts.\n- Created an intermediate ``nrc_hci`` class to enable offsets of WFE drifted PSFs.\n\n\nv0.6.3 (Mar 2018)\n-----------------\n\n- First PyPI release.\n- Effectively the same as 0.6.2, but better documentation of packaging and distributing.\n\n\nv0.6.2 (Mar 2018)\n-----------------\n\n- Implemented coronagraphic wedges, including arbitrary offsets along bar\n- Renamed ``obs_coronagraphy`` to ``~pynrc.obs_hci``\n\n  - Faster modeling of off-axis PSFs\n  - Include coronagraphic features (e.g.: ND squares) in slope images\n  - Roll subtracted images include option to use Roll1-Roll2\n  - Fixed bug that was slowing down PSF convolution of disks\n\n- Can now generate docs directly from Jupyter notebooks using nbsphinx extension\n- Coronagraphic tutorials for docs\n- Create the ``source_spectrum`` class to fit spectra to observed photometry.\n\nv0.6.0 (Dec 2017)\n-----------------\n\n- Support for Python 3 (mostly ``map``, ``dict``, and index fixes)\n- Updated code comments for ``sphinx`` and ``readthedocs`` documentation\n- Create ``setup.py`` install file\n- Modify grism PSF shapes due to aperture shape\n- Detector frames times based on ASIC microcode build 10\n- Headers for DMS data\n- Three major changes to PSF coefficients\n\n  - coefficients based on module (SWA, SWB, LWA, LWB), rather than filter\n  - WFE drift coefficient relations\n  - field-dependent coefficient relation\n\nv0.5.0 (Feb 2017)\n-----------------\n\n- Initial GitHub release\n- Match version numbering to ``WebbPSF`` equivalent\n- ND Acquisition mode\n- Ramp settings optimizer\n- Can now simulate ramps with detector noise\n- Query Euclid's IPAC server for time/position-dependent Zodiacal emission\n- Added example Jupyter notebooks\n\nv0.1.2 (Jan 2017)\n-----------------\n- Observations subclass for coronagraphs and direct imaging\n\nv0.1.1 (Sep 2016)\n-----------------\n- Add support for LW slitless grism\n- Add support for extended sources\n\nv0.1.0 (Aug 2016)\n-----------------\n- Rewrite of ``SimNRC`` and rename ``pynrc``\n- Object oriented ``multiaccum``, ``DetectorOps``, and ``NIRCam`` classes\n- Create separate detector instances in ``NIRCam`` class\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "JWST NIRCam ETC and Simulator",
    "version": "1.3.2",
    "project_urls": {
        "Homepage": "https://pynrc.readthedocs.io"
    },
    "split_keywords": [
        "jwst",
        "nircam",
        "etc",
        "simulator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "74ec037f58d6a9eea71903dace117b9964e4d07876b9b8ac04ab8b18aa145a38",
                "md5": "2da39fd93cb91cc7b46e85600318eaaa",
                "sha256": "1816d22e67bcb48f5247f5a0afc6ee693bcf64fa0b00b408e0ef3ba0cf62d219"
            },
            "downloads": -1,
            "filename": "pynrc-1.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2da39fd93cb91cc7b46e85600318eaaa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 403544,
            "upload_time": "2024-10-07T14:31:24",
            "upload_time_iso_8601": "2024-10-07T14:31:24.543908Z",
            "url": "https://files.pythonhosted.org/packages/74/ec/037f58d6a9eea71903dace117b9964e4d07876b9b8ac04ab8b18aa145a38/pynrc-1.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da0a22d038a81589885822fd2e8459207d894c2584098ebff330f44893d0f9c6",
                "md5": "8d3f2de5272d8d915ff519fca2bdfcc3",
                "sha256": "e32430bd47644909bac71e9bcd4a74be225297625ca8291d58d3435cc8c4d394"
            },
            "downloads": -1,
            "filename": "pynrc-1.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "8d3f2de5272d8d915ff519fca2bdfcc3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 1871609,
            "upload_time": "2024-10-07T14:31:26",
            "upload_time_iso_8601": "2024-10-07T14:31:26.309191Z",
            "url": "https://files.pythonhosted.org/packages/da/0a/22d038a81589885822fd2e8459207d894c2584098ebff330f44893d0f9c6/pynrc-1.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-07 14:31:26",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pynrc"
}
        
Elapsed time: 0.62276s