Additional API¶
msaexp.pipeline Module¶
Manual extractions of NIRSpec MSA spectra
Functions¶
|
Query and download MSA exposures for a given program from MAST |
|
Group files by MSAMETFL, grating, filter, detector |
Classes¶
|
Container class for NIRSpec data, generally in groups split by grating/filter/detector |
msaexp.pipeline_extended Module¶
Extend CRDS reference files for fixed-slit observations
Functions¶
|
Get reference filenames for a |
|
Extend limits of |
|
Extend fflat reference for |
|
Extend fflat reference for |
|
Extend NIRSpec sflat reference file |
|
Extend NIRSpec sflat reference file |
|
Extend wavelength ranges in photom reference file |
|
Pipeline for extending reference files |
msaexp.utils Package¶
Functions¶
|
Compute bin edges of an input array where the bin widths are the array steps |
Return a list of the available LookupTablePSF files in msaexp/data |
|
|
Create a spatial/spectral WCS covering footprint of the input |
|
Build a 2D WCS centered on the target in a slit |
Load bad pixel arrays into global dictionaries |
|
Use WebbPSF to calculate the FWHM as a function of wavelength assuming 0.2" fixed slit |
|
|
Combine single drizzled arrays with outlier detection |
|
Drizzle list of background-subtracted slitlets |
|
Run |
|
Figure showing drizzled HDU |
|
Get maximum of an uncal ramp for flagging saturation |
|
Set extra DQ flags, including a big stuck open shutter on NRS1. |
demo [not used] |
|
|
Merge 2D WCS header from a slit WCS to a rectified WCS, e.g., from |
|
Fixed slit cross-dispersion profile flat field |
|
|
|
Generate a placeholder resolution curve for MIRI LRS fit from the reference file jwst_miri_specwcs_0010.fits |
|
MUSE resolution curve from Guerou et al. (2017). |
|
Generate placeholder resolution curve for NIRCam WFSS |
|
Get PSF FWHM in pix from tabulated array derived from |
|
Normalization correction derived from empty sky slits, analagous to a correction to the SFLAT calibration |
|
Generate the |
|
Generate the |
|
Get wavelength and cross-dispersion coordinate arrays for a 2D slitlet |
|
Parse slit coordinates and attributes |
|
sign convention for slit pixels |
|
Get a fixed wavelength grid for a given grating |
|
Return result of a file listing from glob sorted by file creation date |
|
Convert from flambda cgs to microJansky |
|
Load MSAEXP MSA quadrant/detector S-flat reference data |
Generate a FITS-compliant long-slit header from a NIRSpec spectral WCS |
|
|
Make a pixel-integrated Gaussian profile |
Get the path to the |
|
|
Field dependent S-Flat for MSA slitlets derived from empty sky spectra |
|
Objective function for fitting the 2D profile |
|
Grid for oversampling cross dispersion axis |
|
This function takes a source name as input and returns the adjusted name according to the following rules: |
|
Resize a subarray exposure to the FULL 2048 x 2048 dimensions |
Set the global |
|
|
Load plot defaults with |
|
Get MSA shutter xcen and ycen from the shutter_id |
Check if |
|
|
Get flux calibration for extended-wavelength extractions |
|
Flag hot pixels with |
|
Run |
|
Pixel scale of the |
|
Get detector coordinates along the center of a slit |
|
Shrink axis to force a specified axis ratio |
|
Insert a colorbar at the corners/edges of a plot axis |
|
Integrate along the given axis using the composite trapezoidal rule. |
|
Update slit dq array and masking for padded slits and barshadow |
|
Try to update missing slit metadata. |
Classes¶
|
Color map with Lightness clipped to a maximum value |
|
Tools for working with a table of lines |
|
Fast lookup table PSF derived from point sources in the fixed slit. |
|
Tools for working with molecular hydrogen lines using the helpful relations from Aditya Togi and J. |
msaexp.drizzle Module¶
Tools for drizzle-combining MSA spectra
Functions¶
|
Derive a 2D spectral WCS centered on the expected source position along the slit |
|
Implementing more direct drizzling of multiple 2D slitlets |
|
Run 1D extraction on arrays from a combined dataset |
|
Find emission lines in 2D spectrum |
|
Optimal extraction from 2D arrays |
|
Tuple of (msa_metadata_file, msa_metadata_id) |
|
Make a figure showing drizzled product |
|
Make a figure showing drizzled slitlets |
msaexp.slit_combine Module¶
Functions¶
|
Compute groupings of |
|
2D histogram analogous to drizzle. |
|
Spectral combination workflow splitting by grating and multiple observations in a particular grating |
Classes¶
|
Container for a list of 2D extracted |
msaexp.spectrum Module¶
Fits, etc. to extracted spectra
Functions¶
|
Fit spectrum for the redshift |
|
Fit redshifts on a grid |
|
Fit templates to a spectrum and make a diagnostic figure |
|
Read a spectrum and apply flux and/or uncertainty scaling |
|
Compute a polynomial scaling of the spectrum uncertainties. |
|
|
|
Query and plot overlapping spectra |
|
Integrate spectrum data through a filter bandpass |
|
Integrate a spectrum through a list of filter bandpasses |
Classes¶
|
Helper functions for sampling templates onto the wavelength grid of an observed spectrum |
msaexp.msa Module¶
Helper scripts for dealing with MSA metadata files (MSAMETFL)
Functions¶
|
Wrapper around |
|
Wrapper around |
|
Get the "best" source id from the MSA metadata file associated with a particular slit extraction. |
|
Make a plot of a list of MSA shutters |
|
Draw axis ticks for a plot of the MSA shutters |
|
Read an APT MSA shutter CSV file into a table |
|
Compute wavelength limits for specific slitlets by MSA row, col, quadrant |
Classes¶
|
Helper for parsing MSAMETFL metadata files |
msaexp.resample Module¶
Functions¶
|
Resample a high resolution template/model on the wavelength grid of a spectrum with (potentially) wavelength dependent dispersion |
|
Sample a Gaussian emission line on the spectrum wavelength grid accounting for pixel integration |
|
Low level function for a pixel-integrated gaussian |
msaexp.resample_numba Module¶
Functions¶
|
Simpson's rule integration by Mason Stoeker See: https://masonstoecker.com/2021/04/03/Simpson-and-Numba.html |
|
Accelerated trapezoid rule integration |
|
Return trapezoid rule coefficients, useful for numerical integration using a dot product |
|
Resample a high resolution template/model on the wavelength grid of a spectrum with (potentially) wavelength dependent dispersion |
|
Sample a Gaussian emission line on the spectrum wavelength grid accounting for pixel integration |
|
Low level function for a pixel-integrated gaussian |
|
Calculate Inoue+ (2014) IGM transmission, reworked from |
|
Calzetti (2000) attenuation law adapted from |
|
Calzetti (2000) attenuation law adapted from |
|
Drude profile |
|
Salim (2018) attenuation law adapted from |
|
SMC extinction law from Gordon (2003) attenuation law adapted from |
|
SMC extinction law from Gordon (2003) attenuation law adapted from |