gemini_instruments.gnirs package

class gemini_instruments.gnirs.AstroDataGnirs(nddata=None, tables=None, phu=None, indices=None, is_single=False)[source]

Bases: AstroDataGemini

array_name()[source]

Returns the name of each array

Returns:

the array names

Return type:

list of str/str

array_section(pretty=False)[source]

Returns the section covered by the array(s) relative to the detector frame. For example, this can be the position of multiple amps read within a CCD. If pretty is False, a tuple of 0-based coordinates is returned with format (x1, x2, y1, y2). If pretty is True, a keyword value is returned without parsing as a string. In this format, the coordinates are generally 1-based.

One tuple or string is return per extension/array, in a list. If the method is called on a single slice, the section is returned as a tuple or a string.

Parameters:

pretty (bool) – If True, return the formatted string found in the header.

Returns:

  • tuple of integers or list of tuples – Position of extension(s) using Python slice values

  • string or list of strings – Position of extension(s) using an IRAF section format (1-based)

data_section(pretty=False)[source]

Returns the rectangular section that includes the pixels that would be exposed to light. If pretty is False, a tuple of 0-based coordinates is returned with format (x1, x2, y1, y2). If pretty is True, a keyword value is returned without parsing as a string. In this format, the coordinates are generally 1-based.

One tuple or string is return per extension/array, in a list. If the method is called on a single slice, the section is returned as a tuple or a string.

Parameters:

pretty (bool) – If True, return the formatted string found in the header.

Returns:

  • tuple of integers or list of tuples – Location of the pixels exposed to light using Python slice values.

  • string or list of strings – Location of the pixels exposed to light using an IRAF section format (1-based).

dec()[source]

Returns the Declination of the center of the field in degrees. Uses the Dec derived from the WCS, unless it is wildly different from the target Dec stored in the headers (with telescope offset and in ICRS). When that’s the case the target Dec is used.

Returns:

Declination of the center of the field in degrees.

Return type:

float

detector_section(pretty=False)[source]

Returns the section covered by the detector relative to the whole mosaic of detectors. If pretty is False, a tuple of 0-based coordinates is returned with format (x1, x2, y1, y2). If pretty is True, a keyword value is returned without parsing as a string. In this format, the coordinates are generally 1-based.

One tuple or string is return per extension/array, in a list. If the method is called on a single slice, the section is returned as a tuple or a string.

Parameters:

pretty (bool) – If True, return the formatted string found in the header.

Returns:

  • tuple of integers or list of tuples – Position of the detector using Python slice values.

  • string or list of strings – Position of the detector using an IRAF section format (1-based).

detector_x_offset()[source]

Returns the offset from the reference position in pixels along the positive x-direction of the detector

Returns:

The offset in pixels

Return type:

float

detector_y_offset()[source]

Returns the offset from the reference position in pixels along the positive y-direction of the detector

Returns:

The offset in pixels

Return type:

float

disperser(stripID=False, pretty=False)[source]

Returns the name of the disperser group as the name of the grating and of the prims joined with ‘&’, unless the acquisition mirror is in the beam, then returns the string “MIRROR”. The component ID can be removed with either ‘stripID’ or ‘pretty’ set to True.

Parameters:
  • stripID (bool) – If True, removes the component ID and returns only the name of the disperser.

  • pretty (bool) – Same as for stripID. Pretty here does not do anything more.

Returns:

The disperser group, as grism&prism, with or without the component ID.

Return type:

str

dispersion(asMicrometers=False, asNanometers=False, asAngstroms=False)[source]

Returns the dispersion in meters per pixel as a list (one value per extension) or a float if used on a single-extension slice. It is possible to control the units of wavelength using the input arguments.

Parameters:
  • asMicrometers (bool) – If True, return the wavelength in microns

  • asNanometers (bool) – If True, return the wavelength in nanometers

  • asAngstroms (bool) – If True, return the wavelength in Angstroms

Returns:

The dispersion(s)

Return type:

list/float

dispersion_axis()[source]

Returns the axis along which the light is dispersed.

Returns:

Dispersion axis.

Return type:

int

focal_plane_mask(stripID=False, pretty=False)[source]

Returns the name of the focal plane mask group as the slit and the decker joined with ‘&’, or as a shorter (pretty) version. The component ID can be removed with either ‘stripID’ or ‘pretty’ set to True.

Parameters:
  • stripID (bool) – If True, removes the component ID and returns only the name of the focal plane mask.

  • pretty (bool) – If True, removes the component IDs and returns a short string representing broadly the setting.

Returns:

The name of the focal plane mask with or without the component ID.

Return type:

str

gain()

Returns the gain (electrons/ADU) for each extension

Returns:

Gains used for the observation

Return type:

list of floats/float

group_id()[source]

Returns a string representing a group of data that are compatible with each other. This is used when stacking, for example. Each instrument, mode of observation, and data type will have its own rules.

Returns:

A group ID for compatible data.

Return type:

str

nominal_photometric_zeropoint()[source]

Returns the nominal photometric zeropoint for the observation. This value is obtained from a lookup table based on gain, the camera used, and the filter used.

Returns:

The nominal photometric zeropoint as a magnitude.

Return type:

float

non_linear_level()

Returns the level at which the data become non-linear, in ADU. This is expected to be overridden by the individual instruments, so at the Gemini level it returns the values of the NONLINEA keywords (or None)

Returns:

non-linearity level level in ADU

Return type:

int/list

pixel_scale()[source]

Returns the pixel scale in arc seconds. GNIRS pixel scale is determined soley by the camera used, long or short, regardless of color band (red|blue).

GNIRS instrument page,

Short camera (0.15”/pix) – lookup.pixel_scale_shrt Long camera (0.05”/pix) – lookup.pixel_scale_long

Returns:

Pixel scale in arcsec

Return type:

<float>,

Raises:

ValueError – If ‘camera’ is neither short nor long, it is unrecognized.

position_angle()[source]

Returns the position angle of the instruement

Returns:

the position angle (East of North) of the +ve y-direction

Return type:

float

prism_motor_steps()[source]

Returns the PRSM_ENG header value, which is the step count of the prism mechanism. This is needed to associate HR-IFR (at least) flats correctly following discovery in Apr-2024 that the prism mechanism does not position with sufficient reproducability for the HR-IFU. Thus, sci-ops will tweak the step count on the fly at the start of a sequence, taking “dummy” flats to do so. The correct flat to use must have the same prism_eng value as the science.

Return type:

PRSM_ENG value from the PHU as an int, or None if unable.

ra()[source]

Returns the Right Ascension of the center of the field in degrees. Uses the RA derived from the WCS, unless it is wildly different from the target RA stored in the headers (with telescope offset and in ICRS). When that’s the case the target RA is used.

Returns:

Right Ascension of the target in degrees.

Return type:

float

read_mode()[source]

Returns the read mode for the observation. Uses a lookup table indexed on the number of non-destructive read pairs (LNRS) and the number of digital averages (NDAVGS)

Returns:

Read mode for the observation.

Return type:

str

read_noise()

Returns the read noise in electrons for each extension. A list is returned unless called on a single-extension slice, when a float

Returns:

the read noise

Return type:

float/list of floats

saturation_level()

Returns the saturation level of the data, in the units of the data. This is expected to be overridden by the individual instruments, so at the Gemini level it returns the values of the SATLEVEL keyword (or None).

Returns:

saturation level (in units of the data)

Return type:

list/float

slit(stripID=False, pretty=False)[source]

Returns the name of the slit mask. The component ID can be removed with either ‘stripID’ or ‘pretty’ set to True.

Parameters:
  • stripID (bool) – If True, removes the component ID and returns only the name of the slit.

  • pretty (bool) – Same as for stripID. Pretty here does not do anything more.

Returns:

The name of the slit with or without the component ID.

Return type:

str

slit_width()[source]

Returns the width of the slit in arcseconds

Returns:

the slit width in arcseconds

Return type:

float/None

well_depth_setting()[source]

Returns the well depth setting used for the observation. For GNIRS, this is either ‘Shallow’ or ‘Deep’.

Returns:

Well depth setting.

Return type:

str

Submodules

gemini_instruments.gnirs.adclass module

class gemini_instruments.gnirs.adclass.AstroDataGnirs(nddata=None, tables=None, phu=None, indices=None, is_single=False)[source]

Bases: AstroDataGemini

array_name()[source]

Returns the name of each array

Returns:

the array names

Return type:

list of str/str

array_section(pretty=False)[source]

Returns the section covered by the array(s) relative to the detector frame. For example, this can be the position of multiple amps read within a CCD. If pretty is False, a tuple of 0-based coordinates is returned with format (x1, x2, y1, y2). If pretty is True, a keyword value is returned without parsing as a string. In this format, the coordinates are generally 1-based.

One tuple or string is return per extension/array, in a list. If the method is called on a single slice, the section is returned as a tuple or a string.

Parameters:

pretty (bool) – If True, return the formatted string found in the header.

Returns:

  • tuple of integers or list of tuples – Position of extension(s) using Python slice values

  • string or list of strings – Position of extension(s) using an IRAF section format (1-based)

data_section(pretty=False)[source]

Returns the rectangular section that includes the pixels that would be exposed to light. If pretty is False, a tuple of 0-based coordinates is returned with format (x1, x2, y1, y2). If pretty is True, a keyword value is returned without parsing as a string. In this format, the coordinates are generally 1-based.

One tuple or string is return per extension/array, in a list. If the method is called on a single slice, the section is returned as a tuple or a string.

Parameters:

pretty (bool) – If True, return the formatted string found in the header.

Returns:

  • tuple of integers or list of tuples – Location of the pixels exposed to light using Python slice values.

  • string or list of strings – Location of the pixels exposed to light using an IRAF section format (1-based).

dec()[source]

Returns the Declination of the center of the field in degrees. Uses the Dec derived from the WCS, unless it is wildly different from the target Dec stored in the headers (with telescope offset and in ICRS). When that’s the case the target Dec is used.

Returns:

Declination of the center of the field in degrees.

Return type:

float

detector_section(pretty=False)[source]

Returns the section covered by the detector relative to the whole mosaic of detectors. If pretty is False, a tuple of 0-based coordinates is returned with format (x1, x2, y1, y2). If pretty is True, a keyword value is returned without parsing as a string. In this format, the coordinates are generally 1-based.

One tuple or string is return per extension/array, in a list. If the method is called on a single slice, the section is returned as a tuple or a string.

Parameters:

pretty (bool) – If True, return the formatted string found in the header.

Returns:

  • tuple of integers or list of tuples – Position of the detector using Python slice values.

  • string or list of strings – Position of the detector using an IRAF section format (1-based).

detector_x_offset()[source]

Returns the offset from the reference position in pixels along the positive x-direction of the detector

Returns:

The offset in pixels

Return type:

float

detector_y_offset()[source]

Returns the offset from the reference position in pixels along the positive y-direction of the detector

Returns:

The offset in pixels

Return type:

float

disperser(stripID=False, pretty=False)[source]

Returns the name of the disperser group as the name of the grating and of the prims joined with ‘&’, unless the acquisition mirror is in the beam, then returns the string “MIRROR”. The component ID can be removed with either ‘stripID’ or ‘pretty’ set to True.

Parameters:
  • stripID (bool) – If True, removes the component ID and returns only the name of the disperser.

  • pretty (bool) – Same as for stripID. Pretty here does not do anything more.

Returns:

The disperser group, as grism&prism, with or without the component ID.

Return type:

str

dispersion(asMicrometers=False, asNanometers=False, asAngstroms=False)[source]

Returns the dispersion in meters per pixel as a list (one value per extension) or a float if used on a single-extension slice. It is possible to control the units of wavelength using the input arguments.

Parameters:
  • asMicrometers (bool) – If True, return the wavelength in microns

  • asNanometers (bool) – If True, return the wavelength in nanometers

  • asAngstroms (bool) – If True, return the wavelength in Angstroms

Returns:

The dispersion(s)

Return type:

list/float

dispersion_axis()[source]

Returns the axis along which the light is dispersed.

Returns:

Dispersion axis.

Return type:

int

focal_plane_mask(stripID=False, pretty=False)[source]

Returns the name of the focal plane mask group as the slit and the decker joined with ‘&’, or as a shorter (pretty) version. The component ID can be removed with either ‘stripID’ or ‘pretty’ set to True.

Parameters:
  • stripID (bool) – If True, removes the component ID and returns only the name of the focal plane mask.

  • pretty (bool) – If True, removes the component IDs and returns a short string representing broadly the setting.

Returns:

The name of the focal plane mask with or without the component ID.

Return type:

str

gain()

Returns the gain (electrons/ADU) for each extension

Returns:

Gains used for the observation

Return type:

list of floats/float

group_id()[source]

Returns a string representing a group of data that are compatible with each other. This is used when stacking, for example. Each instrument, mode of observation, and data type will have its own rules.

Returns:

A group ID for compatible data.

Return type:

str

nominal_photometric_zeropoint()[source]

Returns the nominal photometric zeropoint for the observation. This value is obtained from a lookup table based on gain, the camera used, and the filter used.

Returns:

The nominal photometric zeropoint as a magnitude.

Return type:

float

non_linear_level()

Returns the level at which the data become non-linear, in ADU. This is expected to be overridden by the individual instruments, so at the Gemini level it returns the values of the NONLINEA keywords (or None)

Returns:

non-linearity level level in ADU

Return type:

int/list

pixel_scale()[source]

Returns the pixel scale in arc seconds. GNIRS pixel scale is determined soley by the camera used, long or short, regardless of color band (red|blue).

GNIRS instrument page,

Short camera (0.15”/pix) – lookup.pixel_scale_shrt Long camera (0.05”/pix) – lookup.pixel_scale_long

Returns:

Pixel scale in arcsec

Return type:

<float>,

Raises:

ValueError – If ‘camera’ is neither short nor long, it is unrecognized.

position_angle()[source]

Returns the position angle of the instruement

Returns:

the position angle (East of North) of the +ve y-direction

Return type:

float

prism_motor_steps()[source]

Returns the PRSM_ENG header value, which is the step count of the prism mechanism. This is needed to associate HR-IFR (at least) flats correctly following discovery in Apr-2024 that the prism mechanism does not position with sufficient reproducability for the HR-IFU. Thus, sci-ops will tweak the step count on the fly at the start of a sequence, taking “dummy” flats to do so. The correct flat to use must have the same prism_eng value as the science.

Return type:

PRSM_ENG value from the PHU as an int, or None if unable.

ra()[source]

Returns the Right Ascension of the center of the field in degrees. Uses the RA derived from the WCS, unless it is wildly different from the target RA stored in the headers (with telescope offset and in ICRS). When that’s the case the target RA is used.

Returns:

Right Ascension of the target in degrees.

Return type:

float

read_mode()[source]

Returns the read mode for the observation. Uses a lookup table indexed on the number of non-destructive read pairs (LNRS) and the number of digital averages (NDAVGS)

Returns:

Read mode for the observation.

Return type:

str

read_noise()

Returns the read noise in electrons for each extension. A list is returned unless called on a single-extension slice, when a float

Returns:

the read noise

Return type:

float/list of floats

saturation_level()

Returns the saturation level of the data, in the units of the data. This is expected to be overridden by the individual instruments, so at the Gemini level it returns the values of the SATLEVEL keyword (or None).

Returns:

saturation level (in units of the data)

Return type:

list/float

slit(stripID=False, pretty=False)[source]

Returns the name of the slit mask. The component ID can be removed with either ‘stripID’ or ‘pretty’ set to True.

Parameters:
  • stripID (bool) – If True, removes the component ID and returns only the name of the slit.

  • pretty (bool) – Same as for stripID. Pretty here does not do anything more.

Returns:

The name of the slit with or without the component ID.

Return type:

str

slit_width()[source]

Returns the width of the slit in arcseconds

Returns:

the slit width in arcseconds

Return type:

float/None

well_depth_setting()[source]

Returns the well depth setting used for the observation. For GNIRS, this is either ‘Shallow’ or ‘Deep’.

Returns:

Well depth setting.

Return type:

str

gemini_instruments.gnirs.lookup module

class gemini_instruments.gnirs.lookup.Config(mdf, offsetsection, pixscale, mode)

Bases: tuple

mdf

Alias for field number 0

mode

Alias for field number 3

offsetsection

Alias for field number 1

pixscale

Alias for field number 2

gemini_instruments.gnirs.lookup.DetectorConfig

alias of Config