pypeit.core.wavecal.kdtree_generator module

This script is used to generate the KD Tree that is needed for the kdtree pattern matching wavelength calibration algorithm. At present, this method is only used for calibrating ThAr lamps.

You should not run this script unless you know what you’re doing, since you could mess up the ThAr patterns that are used in the wavelength calibration routine. This script should not be called from within PypeIt - it should be run as a standalone script, and it’s only purpose is to generate a KD Tree with the desired patterns.

pypeit.core.wavecal.kdtree_generator.hexagon(linelist, numsrch, maxlin)[source]

see trigon and tetragon for an example docstring

pypeit.core.wavecal.kdtree_generator.main(polygon, numsearch=8, maxlinear=100.0, use_unknowns=True, leafsize=30, verbose=False, ret_treeindx=False, outname=None)[source]

Driving method for generating the KD Tree

Parameters:
  • polygon (int) – Number of sides to the polygon used in pattern matching

  • numsearch (int) – Number of adjacent lines to use when deriving patterns

  • maxlinear (float) – Over how many Angstroms is the solution deemed to be linear

  • use_unknowns (bool) – Include unknown lines in the wavelength calibration (these may arise from lines other than Th I/II and Ar I/II)

  • leafsize (int) – The leaf size of the tree

pypeit.core.wavecal.kdtree_generator.pentagon(linelist, numsrch, maxlin)[source]

see trigon and tetragon for an example docstring

pypeit.core.wavecal.kdtree_generator.tetragon(linelist, numsrch, maxlin)[source]

Generate a series of tetragon patterns, given an input list of detections or lines from a linelist

linelistndarray

list of wavelength calibration lines (must be sorted by ascending wavelength)

numsrchint

Number of consecutive detected lines used to generate a pattern. For example, if numsrch is 5, there are four lines (called 1 2 3 4 5). The following patterns will be generated (assuming line #1 is the left anchor): 1 2 3 4 (in this case line #4 is the right anchor) 1 2 3 5 (in this case line #5 is the right anchor) 1 2 4 5 (in this case line #5 is the right anchor) 1 3 4 5 (in this case line #5 is the right anchor)

maxlinfloat

Value (in pixels in the case of detections or Angstroms in the case of a linelist) over which the wavelength solution can be considered linear.

pypeit.core.wavecal.kdtree_generator.trigon(linelist, numsrch, maxlin)[source]

Generate a series of trigon patterns, given an input list of detections or lines from a linelist

linelistndarray

list of wavelength calibration lines (must be sorted by ascending wavelength)

numsrchint

Number of consecutive detected lines used to generate a pattern. For example, if numsrch is 4, there are four lines (called 1 2 3 4). 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)

maxlinfloat

Value (in pixels in the case of detections or Angstroms in the case of a linelist) over which the wavelength solution can be considered linear.