goodman_pipeline.wcs package#

Submodules#

goodman_pipeline.wcs.wcs module#

Set of class and method to handle wavelength solutions

class goodman_pipeline.wcs.wcs.WCS#

Bases: object

World Coordinate System class for Spectroscopy

This class is intended to contain methods for all operations regarding WCS for spectroscopy or wavelength solution operations. Starting on the fitting to writing (and reading) from a FITS header.

property binning#
fit(physical, wavelength, model_name='chebyshev', degree=3)#

Fits a mathematical model

Parameters:
  • physical (list) – List of line centers in pixel

  • wavelength (list) – List of line centers in Angstroms

  • model_name (str) – Name of the Mathematical model that needs to be created

  • degree (int) – Degree or order of the mathematical model (usually is some kind of polynomial).

get_model()#

Returns the wavelength solution model if exists.

read(ccd=None)#

Read WCS from FITS header

Notes

The mathematical model stays as an attribute of the class as model

Parameters:

ccd (CCDData) – with FITS’s wavelength solution.

Returns:

A list with an array representing the wavelength axis and another representing the intensity (ccd.data).

read_gsp_wcs(ccd)#

Read a GSP-specific wavelength solution

Parameters:

ccd (CCDData) –

Returns:

astropy.modeling.Model instance

write_fits_wcs(ccd, model)#

Write FITS WCS to the header

Notes

This method is not implemented, in the current version the equivalent method resides within goodman.pipeline.spectroscopy.wavelength.py

Parameters:
  • ccd (CCDData) –

  • model (object) – Instance of astropy.modeling.Model that should be the mathematical representation of the wavelength solution of ccd

Raises:

NotImplementedError

static write_gsp_wcs(ccd, model)#

Writes a GSP-specific wavelength solution

In an effort to easily write non-linear wavelength solutions into a fits header this method add a set of keywords that describes a pixel to angstrom relationship by means of using the astropy’s modeling tools.

GSP stands for Goodman Spectroscopic Pipeline.

Notes

A limited amount of mathematical models are implemented on the read side. So you have to be careful what you write.

Parameters:
  • ccd (CCDData) – attribute will be modified

  • model (object) – astropy.modeling.Model instance.

Returns:

Module contents#