Skip to content

Commit

Permalink
pipit release prep
Browse files Browse the repository at this point in the history
  • Loading branch information
JarronL committed Dec 10, 2017
1 parent 4b4b416 commit 57418f2
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 58 deletions.
37 changes: 4 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pyNRC - A JWST NIRCam ETC
=========================

*Authors:* Jarron Leisenring (University of Arizona)
*Authors:* Jarron Leisenring (UA)

*Contributors:* Everett Schlawin (University of Arizona), Jonathan Fraine (STScI)
*Contributors:* Everett Schlawin (UA), Jonathan Fraine (STScI)

**!!Under Development!!**

pyNRC is a set of Python-based tools for planning observations with JWST NIRCam,
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,
The module works for a variety of 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) to reproduce
Expand All @@ -22,33 +22,4 @@ realistic JWST images and spectra.
Just because you can do something with pyNRC does not mean it will be supported.
Check out https://jwst-docs.stsci.edu/display/JTI/NIRCam+Observing+Modes for more information.

## Installation

At the moment, the quickest way to install pyNRC into your existing Python installation
is to download or clone this repository and then create a .pth file in your Python
site-packages directory that points to the pyNRC directory.

For instance, if this git repository exists on your local machine at
``/Users/Bob/GitHub/pynrc/`` and you have an Anaconda Python 2.7 installation at
``/Users/Bob/anaconda/``, then you merely need to create some
file ``/Users/Bob/anaconda/lib/python2.7/site-packages/somefile.pth`` with the GitHub
folder path as context (``/Users/Bob/GitHub/``).
This method will add the GitHub directory to your Python path so that pynrc can be imported.

#### Data files

In addition, you must create a data directory that will hold cached information
about the PSFs. Nominally, this is called ``pynrc_data`` and can be placed anywhere
on your local machine. Create an environment variable ``PYNRC_PATH`` in your shell
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.6.0.tar.

## Requirements

+ 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)
The documentation is available at https://pynrc.readthedocs.org
8 changes: 1 addition & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ Documentation for pyNRC (pynrc)

installation.rst


Getting Started with pyNRC
==========================

Installation

ETC Basic Usage

ETC Advanced Usage
Expand All @@ -48,6 +42,6 @@ see :ref:`LICENSE <license>`.
.. attention:: Citing pyNRC

If you make use of pyNRC in your work, please cite the following paper:
`Leisenring et al. 2017, "pyNRC: A NIRCam ETC and Simulation Toolset"`
`Leisenring et al. 2018, "pyNRC: A NIRCam ETC and Simulation Toolset"`

Copyright (c) 2017 Jarron Leisenring and contributors.
27 changes: 19 additions & 8 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@ Requirements
`SciPy <https://www.scipy.org>`_,
and `matplotlib <https://www.matplotlib.org>`_
* `Astropy <http://www.astropy.org>`_ 1.2.0+
* `pysynphot <https://pysynphot.readthedocs.io>`_ 0.9.8.0+
* `pysynphot <https://pysynphot.readthedocs.io>`_ 0.9.8+
* `WebbPSF <https://webbpsf.readthedocs.io>`_ 0.6.0+
and of its dependencies.
* `psutil <https://pypi.python.org/pypi/psutil>`_ (optional, but useful)


Installing with pip
--------------------
You can install the ``pynrc`` package through pip::

$ pip install pynrc
.. admonition:: Note: To be completed
You can install the ``pynrc`` package through pip::

$ pip install pynrc

Note that the pip command only installs the program code.
You still must download and install the data files,
as :ref:`described below <data_install>`.
Note that the pip command only installs the program code.
You still must download and install the data files,
as :ref:`described below <data_install>`.

Installing from source
----------------------
Expand All @@ -42,7 +44,9 @@ In this case, you will need to clone the git repository::
Then install the package with::

$ cd pynrc
$ python setup.py install
$ pip install .
.. $ python setup.py install
.. _data_install:
Expand All @@ -55,7 +59,7 @@ SCA biases and darks, stellar models, and exoplanet models are
distributed separately. To run ``pynrc``, you must download these
files and define the ``PYNRC_PATH`` environment variable.

1. Download the following file: `pynrc_data_v0.6.0.tar <http://mips.as.arizona.edu/~jleisenring/pynrc/pynrc_data_v0.6.0.tar>`_ [approx. 1 GB]
1. Download the following file: `pynrc_data_v0.6.0.tar <http://mips.as.arizona.edu/~jleisenring/pynrc/pynrc_data_v0.6.0.tar>`_ [approx. 3.3 GB]
2. Untar ``pynrc_data_v0.6.0.tar`` into a directory of your choosing.
3. Set the environment variable ``PYNRC_PATH`` to point to that directory.
For bash, for example::
Expand All @@ -72,6 +76,13 @@ You should now be able to successfully ``import pynrc`` in a Python session.
of ``pynrc``, and then update to a newer version, the software may prompt
you to download and install a new updated version of the data files.

Install everything from scratch
--------------------------------

.. admonition:: Note: To be completed

Description for installing everything from scratch into a clean
Anaconda environment.

Testing
--------
Expand Down
10 changes: 4 additions & 6 deletions pynrc/nrc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
pixscale_LW = nc_temp._pixelscale_long
del nc_temp

opd_default = ('OPD_RevW_ote_for_NIRCam_requirements.fits', 0)
opd_default = ('OPD_RevW_ote_for_NIRCam_requirements.fits.gz', 0)

###########################################################################
#
Expand Down Expand Up @@ -563,9 +563,8 @@ def __init__(self, instrument, include_oversize=False, **kwargs):

# TODO load here the wavelength dependence info.
self.focusmodel_file = os.path.join(
webbpsf.utils.get_webbpsf_data_path(),
'NIRCam',
'optics',
conf.PYNRC_PATH,
'throughputs',
'nircam_defocus_vs_wavelength.fits')
model_hdul = fits.open(self.focusmodel_file)
assert model_hdul[1].header['XTENSION'] == 'BINTABLE'
Expand Down Expand Up @@ -1003,8 +1002,7 @@ def psf_coeff(filter_or_bp, pupil=None, mask=None, module='A',
drift_file : str, None
Delta OPD file to use for WFE drift.
include_si_wfe : bool
Include SI WFE measurements in si_zernikes_isim_cv3.fits?
Default = False.
Include SI WFE measurements? Default = False.
detector : str, None
Name of detector [A1, A2, ..., A5, B1, ..., B5].
detector_position : tuple, None
Expand Down
16 changes: 12 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@
version = __version__

# Get the long description from the README file
with open(path.join(root, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

long_description = '''
pyNRC is a set of Python-based tools for planning observations with JWST NIRCam,
including an ETC, simple image slope simulator, and enhanced DMS simulator.
The module works for a vareity NIRCam observing modes including direct imaging,
coronagraphic imaging, slitless grism spectroscopy, DHS observations, and weak
lens imaging. All PSFs are generated via WebbPSF to reproduce realistic JWST
images and spectra.
See https://github.com/JarronL/pynrc and https://pynrc.readthedocs.io
for more information.
'''

setup(
name='pynrc',
Expand Down Expand Up @@ -77,7 +85,7 @@
'matplotlib>=1.5.0',
'scipy>=0.16.0',
'astropy>=1.2.0',
'pysynphot>=0.9',
'pysynphot>=0.9.8',
'poppy>=0.6.1',
'webbpsf>=0.6.0',
'jwxml>=0.3.0'
Expand Down

0 comments on commit 57418f2

Please sign in to comment.