JwstDispersionTransform¶
- class grizli.grismconf.JwstDispersionTransform(instrument='NIRCAM', module='A', grism='R', conf_file=None, header=None)[source]¶
Bases:
object
Rotate NIRISS and NIRCam coordinates such that slitless dispersion has wavelength increasing towards +x. Also works for HST, but does nothing.
- Parameters
- instrumentstr
Instrument name. E.g., ‘NIRCAM’, ‘NIRISS’, ‘WFC3’.
- modulestr
NIRCAM module. Can be ‘A’ or ‘B’.
- grismstr
Grism name. Can be ‘R’ or ‘C’ for NIRCAM and ‘GR150R’ or ‘GR150C’ for NIRISS.
- conf_filestr
Configuration file to read instrument/grism from. If not provided, will try to infer from the header.
- header
astropy.io.fits.Header
Header object to read instrument/grism from. If not provided, will try to infer from the
conf_file
.
Attributes Summary
Center of rotation
Rotations are all multiples of 90 for now, so compute values that can be passed to
numpy.rot90
for rotating 2D image arraysClockwise rotation (degrees) from detector to wavelength increasing towards +x direction
Which detector axis corresponds to increasing wavelength
Methods Summary
forward
(x, y)Forward transform, detector to +x.
reverse
(x, y)Reverse transform, +x to detector.
rotate_coordinates
(x, y, theta, center)Rotate cartesian coordinates
x
andy
by angletheta
aboutcenter
Attributes Documentation
- array_center¶
Center of rotation
Maybe this is 1020 for NIRISS?
- rot90¶
Rotations are all multiples of 90 for now, so compute values that can be passed to
numpy.rot90
for rotating 2D image arrays
- rotation¶
Clockwise rotation (degrees) from detector to wavelength increasing towards +x direction
- trace_axis¶
Which detector axis corresponds to increasing wavelength
Methods Documentation
- forward(x, y)[source]¶
Forward transform, detector to +x.
Rotate NIRISS and NIRCam coordinates such that slitless dispersion has wavelength increasing towards +x. Also works for HST, but does nothing.
- Parameters
- x, yfloat or array-like
Original detector coordinates
- Returns
- x, yarray-like
Coordinates in rotated frame
- reverse(x, y)[source]¶
Reverse transform, +x to detector.
Rotates coordinates from the +x direction to the detector frame.
- Parameters
- x, yfloat or array-like
Coordinates in rotated frame
- Returns
- x, yarray-like
Original detector coordinates
- static rotate_coordinates(x, y, theta, center)[source]¶
Rotate cartesian coordinates
x
andy
by angletheta
aboutcenter
- Parameters
- x, yfloat or array-like
Original detector coordinates
- thetafloat
Rotation angle in radians.
- centerarray-like
Center of rotation.
- Returns
- x, yarray-like
Coordinates in rotated frame