Miscellaneous Utilities
jwst.lib.basic_utils Module
General utility objects.
Functions
|
Disable logging within a context. |
Classes
|
Logging context manager. |
jwst.lib.catalog_utils Module
Utilities for naming source catalogs.
Functions
|
Replace the suffix and extension of a filename. |
|
Read a source catalog from file or validate an existing QTable. |
Classes
|
Sky Object container for WFSS catalog information. |
jwst.lib.dispaxis Module
Functions
|
Get the dispersion direction. |
jwst.lib.exposure_types Module
Module for lists of modes grouped in different ways.
Functions
|
Check if exposure type is nrs_lamp or nrs_autowave. |
|
Check if lamp state is lin or ref. |
|
Check if lamp state is flat. |
|
Check NRS slit line lamp. |
|
Check if lamp mode is ifu and lamp state is lin or ref. |
|
Check if lamp mode is ifu and lamp state is flat. |
|
Check if lamp mode is ifu and exposure type is nrs_lamp or nrs_autowave. |
|
Check if lamp mode is msaspec and exposure type is nrs_lamp or nrs_autowave. |
|
Check if lamp mode is msaspec and lamp state is lin or ref. |
|
Check if lamp mode is msaspec and lamp state is flat. |
|
Check of exposure type is nrs_autoflat. |
|
Determine if a moving target exposure. |
jwst.lib.file_utils Module
File utility functions.
Functions
|
Temporarily change to specified directory. |
jwst.lib.pipe_utils Module
Pipeline utilities objects.
Functions
|
Check if data is a Time Series Observation (TSO). |
|
Check whether the data are in IRS2 format. |
|
Ensure data, error, variance, and DQ are marked consistently for invalid data. |
jwst.lib.pointing_summary Module
Pointing Summary.
Review contents of a set of given models for pointing information. Compare the calculated V1 and REFPOINT pointing with the proposed TARGET pointing.
Examples
>>> from stdatamodels.jwst.datamodels import ImageModel
>>> im = ImageModel()
>>> im.meta.target.ra = 90.75541666666666
>>> im.meta.target.dec = -66.56055555555554
>>> im.meta.pointing.ra_v1 = 91.08142004561715
>>> im.meta.pointing.dec_v1 = -66.60547868904696
>>> im.meta.wcsinfo.ra_ref = 90.70377653291781
>>> im.meta.wcsinfo.dec_ref = -66.59540223936895
>>> calc_pointing_deltas(im)
Delta(target=<SkyCoord (ICRS): (ra, dec) in deg
(90.75541667, -66.56055556)>, v1=<SkyCoord (ICRS): (ra, dec) in deg
(91.08142005, -66.60547869)>, refpoint=<SkyCoord (ICRS): (ra, dec) in deg
(90.70377653, -66.59540224)>, delta_v1=<Angle 0.13712727 deg>, delta_refpoint=<Angle 0.04044315 deg>)
>>> t = calc_deltas([im])
>>> print(t.columns)
<TableColumns names=('exposure','target','v1','refpoint','delta_v1','delta_refpoint')>
>>> delta_v1 = t["delta_v1"][0]
>>> "%.13f" % delta_v1
'0.1371272716401'
>>> delta_refpoint = t["delta_refpoint"][0]
>>> "%.13f" % delta_refpoint
'0.0404431476150'
Functions
|
Calculate pointing deltas. |
|
Create table of pointing deltas. |
Classes
|
jwst.lib.progress Module
Provide a visual progress bar facility.
The actual functionality is provided by the external library progress.
https://pypi.org/project/progress/
If the module is not available, then stub it out.
Functions
|
Actually use Bar only if logging level is appropriate. |
jwst.lib.reffile_utils Module
Functions
|
Check if a data model comes from a subarray readout. |
|
Match science model to reference model. |
|
Get subarray model. |
|
Create a multistripe subarray cutout of a reference file. |
|
Generate sub-model from science model multistripe params. |
|
Generate stripe array. |
|
Swap data array between science and detector frames. |
|
Swap data array between detector and science frames. |
|
Find a row in a FITS table matching fields. |
Classes
|
Raised when more than one row is matched in a FITS table or list of dict. |
jwst.lib.set_velocity_aberration Module
Utilities for velocity aberration correction.
Script to add velocity aberration correction information to the FITS files provided to it on the command line (one or more).
It assumes the following keywords are present in the file header:
JWST_DX (km/sec)
JWST_DY (km/sec)
JWST_DZ (km/sec)
RA_REF (deg)
DEC_REF (deg)
The keywords added are:
VA_SCALE (dimensionless scale factor)
It does not currently place the new keywords in any particular location in the header other than what is required by the standard.
Functions
|
Determine velocity aberration. |
jwst.lib.signal_slot Module
A signal/slot implementation.
Classes
|
A Signal, when triggered, call the connected slots. |
Manage the signals. |
|
|
Must add a Signal Class. |
jwst.lib.suffix Module
Suffix manipulation.
Notes
KNOW_SUFFIXES is the list used by remove_suffix. This
list is generated by the function combine_suffixes. The function uses
SUFFIXES_TO_ADD to add other suffixes that it would otherwise not
discover or should absolutely be in the list. The function uses
‘SUFFIXES_TO_DISCARD` for strings found that are not to be considered
suffixes.
Hence, to update KNOW_SUFFIXES, update both SUFFIXES_TO_ADD and
SUFFIXES_TO_DISCARD as necessary, then use the output of
find_suffixes.
Functions
|
Remove the suffix if a known suffix is already in name. |
jwst.lib.wcs_utils Module
Functions
|
Read or compute wavelengths. |