Skip to content

Commit

Permalink
rename WFIRST -> Roman
Browse files Browse the repository at this point in the history
  • Loading branch information
robelgeda committed Jan 25, 2021
1 parent 2ec58ed commit 67eed7a
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 559 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ RUN wget -qO- http://ssb.stsci.edu/cdbs/tarfiles/synphot5.tar.gz | tar xvz
ENV PYSYN_CDBS /opt/grp/hst/cdbs

# Extract Pandeia reference data
RUN wget -qO- https://stsci.box.com/shared/static/7voehzi5krrpml5wgyg8bo954ew7arh2.gz | tar
-xvz
RUN wget -qO- https://stsci.box.com/shared/static/7voehzi5krrpml5wgyg8bo954ew7arh2.gz | tar xvz
ENV pandeia_refdata /opt/pandeia_data-1.5.2_roman

# Extract WebbPSF reference data
Expand Down Expand Up @@ -61,7 +60,7 @@ RUN pip install --no-cache-dir pandeia.engine==$PANDEIA_VERSION
# Install WebbPSF
ENV WEBBPSF_VERSION 0.9.0
#RUN pip install --no-cache-dir webbpsf==$WEBBPSF_VERSION
RUN pip install git+git://github.com/spacetelescope/webbpsf.git@master
RUN pip install git+git://github.com/spacetelescope/webbpsf.git@develop
RUN pip install git+git://github.com/spacetelescope/poppy.git
#
# Prepare files and permissions
Expand Down
60 changes: 30 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Nancy Grace Roman Space Telescope Simulation Tools
# Nancy Grace Roman Space Telescope (Roman) Simulation Tools

The Roman team at STScI has developed an exposure time calculator, a PSF model, and an image simulator for the science community to plan how they will use Roman. These tools are available separately as the Pandeia exposure time calculator engine, the WebbPSF point spread function modeling package, and the Space Telescope Image Product Simulator (STIPS). Comprehensive setup documentation for local installation as well as tutorials for Pandeia and WebbPSF are provided here. STIPS is available at https://github.com/spacetelescope/STScI-STIPS. High level overviews of the functionality of the tools are available on [STScI's WFIRST website](http://www.stsci.edu/scientific-community/wide-field-infrared-survey-telescope/science-planning-toolbox).
The Roman team at STScI has developed an exposure time calculator, a PSF model, and an image simulator for the science community to plan how they will use Roman. These tools are available separately as the Pandeia exposure time calculator engine, the WebbPSF point spread function modeling package, and the Space Telescope Image Product Simulator (STIPS). Comprehensive setup documentation for local installation as well as tutorials for Pandeia and WebbPSF are provided here. STIPS is available at https://github.com/spacetelescope/STScI-STIPS. High level overviews of the functionality of the tools are available on [STScI's Roman website](https://www.stsci.edu/roman/science-planning-toolbox).

Would you like to [launch the tools in a temporary environment in the cloud](#Play-with-the-tools-in-a-temporary-environment-in-the-cloud) or [install the simulation tools locally](#install-the-simulation-tools-locally)?

**To stay abreast of changes and make sure you always have the latest WFIRST simulation tools, you may wish to [subscribe to our mailing list](https://maillist.stsci.edu/scripts/wa.exe?SUBED1=WFIRST-TOOLS&A=1).** This list is low-traffic and only for announcements.
**To stay abreast of changes and make sure you always have the latest Roman simulation tools, you may wish to [subscribe to our mailing list](https://maillist.stsci.edu/scripts/wa.exe?SUBED1=WFIRST-TOOLS&A=1).** This list is low-traffic and only for announcements.

To cite our tools, we ask that you reference [Pontoppidan et al. 2016, "Pandeia: a multi-mission exposure time calculator for JWST and WFIRST", Proc. SPIE. 9910.](http://dx.doi.org/10.1117/12.2231768) and/or [Perrin et al. 2014, "Updated point spread function simulations for JWST with WebbPSF", Proc. SPIE. 9143.](http://adsabs.harvard.edu/abs/2014SPIE.9143E..3XP).

## Tutorial notebooks

The tutorials are stored as Jupyter Notebooks--documents which interleave code, figures, and prose explanations--and can be run locally once you have followed the setup instructions below. They can also be viewed in a browser.

* [WebbPSF-WFIRST Tutorial](https://github.com/spacetelescope/wfirst-tools/blob/master/notebooks/WebbPSF-WFIRST_Tutorial.ipynb) — Simulate a PSF for the Roman Wide-Field Instrument by selecting a detector position. Evaluate PSF differences between two detector positions. Shows both the WebbPSF notebook GUI and a brief example of performing calculations with the API.
* [Pandeia-WFIRST Tutorial](https://github.com/spacetelescope/wfirst-tools/blob/master/notebooks/Pandeia-WFIRST.ipynb) — Calculate exposure times and simulate detector "postage stamps" for scenes made up of point sources and extended sources.
* [WebbPSF-Roman Tutorial](https://github.com/spacetelescope/roman_tools/blob/master/notebooks/WebbPSF-Roman_Tutorial.ipynb) — Simulate a PSF for the Roman Wide-Field Instrument by selecting a detector position. Evaluate PSF differences between two detector positions. Shows both the WebbPSF notebook GUI and a brief example of performing calculations with the API.
* [Pandeia-WFIRST Tutorial](https://github.com/spacetelescope/roman_tools/blob/master/notebooks/Pandeia-WFIRST.ipynb) — Calculate exposure times and simulate detector "postage stamps" for scenes made up of point sources and extended sources.

## Play with the tools in a temporary environment in the cloud

We have automated the setup of a temporary evaluation environment for community users to evaluate the Roman Simulation Tools from STScI. This depends on a free third-party service called Binder, currently available in beta (without guarantees of uptime).

To launch in Binder *(beta)*, follow this URL: https://mybinder.org/v2/gh/spacetelescope/wfirst-tools.git/stable (**Note:** If you see an error involving redirects in Safari, try Chrome or Firefox. This should be fixed soon by the Binder project.)
To launch in Binder *(beta)*, follow this URL: https://mybinder.org/v2/gh/spacetelescope/roman_tools.git/stable (**Note:** If you see an error involving redirects in Safari, try Chrome or Firefox. This should be fixed soon by the Binder project.)

It may take a few minutes to start up. Feel free to explore and run example calculations. Launching an environment through Binder will always use the most recent supported versions of our tools.

Expand Down Expand Up @@ -64,7 +64,7 @@ export PATH=/usr/local/bin:$PATH

#### When I run `./run.sh`, I get an error saying "context canceled"

Sometimes you will see `Successfully tagged wfirst-tools:latest` in your terminal, but still get an error like this:
Sometimes you will see `Successfully tagged roman_tools:latest` in your terminal, but still get an error like this:

```
docker: Error response from daemon: driver failed programming external
Expand All @@ -79,7 +79,7 @@ This means that port 8888 is already in use, either by a notebook server running
```
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e4cb3f9a0cb1 wfirst-tools "tini -- start-not..." 3 minutes ago Up 3 minutes 127.0.0.1:8888->8888/tcp priceless_mirzakhani
e4cb3f9a0cb1 roman_tools "tini -- start-not..." 3 minutes ago Up 3 minutes 127.0.0.1:8888->8888/tcp priceless_mirzakhani
```

You can use the name or container ID to stop it with `docker stop`:
Expand Down Expand Up @@ -112,21 +112,21 @@ The [Getting Started](http://astroconda.readthedocs.io/en/latest/getting_started
The Roman Simulation Tools suite includes the Pandeia engine, an exposure time and signal-to-noise calculator. To create a Python environment for Roman Simulation Tools, use the following command:

```
$ conda create -n wfirst-tools --yes python=3.7 astropy pysynphot \
$ conda create -n roman_tools --yes python=3.7 astropy pysynphot \
synphot stsynphot photutils \
future pyyaml pandas \
webbpsf==0.9 webbpsf-data==0.9
```

This will create an environment called `wfirst-tools` containing the essential packages for Roman simulations. To use it, you must activate it every time you open a new terminal window. Go ahead and do that now:
This will create an environment called `roman_tools` containing the essential packages for Roman simulations. To use it, you must activate it every time you open a new terminal window. Go ahead and do that now:

```
$ source activate wfirst-tools
$ source activate roman_tools
```

You should see a new prefix on your shell prompt. (If the prompt was `$` before, it should now look like `(wfirst-tools) $`.)
You should see a new prefix on your shell prompt. (If the prompt was `$` before, it should now look like `(roman_tools) $`.)

Next, create a new directory somewhere with plenty of space to hold the reference files and navigate there in your terminal (with `cd /path/to/reference/file/space` or similar).

Expand All @@ -135,17 +135,17 @@ Next, create a new directory somewhere with plenty of space to hold the referenc
To obtain the [reference data](https://stsynphot.readthedocs.io/en/latest/#installation-and-setup) used for synthetic photometry, you will need to retrieve them via FTP. The `curl` command line tool can be used as follows to retrieve the archives:

```
(wfirst-tools) $ curl -OL ftp://ftp.stsci.edu/cdbs/tarfiles/synphot1.tar.gz # 85 MB
(wfirst-tools) $ curl -OL ftp://ftp.stsci.edu/cdbs/tarfiles/synphot2.tar.gz # 34 MB
(wfirst-tools) $ curl -OL ftp://ftp.stsci.edu/cdbs/tarfiles/synphot5.tar.gz # 505 MB
(roman_tools) $ curl -OL ftp://ftp.stsci.edu/cdbs/tarfiles/synphot1.tar.gz # 85 MB
(roman_tools) $ curl -OL ftp://ftp.stsci.edu/cdbs/tarfiles/synphot2.tar.gz # 34 MB
(roman_tools) $ curl -OL ftp://ftp.stsci.edu/cdbs/tarfiles/synphot5.tar.gz # 505 MB
```

This retrieves interstellar extinction curves, several spectral atlases, and a grid of stellar spectra derived from [PHOENIX](http://www.hs.uni-hamburg.de/index.php?option=com_content&view=article&id=14&Itemid=294&lang=en) models. Extract them into the current directory:

```
(wfirst-tools) $ tar xvzf ./synphot1.tar.gz
(wfirst-tools) $ tar xvzf ./synphot2.tar.gz
(wfirst-tools) $ tar xvzf ./synphot5.tar.gz
(roman_tools) $ tar xvzf ./synphot1.tar.gz
(roman_tools) $ tar xvzf ./synphot2.tar.gz
(roman_tools) $ tar xvzf ./synphot5.tar.gz
```

This will create a tree of files rooted at `grp/hst/cdbs/` in the current directory.
Expand All @@ -154,19 +154,19 @@ This will create a tree of files rooted at `grp/hst/cdbs/` in the current direct

### Installing the Pandeia Engine

The Pandeia Engine is available through PyPI (the Python Package Index), rather than Astroconda. Fortunately, we can install it into our `wfirst-tools` environment with the following command:
The Pandeia Engine is available through PyPI (the Python Package Index), rather than Astroconda. Fortunately, we can install it into our `roman_tools` environment with the following command:

```
(wfirst-tools) $ pip install pandeia.engine==1.5.2
(roman_tools) $ pip install pandeia.engine==1.5.2
```

Note that the `==1.5.2` on the package name explicitly requests version 1.5.2, which is the version that is compatible with the bundled reference data.

Pandeia also depends on a collection of reference data to define the characteristics of the WFIRST instruments. Download it (40 MB) as follows and extract:
Pandeia also depends on a collection of reference data to define the characteristics of the Roman instruments. Download it (40 MB) as follows and extract:

```
(wfirst-tools) $ curl -OL https://stsci.box.com/shared/static/7voehzi5krrpml5wgyg8bo954ew7arh2.gz
(wfirst-tools) $ tar xvzf ./7voehzi5krrpml5wgyg8bo954ew7arh2.gz
(roman_tools) $ curl -OL https://stsci.box.com/shared/static/7voehzi5krrpml5wgyg8bo954ew7arh2.gz
(roman_tools) $ tar xvzf ./7voehzi5krrpml5wgyg8bo954ew7arh2.gz
```

This creates a folder called `pandeia_data-1.5.2_roman` in the current directory.
Expand All @@ -184,40 +184,40 @@ Where you see `$(pwd)` in the following commands, substitute in the directory wh
Configure the Synphot CDBS path:

```
(wfirst-tools) $ export PYSYN_CDBS="$(pwd)/grp/hst/cdbs"
(roman_tools) $ export PYSYN_CDBS="$(pwd)/grp/hst/cdbs"
```

To test that synphot can find its reference files, use the following command:

```
(wfirst-tools) $ python -c "import warnings; warnings.simplefilter('ignore'); import stsynphot; print(stsynphot.catalog.grid_to_spec('phoenix', 5750, 0.0, 4.5))"
(roman_tools) $ python -c "import warnings; warnings.simplefilter('ignore'); import stsynphot; print(stsynphot.catalog.grid_to_spec('phoenix', 5750, 0.0, 4.5))"
```

If you see output for a SourceSpectrum detailing the Model, Inputs, Outputs, and Components, synphot, stsynphot, and their reference data files have been installed correctly.

Next, configure the Pandeia path:

```
(wfirst-tools) $ export pandeia_refdata="$(pwd)/pandeia_data-1.5.2_roman"
(roman_tools) $ export pandeia_refdata="$(pwd)/pandeia_data-1.5.2_roman"
```

To test that Pandeia can find its reference files, use the following command:

```
(wfirst-tools) $ python -c 'import pandeia.engine; pandeia.engine.pandeia_version()'
(roman_tools) $ python -c 'import pandeia.engine; pandeia.engine.pandeia_version()'
```

If your data is set up correctly, it will output the version numbers for the Engine and RefData.

### Viewing and running these example notebooks

In a terminal where you have run `source activate wfirst-tools` and set the above environment variables, navigate to the directory where you would like to keep the example notebooks and clone this repository from GitHub:
In a terminal where you have run `source activate roman_tools` and set the above environment variables, navigate to the directory where you would like to keep the example notebooks and clone this repository from GitHub:

```
(wfirst-tools) $ git clone https://github.com/spacetelescope/wfirst-tools.git
(roman_tools) $ git clone https://github.com/spacetelescope/roman_tools.git
```

This will create a new folder called `wfirst-tools` containing this README and all of the example notebooks. From this directory, simply run `jupyter notebook`. Choose `Getting Started.ipynb` from the file list, and explore the available examples of WebbPSF and Pandeia calculations.
This will create a new folder called `roman_tools` containing this README and all of the example notebooks. From this directory, simply run `jupyter notebook`. Choose `Getting Started.ipynb` from the file list, and explore the available examples of WebbPSF and Pandeia calculations.

## Resources

Expand Down
39 changes: 23 additions & 16 deletions notebooks/Getting Started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# WFIRST Simulation Tools\n",
"# Roman Simulation Tools\n",
"\n",
"The WFIRST effort at STScI has produced software tools for use by the scientific community. This repository contains example code and instructions for WebbPSF, the PSF simulator for JWST and WFIRST, as well as Pandeia, the exposure time and signal-to-noise calculator for both missions.\n",
"The Roman effort at STScI has produced software tools for use by the scientific community. This repository contains example code and instructions for WebbPSF, the PSF simulator for JWST and Roman, as well as Pandeia, the exposure time and signal-to-noise calculator for both missions.\n",
"\n",
"## Test your installation\n",
"\n",
Expand All @@ -18,41 +18,48 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import warnings\n",
"warnings.filterwarnings('ignore', message='No .+ tables found')\n",
"import pysynphot\n",
"import webbpsf.wfirst\n",
"wfi = webbpsf.wfirst.WFI()\n",
"import webbpsf.roman\n",
"wfi = webbpsf.roman.WFI()\n",
"from pandeia.engine.wfirst import WFIRSTImager\n",
"_ = WFIRSTImager(mode=\"imaging\")\n",
"print(\"Looks like pysynphot, WebbPSF, and Pandeia installed correctly!\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from pandeia.engine.wfirst import WFIRSTImager"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## WebbPSF\n",
"\n",
"> WebbPSF-WFIRST provides a customizable interface to perform point-spread function (PSF) simulations and calculations for the Wide-Field Instrument (WFI) planned for WFIRST. A simulated PSF provides a useful tool for predicting the observatory's performance at a particular combination of wavelength (or bandpass), field position, and pixel scale. PSFs are also an important input to simulate astronomical scenes. For example, WebbPSF-WFIRST PSFs are used by the Pandeia and STIPS toolkits developed at STScI.\n",
"> WebbPSF-Roman provides a customizable interface to perform point-spread function (PSF) simulations and calculations for the Wide-Field Instrument (WFI) planned for Roman. A simulated PSF provides a useful tool for predicting the observatory's performance at a particular combination of wavelength (or bandpass), field position, and pixel scale. PSFs are also an important input to simulate astronomical scenes. For example, WebbPSF-Roman PSFs are used by the Pandeia and STIPS toolkits developed at STScI.\n",
"\n",
"The WFIRST functionality in WebbPSF is summarized on the [STScI WFIRST software page](http://www.stsci.edu/wfirst/software/webbpsf) and in the [WebbPSF documentation](http://pythonhosted.org/webbpsf/wfirst.html).\n",
"The Roman functionality in WebbPSF is summarized on the [STScI Roman software page](https://www.stsci.edu/roman/science-planning-toolbox/psf-simulation) and in the [WebbPSF documentation](https://webbpsf.readthedocs.io/en/latest/).\n",
"\n",
"### Notebooks\n",
"\n",
" * [WebbPSF-WFIRST Tutorial](./blob/master/notebooks/WebbPSF-WFIRST_Tutorial.ipynb) — Simulate a PSF for the WFIRST Wide-Field Instrument by selecting a detector position. Evaluate PSF differences between two detector positions. Shows both the WebbPSF notebook GUI and a brief example of performing calculations with the API.\n",
" * [WebbPSF-Roman Tutorial](./blob/master/notebooks/WebbPSF-Roman_Tutorial.ipynb) — Simulate a PSF for the Roman Wide-Field Instrument (WFI) by selecting a detector position. Evaluate PSF differences between two detector positions. Shows both the WebbPSF notebook GUI and a brief example of performing calculations with the API.\n",
"\n",
"\n",
"## Pandeia\n",
"\n",
"> Pandeia is the exposure time calculator (ETC) system that is being developed for the James Webb Space Telescope (JWST). It's based on a Python engine that calculates three-dimensional data cubes, based on user-specified spatial and spectral properties of one or more sources. The cubes are projected to a detector plane given an instrument configuration and two-dimensional pixel-by-pixel signal and noise properties are extracted. This allows for appropriate handling of realistic point spread functions (as calculated by WebbPSF), MULTIACCUM detector readouts, correlated detector readnoise, dithering, and multiple photometric and spectrscopic extraction strategies. Pandeia includes support for a wide variety of observing modes and has a highly modular, data-driven design that allows for easy extensibility to other instruments and telescopes.\n",
"\n",
"The WFIRST functionality in Pandeia is summarized on the [STScI WFIRST software page](http://www.stsci.edu/wfirst/software/Pandeia).\n",
"The WFIRST functionality in Pandeia is summarized on the [STScI WFIRST software page](http://www.stsci.edu/roman/software/Pandeia).\n",
"\n",
"### Notebooks\n",
"\n",
Expand All @@ -70,21 +77,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:pandeia_9]",
"display_name": "Python 3",
"language": "python",
"name": "conda-env-pandeia_9-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.15"
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 67eed7a

Please sign in to comment.