soxspipe.commonutils.polynomials

definition of polynomial functions needed throughout code

Author

David Young

Date Created

September 10, 2020

Module Contents

Classes

chebyshev_order_wavelength_polynomials

the chebyshev polynomial fits for the single frames; to be iteratively fitted to minimise errors

chebyshev_order_xy_polynomials

the chebyshev polynomial fits FIX ME

chebyshev_xy_polynomial

the chebyshev polynomial fits for the pinhole flat frame order tracing; to be iteratively fitted to minimise errors

API

class soxspipe.commonutils.polynomials.chebyshev_order_wavelength_polynomials(log, orderDeg, wavelengthDeg, slitDeg, exponentsIncluded=False, axis=False)[source][source]

the chebyshev polynomial fits for the single frames; to be iteratively fitted to minimise errors

Key Arguments:

  • log – logger

  • orderDeg – degree of the order polynomial components

  • wavelengthDeg – degree of wavelength polynomial components

  • slitDeg – degree of the slit polynomial components

  • exponentsIncluded – the exponents have already been calculated in the dataframe so no need to regenerate. Default False

  • axis – x, y or False. Default False.

Usage:

from soxspipe.commonutils.polynomials import chebyshev_order_wavelength_polynomials
poly = chebyshev_order_wavelength_polynomials(
        log=self.log, orderDeg=orderDeg, wavelengthDeg=wavelengthDeg, slitDeg=slitDeg).poly

Initialization

poly(orderPixelTable, *coeff)[source][source]

the polynomial definition

Key Arguments:

  • orderPixelTable – a pandas dataframe containing wavelengths, orders and slit positions

  • *coeff – a list of the initial coefficients

Return:

  • lhsVals – the left-hand-side vals of the fitted polynomials

class soxspipe.commonutils.polynomials.chebyshev_order_xy_polynomials(log, orderDeg, axisBDeg, axisB='y', axisBCol=False, orderCol=False, exponentsIncluded=False)[source][source]

the chebyshev polynomial fits FIX ME

Key Arguments:

  • log – logger

  • orderDeg – degree of the order polynomial components

  • axisBDeg – degree for polynomial to fit free axis-values

  • axisB – the free axis related to axisBDeg. Default ‘y’. [‘x’|‘y’]

  • axisBCol – name of the free axis column (if needed). Default False

  • orderCol – name of the order column (if needed). Default False

  • exponentsIncluded – the exponents have already been calculated in the dataframe so no need to regenerate. Default False

Usage:

from soxspipe.commonutils.polynomials import chebyshev_order_wavelength_polynomials
poly = chebyshev_order_wavelength_polynomials(
        log=self.log, orderDeg=orderDeg, wavelengthDeg=wavelengthDeg, slitDeg=slitDeg).poly

Initialization

poly(orderPixelTable, *coeff)[source][source]

the polynomial definition

Key Arguments:

  • orderPixelTable – a pandas dataframe containing x, y, order

  • *coeff – a list of the initial coefficients

Return:

  • lhsVals – the left-hand-side vals of the fitted polynomials

class soxspipe.commonutils.polynomials.chebyshev_xy_polynomial(log, y_deg, yCol=False, exponentsIncluded=False)[source][source]

the chebyshev polynomial fits for the pinhole flat frame order tracing; to be iteratively fitted to minimise errors

Key Arguments:

  • log – logger

  • yCol – name of the yCol

  • y_deg – y degree of the polynomial components

  • exponentsIncluded – the exponents have already been calculated in the dataframe so no need to regenerate. Default False

Usage:

from soxspipe.commonutils.polynomials import chebyshev_xy_polynomial
poly = chebyshev_xy_polynomial(
        log=self.log, deg=deg).poly

Initialization

poly(orderPixelTable, *coeff)[source][source]

the polynomial definition

Key Arguments:

  • orderPixelTable – data frame with all pixel data arrays

  • *coeff – a list of the initial coefficients

Return:

  • xvals – the x values of the fitted polynomial