CRDSGrismConf¶
- class grizli.grismconf.CRDSGrismConf(file='references/jwst/nircam/jwst_nircam_specwcs_0136.asdf', get_photom=True, context='jwst_1123.pmap', **kwargs)[source]¶
Bases:
object
Helper object to replicate
grismconf
config files from CRDS products- Parameters
- filestr
Filename of a CRDS
specwcs
file- get_photombool
Get sensitivity curves from the
photom
reference file- contextstr
Explicit CRDS_CONTEXT
- Attributes
- dm
jwst.datamodels.NIRCAMGrismModel
DataModel of the
specwcs
reference- metadict
Metadata dictionary from
jwst.datamodels.NIRCAMGrismModel.meta.instance
- dm_orderslist
List of orders from
dm.orders
- crds_parametersdict
CRDS parameter dictionary from
dm.get_crds_parameters()
- dispx, dispy, displlist, list, list
Parameter polynomials from the reference datamodel
- SENS_datadict
Sensitivity data like
{order: (wave_microns, sensitity)}
- dm
Attributes Summary
Return combination of blocking filter + dispering element
Return filter for NIRISS, pupil for NIRCAM, filter for HST
Return combination of blocking filter, dispering element, (module)
String version of orders, like '+1', '+2', '0', '-1'
Methods Summary
DDISPL
(order, x0, y0, t[, dt])Replicate grismconf.DDISPL
DDISPX
(order, x0, y0, t[, dt])Replicate grismconf.DDISPX
DDISPY
(order, x0, y0, t[, dt])Replicate grismconf.DDISPY
DISPL
(order, x0, y0, t)Replicate grismconf.DISPL
DISPX
(order, x0, y0, t)Replicate grismconf.DISPX
DISPXY
(order, x0, y0, t)Replicate grismconf.DISPXY (combination of DISPX, DISPY)
DISPY
(order, x0, y0, t)Replicate grismconf.DISPY
INVDISPL
(order, x0, y0, dx[, t0, from_root])Inverse DISPL
INVDISPX
(order, x0, y0, dx[, t0, from_root])Inverse DISPX
INVDISPY
(order, x0, y0, dx[, t0, from_root])Inverse DISPY
get_photom
([xyt, date, photom_file, verbose])Load photom reference from CRDS and scale to grismconf / aXe convention
Initialize polynomial objects from a
jwst.datamodel
load_new_sensitivity_curve
([verbose])Replace +1 NIRCam sensitivity curves with Nov 10, 2023 updates
Attributes Documentation
- filter¶
- filter_grism¶
Return combination of blocking filter + dispering element
- grism¶
Return filter for NIRISS, pupil for NIRCAM, filter for HST
- instrument¶
- instrument_setup¶
Return combination of blocking filter, dispering element, (module)
- module¶
- orders¶
String version of orders, like ‘+1’, ‘+2’, ‘0’, ‘-1’
- pupil¶
Methods Documentation
- DDISPL(order, x0, y0, t, dt=0.01)[source]¶
Replicate grismconf.DDISPL
Evaluates the derivative of the dispersion polynomial from the reference datamodel for a given order along the dispersion axis.
- Parameters
- orderstr
Order name like ‘+1’, ‘0’, ‘-1’
- x0, y0float or array-like
Detector coordinates in the direct image
- tfloat or array-like
Evaluation point(s) of the independent trace variable
- dtfloat
Delta t for finite difference.
- Returns
- ddisplfloat or array-like
Value(s) of the derivative of the dispersion polynomial.
- DDISPX(order, x0, y0, t, dt=0.01)[source]¶
Replicate grismconf.DDISPX
Evaluates the derivative of the dispersion polynomial from the reference datamodel for a given order in x direction.
- Parameters
- orderstr
Order name like ‘+1’, ‘0’, ‘-1’
- x0, y0float or array-like
Detector coordinates in the direct image
- tfloat or array-like
Evaluation point(s) of the independent trace variable
- dtfloat
Delta t for finite difference.
- Returns
- ddispxfloat or array-like
Derivative of the x pixel along the trace
- DDISPY(order, x0, y0, t, dt=0.01)[source]¶
Replicate grismconf.DDISPY
Evaluates the derivative of the dispersion polynomial from the reference datamodel for a given order in y direction.
- Parameters
- orderstr
Order name like ‘+1’, ‘0’, ‘-1’
- x0, y0float or array-like
Detector coordinates in the direct image
- tfloat or array-like
Evaluation point(s) of the independent trace variable
- dtfloat
Delta t for finite difference.
- Returns
- ddispyfloat or array-like
Value(s) of the derivative of the y pixel along the trace.
- DISPL(order, x0, y0, t)[source]¶
Replicate grismconf.DISPL
Evaluates dispersion polynomials from the reference datamodel for a given order along the dispersion axis.
- Parameters
- orderstr
Order name like ‘+1’, ‘0’, ‘-1’
- x0, y0float or array-like
Detector coordinates in the direct image
- tfloat or array-like
Evaluation point(s) of the independent trace variable
- Returns
- displfloat or array-like
Wavelength value(s) along the trace, microns
- DISPX(order, x0, y0, t)[source]¶
Replicate grismconf.DISPX
Evaluates dispersion polynomial from the reference datamodel for a given order in x direction.
- Parameters
- orderstr
Order name like ‘+1’, ‘0’, ‘-1’
- x0, y0float or array-like
Detector coordinates in the direct image
- tfloat or array-like
Evaluation point(s) of the independent trace variable
- Returns
- dispxfloat or array-like
x pixel along the trace
- DISPXY(order, x0, y0, t)[source]¶
Replicate grismconf.DISPXY (combination of DISPX, DISPY)
Evaluates dispersion polynomials from the reference datamodel for a given order in x and y directions.
- Parameters
- orderstr
Order name like ‘+1’, ‘0’, ‘-1’
- x0, y0float or array-like
Detector coordinates in the direct image
- tfloat or array-like
Evaluation point(s) of the independent trace variable
- Returns
- dispx, dispyfloat or array-like, float or array-like
x and y pixels along the trace
- DISPY(order, x0, y0, t)[source]¶
Replicate grismconf.DISPY
Evaluates dispersion polynomial from the reference datamodel for a given order in y direction.
- Parameters
- orderstr
Order name like ‘+1’, ‘0’, ‘-1’
- x0, y0float or array-like
Detector coordinates in the direct image
- tfloat or array-like
Evaluation point(s) of the independent trace variable
- Returns
- dispyfloat or array-like
y pixel along the trace
- INVDISPL(order, x0, y0, dx, t0=array([-1., -0.97637795, -0.95275591, -0.92913386, -0.90551181, -0.88188976, -0.85826772, -0.83464567, -0.81102362, -0.78740157, -0.76377953, -0.74015748, -0.71653543, -0.69291339, -0.66929134, -0.64566929, -0.62204724, -0.5984252, -0.57480315, -0.5511811, -0.52755906, -0.50393701, -0.48031496, -0.45669291, -0.43307087, -0.40944882, -0.38582677, -0.36220472, -0.33858268, -0.31496063, -0.29133858, -0.26771654, -0.24409449, -0.22047244, -0.19685039, -0.17322835, -0.1496063, -0.12598425, -0.1023622, -0.07874016, -0.05511811, -0.03149606, -0.00787402, 0.01574803, 0.03937008, 0.06299213, 0.08661417, 0.11023622, 0.13385827, 0.15748031, 0.18110236, 0.20472441, 0.22834646, 0.2519685, 0.27559055, 0.2992126, 0.32283465, 0.34645669, 0.37007874, 0.39370079, 0.41732283, 0.44094488, 0.46456693, 0.48818898, 0.51181102, 0.53543307, 0.55905512, 0.58267717, 0.60629921, 0.62992126, 0.65354331, 0.67716535, 0.7007874, 0.72440945, 0.7480315, 0.77165354, 0.79527559, 0.81889764, 0.84251969, 0.86614173, 0.88976378, 0.91338583, 0.93700787, 0.96062992, 0.98425197, 1.00787402, 1.03149606, 1.05511811, 1.07874016, 1.1023622, 1.12598425, 1.1496063, 1.17322835, 1.19685039, 1.22047244, 1.24409449, 1.26771654, 1.29133858, 1.31496063, 1.33858268, 1.36220472, 1.38582677, 1.40944882, 1.43307087, 1.45669291, 1.48031496, 1.50393701, 1.52755906, 1.5511811, 1.57480315, 1.5984252, 1.62204724, 1.64566929, 1.66929134, 1.69291339, 1.71653543, 1.74015748, 1.76377953, 1.78740157, 1.81102362, 1.83464567, 1.85826772, 1.88188976, 1.90551181, 1.92913386, 1.95275591, 1.97637795, 2.]), from_root=False)[source]¶
Inverse DISPL
Evaluates the inverse of the wavelength polynomial from the reference datamodel for a given order, reference position, and dispersed position along the dispersion axis.
- Parameters
- orderstr
Order name like ‘+1’, ‘0’, ‘-1’
- x0, y0float
Detector coordinates in the direct image
- dxfloat, array-like
Wavelengths where to interpolate the trace
- t0array-like
1D evaluation grid for the inverse interpolation.
- from_rootbool
Use polynomial roots to find the inverse.
- Returns
- tlike
dx
Independent variable value along the trace.
- tlike
- INVDISPX(order, x0, y0, dx, t0=array([-1., -0.97637795, -0.95275591, -0.92913386, -0.90551181, -0.88188976, -0.85826772, -0.83464567, -0.81102362, -0.78740157, -0.76377953, -0.74015748, -0.71653543, -0.69291339, -0.66929134, -0.64566929, -0.62204724, -0.5984252, -0.57480315, -0.5511811, -0.52755906, -0.50393701, -0.48031496, -0.45669291, -0.43307087, -0.40944882, -0.38582677, -0.36220472, -0.33858268, -0.31496063, -0.29133858, -0.26771654, -0.24409449, -0.22047244, -0.19685039, -0.17322835, -0.1496063, -0.12598425, -0.1023622, -0.07874016, -0.05511811, -0.03149606, -0.00787402, 0.01574803, 0.03937008, 0.06299213, 0.08661417, 0.11023622, 0.13385827, 0.15748031, 0.18110236, 0.20472441, 0.22834646, 0.2519685, 0.27559055, 0.2992126, 0.32283465, 0.34645669, 0.37007874, 0.39370079, 0.41732283, 0.44094488, 0.46456693, 0.48818898, 0.51181102, 0.53543307, 0.55905512, 0.58267717, 0.60629921, 0.62992126, 0.65354331, 0.67716535, 0.7007874, 0.72440945, 0.7480315, 0.77165354, 0.79527559, 0.81889764, 0.84251969, 0.86614173, 0.88976378, 0.91338583, 0.93700787, 0.96062992, 0.98425197, 1.00787402, 1.03149606, 1.05511811, 1.07874016, 1.1023622, 1.12598425, 1.1496063, 1.17322835, 1.19685039, 1.22047244, 1.24409449, 1.26771654, 1.29133858, 1.31496063, 1.33858268, 1.36220472, 1.38582677, 1.40944882, 1.43307087, 1.45669291, 1.48031496, 1.50393701, 1.52755906, 1.5511811, 1.57480315, 1.5984252, 1.62204724, 1.64566929, 1.66929134, 1.69291339, 1.71653543, 1.74015748, 1.76377953, 1.78740157, 1.81102362, 1.83464567, 1.85826772, 1.88188976, 1.90551181, 1.92913386, 1.95275591, 1.97637795, 2.]), from_root=False)[source]¶
Inverse DISPX
Evaluates the inverse of the dispersion polynomial from the reference datamodel for a given order along the x-axis.
- Parameters
- orderstr
Order name like ‘+1’, ‘0’, ‘-1’
- x0, y0float or array-like
Detector coordinates in the direct image
- dxfloat
X coordinate where to interpolate the trace
- t0array-like
1D evaluation grid for the inverse.
- from_rootbool
Use polynomial roots to find the inverse.
- Returns
- tfloat
Independent variable value along the trace.
- INVDISPY(order, x0, y0, dx, t0=array([-1., -0.97637795, -0.95275591, -0.92913386, -0.90551181, -0.88188976, -0.85826772, -0.83464567, -0.81102362, -0.78740157, -0.76377953, -0.74015748, -0.71653543, -0.69291339, -0.66929134, -0.64566929, -0.62204724, -0.5984252, -0.57480315, -0.5511811, -0.52755906, -0.50393701, -0.48031496, -0.45669291, -0.43307087, -0.40944882, -0.38582677, -0.36220472, -0.33858268, -0.31496063, -0.29133858, -0.26771654, -0.24409449, -0.22047244, -0.19685039, -0.17322835, -0.1496063, -0.12598425, -0.1023622, -0.07874016, -0.05511811, -0.03149606, -0.00787402, 0.01574803, 0.03937008, 0.06299213, 0.08661417, 0.11023622, 0.13385827, 0.15748031, 0.18110236, 0.20472441, 0.22834646, 0.2519685, 0.27559055, 0.2992126, 0.32283465, 0.34645669, 0.37007874, 0.39370079, 0.41732283, 0.44094488, 0.46456693, 0.48818898, 0.51181102, 0.53543307, 0.55905512, 0.58267717, 0.60629921, 0.62992126, 0.65354331, 0.67716535, 0.7007874, 0.72440945, 0.7480315, 0.77165354, 0.79527559, 0.81889764, 0.84251969, 0.86614173, 0.88976378, 0.91338583, 0.93700787, 0.96062992, 0.98425197, 1.00787402, 1.03149606, 1.05511811, 1.07874016, 1.1023622, 1.12598425, 1.1496063, 1.17322835, 1.19685039, 1.22047244, 1.24409449, 1.26771654, 1.29133858, 1.31496063, 1.33858268, 1.36220472, 1.38582677, 1.40944882, 1.43307087, 1.45669291, 1.48031496, 1.50393701, 1.52755906, 1.5511811, 1.57480315, 1.5984252, 1.62204724, 1.64566929, 1.66929134, 1.69291339, 1.71653543, 1.74015748, 1.76377953, 1.78740157, 1.81102362, 1.83464567, 1.85826772, 1.88188976, 1.90551181, 1.92913386, 1.95275591, 1.97637795, 2.]), from_root=False)[source]¶
Inverse DISPY
Evaluates the inverse of the dispersion polynomial from the reference datamodel for a given order along the y-axis.
- Parameters
- orderstr
Order name like ‘+1’, ‘0’, ‘-1’
- x0, y0float or array-like
Detector coordinates in the direct image
- dxfloat, array-like
Y coordinate where to interpolate the trace
- t0array-like
1D evaluation grid for the inverse interpolation.
- from_rootbool
Use polynomial roots to find the inverse.
- Returns
- tlike
dx
Independent variable value along the trace.
- tlike
- get_photom(xyt=(1024, 1024, 0.5), date=None, photom_file=None, verbose=False, **kwargs)[source]¶
Load photom reference from CRDS and scale to grismconf / aXe convention
- Parameters
- xyt(float, float, float)
Coordinate (x0, y0, t) where to evaluate the grism dispersion DLDP
- datestr, None
Observation date in ISO format, e.g., ‘2023-01-01 00:00:00’. If not specified, defaults to “now”
- photom_filestr
Explicit filename of a CRDS
photom
reference file- verbosebool
Print status message
- Returns
- SENS_datadict
Dict of
{'order': (wave, sens)}
. Also setsSENS_data
,SENS_dldp
andSENS_xyt
attributes.
- load_new_sensitivity_curve(verbose=True, **kwargs)[source]¶
Replace +1 NIRCam sensitivity curves with Nov 10, 2023 updates
Files generated with the calibration data of P330E from program CAL-1538 (K. Gordon)
Download the FITS files from the link below and put them in
$GRIZLI/CONF/GRISM_NIRCAM/
.https://s3.amazonaws.com/grizli-v2/JWSTGrism/NircamSensitivity/index.html
- Parameters
- verbosebool
Print messages to the terminal.