astro
Class SpectralFits

java.lang.Object
  extended by nom.tam.fits.Fits
      extended by astro.SpectralFits
Direct Known Subclasses:
SesFits

public abstract class SpectralFits
extends nom.tam.fits.Fits

This class deals with FITS file received as output from the SES spectrograph. This is a three dimensional fits file, where the x-coordinate (first axis) is along the echell order, 2043 pixel, the second axis is the order number, 82, and the third one indicates the image. In index zero, the reduced spectrum is found, in index 1 the raw extracted spectrum and in index 2 a sigma map of the pixel. The data typoe is float.


Field Summary
private  File fits
          The original file where the ses fits is stored.
private  double ltm
          Convert image pixel to physical pixels used for further processing.
private static String LTM
          Header keyword for apertures.
private  double ltv
          Convert image pixel to physical pixels used for further processing.
private static String LTV
          Header keyword for apertures.
private  float[][] raw
          After construction, we have these arrays available.
private  float[][] reduced
          After construction, we have these arrays available.
private  float[][] sigma
          After construction, we have these arrays available.
private  Function[] wavelength
          The wavelength solution for the orders, parsed from the header.
 
Constructor Summary
protected SpectralFits(File io)
          Constructs a SesFits from a file.
 
Method Summary
 int getCentralOrderFromAngstrom(double lambda)
          Return the orders where the specified wavelength fits best or -1 if no such order is available.
 int getHighestOrder()
          Returns the array size, -1 if undefined.
 int getIndexOfOrder(int order)
          Default implementation says aperture number equals order number.
 int getLowestOrder()
          Default implementation return 0 for lowest order number, -1 if undefined.
 int getOrderOfIndex(int index)
          Default implementation says aperture number equals order number.
 int[] getOrdersFromAngstrom(double lambda)
          Return all orders where the specified wavelength can be found.
 Vector3D[] getRawOrder(int order)
          Returns the specified order as an array of wavelength vs.
 Vector3D[] getReducedOrder(int order)
          Returns the specified order as an array of wavelength vs.
protected abstract  Function[] parseWavelengthSolution(nom.tam.fits.Header h)
          Parses the wavelength soultion from the header.
 
Methods inherited from class nom.tam.fits.Fits
addHDU, currentSize, deleteHDU, fileInit, getHDU, getNumberOfHDUs, getStream, insertHDU, makeHDU, makeHDU, makeHDU, randomInit, read, read, readHDU, setChecksum, setChecksum, setStream, size, skipHDU, skipHDU, streamInit, streamInit, streamInit, version, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LTV

private static final String LTV
Header keyword for apertures.

See Also:
Constant Field Values

LTM

private static final String LTM
Header keyword for apertures.

See Also:
Constant Field Values

fits

private File fits
The original file where the ses fits is stored.


ltv

private double ltv
Convert image pixel to physical pixels used for further processing.


ltm

private double ltm
Convert image pixel to physical pixels used for further processing.


reduced

private float[][] reduced
After construction, we have these arrays available.


raw

private float[][] raw
After construction, we have these arrays available.


sigma

private float[][] sigma
After construction, we have these arrays available.


wavelength

private Function[] wavelength
The wavelength solution for the orders, parsed from the header.

Constructor Detail

SpectralFits

protected SpectralFits(File io)
                throws nom.tam.fits.FitsException
Constructs a SesFits from a file. Note this throws FitsException if file was not found or data could not be read due to I/O. The fits is expected to be composed of a three-dimensional float array

Throws:
nom.tam.fits.FitsException
Method Detail

getIndexOfOrder

public int getIndexOfOrder(int order)
Default implementation says aperture number equals order number.


getOrderOfIndex

public int getOrderOfIndex(int index)
Default implementation says aperture number equals order number.


getLowestOrder

public int getLowestOrder()
Default implementation return 0 for lowest order number, -1 if undefined.


getHighestOrder

public int getHighestOrder()
Returns the array size, -1 if undefined.


getCentralOrderFromAngstrom

public int getCentralOrderFromAngstrom(double lambda)
Return the orders where the specified wavelength fits best or -1 if no such order is available.

Parameters:
lambda - The wavelength in Angstrom.
Returns:
The best order number

getOrdersFromAngstrom

public int[] getOrdersFromAngstrom(double lambda)
Return all orders where the specified wavelength can be found.

Parameters:
lambda - The wavelength in Angstrom.
Returns:
Either zero length, a single-element int or a bi-element int for overlapping regions

getReducedOrder

public Vector3D[] getReducedOrder(int order)
                           throws nom.tam.fits.FitsException
Returns the specified order as an array of wavelength vs. intensity plus error. Note that the image pixel number in dispersion direction (1...NAXIS1) is first converted to physical coordinates using the LTV1 and LTM1_1 keywords. This physical coordinate (in most cases identical to the image pixel number) is then used in the wavelength solution to get to lambda, normally in Angstrom.

Throws:
nom.tam.fits.FitsException - If the requested order cannot be reached

getRawOrder

public Vector3D[] getRawOrder(int order)
Returns the specified order as an array of wavelength vs. intensity plus error. Note that the image pixel number in dispersion direction (1...NAXIS1) is first converted to physical coordinates using the LTV1 and LTM1_1 keywords. This physical coordinate (in most cases identical to the image pixel number) is then used in the wavelength solution to get to lambda, normally in Angstrom.


parseWavelengthSolution

protected abstract Function[] parseWavelengthSolution(nom.tam.fits.Header h)
                                               throws nom.tam.fits.FitsException
Parses the wavelength soultion from the header.

Throws:
nom.tam.fits.FitsException