KPIC

class breads.instruments.KPIC(spec=None, trace=None, wvs=None, err=None, badpix=None, baryrv=None, orders=None, combine_mode='planet', fiber_goal_list=None)[source]

Bases: Instrument

Initialize instrument

Parameters:
ins_type
verbose

Methods Summary

broaden(wvs, spectrum[, loc, mppool])

Broaden a spectrum to the resolution of this data object using the line spread function (LSF) calibration available.

read_data_file(spec, trace, wvs[, err, ...])

Read OSIRIS spectral cube, also checks validity at the end

selec_order(orders)

Methods Documentation

broaden(wvs, spectrum, loc=None, mppool=None)[source]

Broaden a spectrum to the resolution of this data object using the line spread function (LSF) calibration available. LSF is assumed to be a 1D gaussian. The broadening is technically fiber dependent so you need to specify which fiber calibration to use.

Args:

wvs: Wavelength sampling of the spectrum to be broadened. spectrum: 1D spectrum to be broadened. loc: Fiber index to be used. mypool: Multiprocessing pool to parallelize the code. If None (default), non parallelization is applied.

E.g. mppool = mp.Pool(processes=10) # 10 is the number processes

Return:

Broadened spectrum

read_data_file(spec, trace, wvs, err=None, badpix=None, baryrv=None, orders=None, combine_mode=None, fiber_goal_list=None, identifybadpix=False)[source]

Read OSIRIS spectral cube, also checks validity at the end

Args:
fiber_goal_list: List of the fibers that was being tracked. (indexed from 0)

If None (default), will use GOALNM keyword. If “brightest”, defines the fiber being tracked from the brightest trace in the array If nd.array, user-defined e.g. [0,0,1,1,2,2,3,3]

combine_mode: if “star”, for combining a sequence of on-axis star observations accounting for variable stellar intensity.

if “companion”, just a weighted mean using the spectra errors.

selec_order(orders)[source]