gemini_instruments package

Subpackages

Submodules

gemini_instruments.common module

Structures and functions that can be shared across instrument code.

When should you add something here? Here’s some criteria: the code that belongs in here is not generally useful outside of gemini_instruments, and:

  • more than one instrument share the code to override a method that provides default behaviour, meaning that there’s no common ancestor where you can put this; or,

  • it doesn’t make sense to put the code in a method, as it doesn’t rely on internal knowledge of a class.

gemini_instruments.common.build_group_id(ad, desc_list, prettify=(), force_list=(), additional=None)[source]

Builds a Group ID from information found in the descriptors. It takes a number of descriptor names, invokes and then concatenates their result (converted to string) to from a group ID. Additional parameters can be passed to modify the result.

Parameters:
  • ad (AstroData) – An instance of AstroData derivative that the descriptors will be

  • desc_list (list of str) – A list of descriptor names (order matters) which will be used to build the Group ID

  • prettify (sequence/set of str) – Names of descriptors that need to be invoked with pretty=True

  • force_list (sequence/set of str) – The descriptors named in this list will have their results coerced into a list, if they returned something else.

  • additional (str) – Additional information that will be added verbatim at the end of the Group ID

Return type:

A string with the group id

gemini_instruments.common.build_ir_section(ad, pretty=False)[source]

1st gen Gemini IR instruments don’t have handy BIASSEC/DATASEC/etc keywords. This function creates section info out of other keywords.

Code common to NIRI and GNIRS.

Parameters:
  • ad (AstroData) – The object that we want to extract the section from

  • pretty (bool) – if True, return a string rather than a Section

Return type:

A list of Section instances.

gemini_instruments.gmu module

gemini_instruments.gmu.convert_units(input_units, input_value, output_units)[source]
Parameters:
  • input_units (string) – the units of the value specified by input_value. Possible values are ‘meters’, ‘micrometers’, ‘nanometers’ and ‘angstroms’.

  • input_value (float) – the input value to be converted from the input_units to the output_units

  • output_units (string) – the units of the returned value. Possible values are ‘meters’, ‘micrometers’, ‘nanometers’ and ‘angstroms’.

Return type:

float

Returns:

the converted value of input_value from input_units to output_units

gemini_instruments.gmu.detsec_to_pixels(ad, detx, dety)[source]
gemini_instruments.gmu.getComponentID(instr)[source]

Return the ID in a component name :param instr: the filter name :type instr: string :rtype: string :return: the filter ID with the rest removed, or None if the input is not a valid filter name with an ID

gemini_instruments.gmu.isBlank(bstring)[source]
gemini_instruments.gmu.parse_percentile(string)[source]
gemini_instruments.gmu.removeComponentID(instr)[source]

Remove a component ID from a filter name :param instr: the filter name :type instr: string :rtype: string :return: the filter name with the component ID removed, or None if the input is not a valid string

gemini_instruments.gmu.toicrs(frame, ra, dec, equinox=2000.0, ut_datetime=None)[source]