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:
- Returns:
line_list
- Return type:
- pypeit.core.wavecal.waveio.load_line_lists(lamps, all=False, include_unknown: bool = 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’]
restrict_on_instr (str, optional) – Restrict according to the input spectrograph
all (bool, optional) – Load all line lists, independent of the input lamps (not recommended)
include_unknown (bool, optional) – If True, the tot_line_list includes the unknown lines
- Returns:
tot_line_list (astropy Table of line lists (including unknown lines, if requested))
line_list (astropy Table of line lists)
unkn_lines (astropy Table of unknown lines)
- 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
- pypeit.core.wavecal.waveio.load_template(arxiv_file: str, det: int, wvrng: list = None) tuple[ndarray, ndarray, int, ndarray, ndarray, ndarray, ndarray] [source]
Load a full template file from disk
- Parameters:
- Returns:
wave (np.ndarray) – Wavelength vector
flux (np.ndarray) – Flux vector
binning (int) – binning of the template arc spectrum
order (np.ndarray) – Echelle orders of the saved wavelength solution, if applicable
line_pix (np.ndarray) – Pixel values of identified arc line centroids in the saved wavelength solution, if applicable
line_wav (np.ndarray) – Wavelength values of identified arc line centroids in the saved wavelength solution, if applicable
line_fit_ord (np.ndarray) – Polynomial order of the saved wavelength solution, if applicable
- 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:
- Returns:
unknwn_lines
- Return type:
- 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: