gemini_instruments.gnirs package

class gemini_instruments.gnirs.AstroDataGnirs(provider)[source]

Bases: AstroDataGemini

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

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()[source]

Returns the gain used for the observation. This is read from a lookup table using the read_mode and the well_depth.

Returns

Gain used for the observation.

Return type

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()[source]

Returns the level at which the array becomes non-linear. The return units are ADUs. A lookup table is used and the value is based on read_mode, well_depth_setting, and saturation_level.

Returns

Level in ADU at which the non-linear regime starts.

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.

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()[source]

Returns the detector read noise, in electrons. A lookup table indexed on read_mode and well_depth_setting is used to retrieve the read noise.

Returns

Detector read noise in electrons.

Return type

float

saturation_level()[source]

Returns the saturation level or the observation, in ADUs. A lookup table indexed on read_mode and well_depth_setting is used to retrieve the saturation level.

Returns

Saturation level in ADUs.

Return type

int/list

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

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

Subpackages

Submodules

gemini_instruments.gnirs.adclass module

class gemini_instruments.gnirs.adclass.AstroDataGnirs(provider)[source]

Bases: AstroDataGemini

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

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()[source]

Returns the gain used for the observation. This is read from a lookup table using the read_mode and the well_depth.

Returns

Gain used for the observation.

Return type

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()[source]

Returns the level at which the array becomes non-linear. The return units are ADUs. A lookup table is used and the value is based on read_mode, well_depth_setting, and saturation_level.

Returns

Level in ADU at which the non-linear regime starts.

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.

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()[source]

Returns the detector read noise, in electrons. A lookup table indexed on read_mode and well_depth_setting is used to retrieve the read noise.

Returns

Detector read noise in electrons.

Return type

float

saturation_level()[source]

Returns the saturation level or the observation, in ADUs. A lookup table indexed on read_mode and well_depth_setting is used to retrieve the saturation level.

Returns

Saturation level in ADUs.

Return type

int/list

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

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

property mdf

Alias for field number 0

property mode

Alias for field number 3

property offsetsection

Alias for field number 1

property pixscale

Alias for field number 2

gemini_instruments.gnirs.lookup.DetectorConfig

alias of Config