Skip to content

Commit

Permalink
Merge pull request #170 from gmzsebastian/master
Browse files Browse the repository at this point in the history
STIPS 2.1 Pull Request - Copy of PR167
  • Loading branch information
gmzsebastian authored Nov 15, 2023
2 parents 3d6d565 + fda6c6e commit e304ef5
Show file tree
Hide file tree
Showing 27 changed files with 2,278 additions and 971 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ MANIFEST
# Sphinx
docs/api
docs/_build
docs/_static

# Eclipse editor project files
.project
Expand Down Expand Up @@ -154,6 +155,7 @@ nosetests.xml
coverage.xml
*.cover
.hypothesis/
ref_data/

# Translations #
################
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Release Notes
Version History and Change Log
------------------------------

Version 2.1.0
=============
- Updated the Flux PHOTFNU values to match Pandeia
- Updated the background and noise estimates to use Pandeia
- Updated webbpsf to version 1.1
- Updated pandeia to version 2.0

Version 2.0.0
=============

Expand Down
59 changes: 31 additions & 28 deletions docs/basic_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ population parameters. In this example, we will create the following:

#. A stellar population representing a global cluster with:

* 10000 stars
* 100 stars
* An age of 7.5 billion years
* A metallicity of -2.0
* A Salpeter IMF with alpha = -2.35
Expand All @@ -81,12 +81,16 @@ population parameters. In this example, we will create the following:

.. code-block:: python
obs_prefix = 'notebook_example'
obs_ra = 150.0
obs_dec = -2.5
from stips.scene_module import SceneModule
scm = SceneModule(out_prefix=obs_prefix, ra=obs_ra, dec=obs_dec)
stellar_parameters = {
'n_stars': 10000,
'n_stars': 100,
'age_low': 7.5e12,
'age_high': 7.5e12,
'z_low': -2.0,
Expand All @@ -98,11 +102,11 @@ population parameters. In this example, we will create the following:
'distribution': 'invpow',
'radius': 100.0,
'radius_units': 'pc',
'distance_low': 10.0,
'distance_high': 10.0,
'distance_low': 20.0,
'distance_high': 20.0,
'offset_ra': 0.0,
'offset_dec':0.0
}
'offset_dec': 0.0
}
stellar_cat_file = scm.CreatePopulation(stellar_parameters)
print("Stellar population saved to file {}".format(stellar_cat_file))
Expand All @@ -113,7 +117,7 @@ population parameters. In this example, we will create the following:
'z_high': 0.2,
'rad_low': 0.01,
'rad_high': 2.0,
'sb_v_low': 28.0,
'sb_v_low': 30.0,
'sb_v_high': 25.0,
'distribution': 'uniform',
'clustered': False,
Expand All @@ -124,8 +128,7 @@ population parameters. In this example, we will create the following:
}
galaxy_cat_file = scm.CreateGalaxies(galaxy_parameters)
print("Galaxy population saved to file{}".format(galaxy_cat_file))
print("Galaxy population saved to file {}".format(galaxy_cat_file))
Creating a STIPS Observation
----------------------------
Expand All @@ -137,54 +140,54 @@ will create a single Roman WFI observation.

STIPS uses a bit of specialized terminology to describe its observations. In particular:

\• An *observation* is a set of exposures with a single instrument (e.g. Roman WFI), one or
* An *observation* is a set of exposures with a single instrument (e.g. Roman WFI), one or
more filters (where each exposure in the observation will be repeated for every included
filter), and some number of the instrument's detectors (for WFI, between 1 and 18),
where each exposure will be repeated, with the appropriate inter-detector offset, for
every included director, a single chosen sky background value, a single exposure time
(applied to each exposure in the observation), and one or more offsets.

\• An *offset* is a single telescope pointing. For each offset specified in the observation,
* An *offset* is a single telescope pointing. For each offset specified in the observation,
an exposure will be created for each detector and each filter at the offset. STIPS may,
optionally, create one or more mosaics at each offset, with a single mosaic including
all detectors with the same filter. In addition, STIPS can create a single combined
mosaic for each filter in the combined Observation.

In this case, we will create an observation with:

\• Roman WFI F129
* Roman WFI F129

\• 1 detector
* 1 detector

\• No distortion
* No distortion

\• Sky background of 0.15 counts/s/pixel
* Sky background of 0.15 counts/s/pixel

\• The ID 1
* The ID 1

\• An exposure of 1000 seconds
* An exposure of 1000 seconds

We will use a single offset with:

\• An ID of 1
* An ID of 1

\• No centering (if an offset is centered, then, for a multi-detector observation, each
detector is centered on the offset co-coordinates individually rather than the instrument
as a whole beinf centered there)
* No centering (if an offset is centered, then, for a multi-detector observation, each
detector is centered on the offset co-coordinates individually rather than the instrument
as a whole beinf centered there)

\• No change in RA, DEC, or PA from the center of the observation
* No change in RA, DEC, or PA from the center of the observation

We will use the following residual settings:

\• Flatfield residual: off
* Flatfield residual: off

\• Dark current residual: off
* Dark current residual: off

\• Cosmic ray removal residual: off
* Cosmic ray removal residual: off

\• Poisson noise residual: on
* Poisson noise residual: on

\• Readnoise residual: on
* Readnoise residual: on

.. code-block:: python
Expand All @@ -197,7 +200,7 @@ We will use the following residual settings:
'offset_dec': 0.0,
'offset_pa': 0.0
}
residuals = {
'residual_flat': False,
'residual_dark': False,
Expand Down
14 changes: 7 additions & 7 deletions docs/bugs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@ Known Issues (Pending Validation)
Below is a list of known issues with STIPS that are pending validation. Items will be
removed from this list as they are addressed in future STIPS updates.

\• The orientation of the image is non-standard, with east pointing to the right of the
* The orientation of the image is non-standard, with east pointing to the right of the
image. The relative position of sources is not affected.

\• There exists a function to place extended sources given a set of Sersic parameters, but
* There exists a function to place extended sources given a set of Sersic parameters, but
its validity and functionality have not been tested.

\• The flux measurements of sources are only validated in the absence of noise/background.
* The flux measurements of sources are only validated in the absence of noise/background.
As such, the net flux of the image may be inaccurate.

\• STIPS interpolates nine PSFs generated by WebbPSF across the detector to the location of the
* STIPS interpolates nine PSFs generated by WebbPSF across the detector to the location of the
source being placed. However, there is currently a known offset of 20 pixels (in both the
X and Y directions) between the location at which the PSF is interpolated, and the
location at which the target is displayed.

.. note::

This does not affect the target position or center on the detector, it only means that,
This does not affect the target position or center on the detector. It only means that,
if a point source is created with a position of (x, y), it will be placed at location
(x, y) but the interpolated PSF shape will be the shape of the PSF at location (x+20, y+20).
Because the WFI PSF shape does not vary strongly over this distance, the effect is
minimal and should not be a concern for most science cases. If ultra-precise PSF models
are required, the user should generate them directly with WebbPSF at the desired pixel
location.

\• Bright sources will have large diffraction spikes that are visible beyond 22 pixels away
* Bright sources will have large diffraction spikes that are visible beyond 22 pixels away
from the center of the source. A ``psf_bright_limit`` and ``psf_xbright_limit`` (extra-bright limit)
magnitude can be specified –– objects brighter than this threshold will be computed out
to a radius of 44 (bright) and 88 (extra-bright) pixels, respectively. Note that,
because point source flux is computed for every pixel, bright targets will take
roughly four times as long (and extra-bright sources 16 times as long) to compute as
standard sources, so these limits should only be set when it matters.

\• The STIPS star generation sub-module (``stips.star_generator``) depends on the ``esutil``
* The STIPS star generation sub-module (``stips.star_generator``) depends on the ``esutil``
Python module. This module can currently be installed as part of a Conda environment, but
can't be installed in a working state from a pip/setup environment. As such, if you are
installing STIPS without using Conda, *and* you need to use the star generation sub-module,
Expand Down
12 changes: 11 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def setup(app):
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../'))

'''
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
Expand All @@ -59,6 +59,15 @@ def setup(app):
'sphinx_automodapi.automodapi',
'autoapi.extension',
]
'''
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx_rtd_theme',
]

numpydoc_show_class_members = False

Expand Down Expand Up @@ -92,6 +101,7 @@ def setup(app):

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
#pygments_style = 'default'

# -- Options for HTML output --------------------------------------------------

Expand Down
24 changes: 12 additions & 12 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@ in this section along with instructions.
STIPS Requirements
##################

\• ``pandeia>=1.7``: Exposure time calculator.
* ``pandeia>=3.0``: Exposure time calculator.

\• ``webbpsf>=1.0.0``: Nancy Grace Roman PSF calculator. STIPS also requires that ``poppy``, a
* ``webbpsf==1.1.1``: Nancy Grace Roman PSF calculator. STIPS also requires that ``poppy``, a
support package used by WebbPSF, have version ``>=1.0.3``.

\• ``astropy``: STIPS uses Astropy in order to:
* ``astropy``: STIPS uses Astropy in order to:

\• Read and write FITS files.
* Read and write FITS files.

\• Read and write ASCII tables (specifically in the IPAC format).
* Read and write ASCII tables (specifically in the IPAC format).

\• Generate Sersic profile models (if any are in the generated scene).
* Generate Sersic profile models (if any are in the generated scene).

\• ``montage_wrapper``: STIPS uses ``montage`` to generate mosaics. It is
* ``montage_wrapper``: STIPS uses ``montage`` to generate mosaics. It is
only imported if STIPS is asked to generate a multi-detector image.

\• ``numpy``: STIPS uses ``numpy`` extensively for almost everything that it does.
* ``numpy``: STIPS uses ``numpy`` extensively for almost everything that it does.

\• ``photutils``: STIPS uses ``photutils`` to determine the flux inside the half-light radius
* ``photutils``: STIPS uses ``photutils`` to determine the flux inside the half-light radius
in generated Sersic profiles.

\• ``synphot>=1.1.1`` and ``stsynphot>=1.1.0``: STIPS uses ``synphot`` and
* ``synphot>=1.1.1`` and ``stsynphot>=1.1.0``: STIPS uses ``synphot`` and
``stsynphot`` to generate bandpasses, count rates, and zero points. Note that
the reference data must also be downloaded, as described below in :ref:`downloading-required-ref-data`.

\• ``scipy``: STIPS uses SciPy to manipulate its internal images (zoom and rotate).
* ``scipy``: STIPS uses SciPy to manipulate its internal images (zoom and rotate).

\• ``esutil``: Used for retrieving data from sqlite databases in the form of ``numpy`` arrays.
* ``esutil``: Used for retrieving data from sqlite databases in the form of ``numpy`` arrays.

.. warning::
``esutil`` is not installed by the STIPS ``setup.py`` file because its pip
Expand Down
Loading

0 comments on commit e304ef5

Please sign in to comment.