pypeit.core.wavecal.waveio module

Module for I/O in arclines

pypeit.core.wavecal.waveio.load_line_list(line_file, use_ion=False)[source]
Parameters
  • line_file (str) – Full path to line_list or name of ion

  • use_ion (bool, optional) – Interpret line_file as an ion, e.g. CuI

Returns

line_list

Return type

Table

pypeit.core.wavecal.waveio.load_line_lists(lamps, unknown=False, all=False, restrict_on_instr=None)[source]

Loads a series of line list files

Parameters
  • lamps (list) – List of arc lamps to be used for wavelength calibration. E.g., [‘ArI’,’NeI’,’KrI’,’XeI’]

  • unknown (bool, optional) – Load the unknown list

  • restrict_on_instr (str, optional) – Restrict according to the input spectrograph

Returns

line_list

Return type

Table

pypeit.core.wavecal.waveio.load_reid_arxiv(arxiv_file)[source]

Load a REID arxiv file Now there are 2 possible formats. We need to consolidate

Parameters

arxiv_file (str) –

Return type

dict, dict-like

pypeit.core.wavecal.waveio.load_template(arxiv_file, det, wvrng=None)[source]

Load a full template file from disk

Parameters
  • arxiv_file – str

  • det – int

  • wvrng (list, optional) – min, max wavelength range for the arxiv

Returns

ndarray flux: ndarray binning: int, Of the template arc spectrum

Return type

wave

pypeit.core.wavecal.waveio.load_tree(polygon=4, numsearch=20)[source]

Load a KDTree of ThAr patterns that is stored on disk

Parameters
  • polygon (int) –

    Number of sides to the polygon used in pattern matching:

    • polygon=3 –> trigon (two anchor lines and one floating line)

    • polygon=4 –> tetragon (two anchor lines and two floating lines)

    • polygon=5 –> pentagon (two anchor lines and three floating lines)

  • numsearch (int) –

    Number of consecutive detected lines used to generate a pattern. For example, if numsearch is 4, then for a trigon, the following patterns will be generated (assuming line #1 is the left anchor):

    • 1 2 3 (in this case line #3 is the right anchor)

    • 1 2 4 (in this case line #4 is the right anchor)

    • 1 3 4 (in this case line #4 is the right anchor)

Returns

  • file_load (KDTree instance) – The KDTree containing the patterns

  • index (ndarray) – For each pattern in the KDTree, this array stores the corresponding index in the linelist

pypeit.core.wavecal.waveio.load_unknown_list(lines, unknwn_file=None, all=False)[source]
Parameters
  • lines (list) – Restricted lines; use all=True for all

  • unknwn_file (str, optional) –

  • all (bool, optional) –

Returns

unknwn_lines

Return type

Table

pypeit.core.wavecal.waveio.load_wavelength_calibration(filename: Path) dict[source]

Load the wavelength calibration data from a file.

Parameters

filename (pathlib.Path) – Name of the json file.

Returns

Returns the wavelength calibration dictionary. Lists read from the json file are returnes as numpy arrays.

Return type

dict