qusp.wavelength module

Provides support for working with BOSS wavelengths

Examples

Add sky lines to quasar spectrum plot:

>>> qusp.wavelength.draw_lines(qusp.wavelength.load_wavelengths('sky'))

Get a combined spectrum’s fiducial pixel offset:

>>> offset = qusp.wavelength.get_fiducial_pixel_index_offset(np.log10(combined.wave[0]))

Construct a fiducial pixel wavelength array:

>>> wave = qusp.wavelength.get_fiducial_wavelength(np.arange(4800))

class qusp.wavelength.LabeledWavelength(value, label)

Bases: qusp.wavelength.Wavelength

A LabeledWavelength is a Wavelength with a label attribute

class qusp.wavelength.Wavelength(value)

Bases: float

A Wavelength is a float.

Parameters:value (float) – wavelength value
observed(redshift)
Parameters:redshift (float) – source redshift
Returns:the shifted observed wavelength.
rest(redshift)
Parameters:redshift (float) – source redshift
Returns:the shifted rest wavelength.
qusp.wavelength.draw_lines(waves, offset=0, delta=0.1, **kwargs)

Draws vertical lines on the current plot.

qusp.wavelength.get_fiducial_pixel_index_offset(loglam, coeff1=0.0001, log10lam0=<Mock name='mock()' id='140482188749840'>)

Returns the pixel index offset from the start of the BOSS co-add fiducial wavelength grid.

Parameters:
  • coeff0 (float) – central wavelength (log10) of first pixel
  • coeff1 (float, optional) – log10 dispersion per pixel
Returns:

pixel index offset from the start of the fiducial wavelength grid.

qusp.wavelength.get_fiducial_wavelength(pixel_index, coeff1=0.0001, log10lam0=<Mock name='mock()' id='140482188749712'>)

Returns the wavelength at the center of the specified index of the BOSS co-add fiducial wavelength grid.

Parameters:pixel_index (int) – index of the BOSS co-add fiducial wavelength grid.
Returns:central wavelength of the specified index on the fiducial wavelength grid
Return type:wavelength (float)
qusp.wavelength.load_wavelengths(filename, ignore_labels=False)

Loads a list of wavelengths from the specified file

Parameters:filename (str) – wavelength data filename
Returns:wavelengths (list)