The Solar-Stellar Spectrograph

[ Home | About | Tech Info & Data | Publications | References ]      [ Site by Jeffrey Hall | Research funded by NSF ]

ARTICLE

Flat

The Flat class is a data reduction class to handle flat fielding of CCD frames. It inherits ReduceTool. It can operate in either of two modes, depending on the value of the makeFlat data member. If makeFlat is TRUE, the class assumes it is working with a white light spectrum frame, and it will create a normalzed flat field spectrum to be used to remove pixel-to-pixel gain variations. If makeFlat is FALSE, the class assumes it is working with something other than a white light spectrum, and it will apply a flat field spectrum to the frame to remove gain variations. As with all the reducer objects, Flat implements methods that set up the various relevant quantities, and a go method that does the actual work. The code samples presented in the documentation below presuppose familiarity with IDL programming and syntax.

Flat requires resource files to function properly.

Version History

2008 July 24 - Documentation written.

 

Data Members

bool makeFlat

float orderWidth

pointer fitPts

pointer ordMap

pointer fitData

pointer flatFit

pointer flatSpec

 

Method List

cleanup

define

get_fit_pts( )

get_flat_fit( )

get_flat_spectrum( )

go

init( )

load_fit_pts

load_flat_fit

load_flat_spectrum

load_ordermap

set_fit_pts

set_makeflat_mode

set_order_width

store_flat_fit

store_flat_spectrum

 

Method Descriptions

 

PRO cleanup

Calls ReduceTool::cleanup

Destructor. Calls ReduceTool::cleanup and then frees its own data member pointers. Never call this procedure directly; it is invoked by IDL's Obj_Destroy function.

 

PRO define

Structure definition. Specifies the contents of the IDL structure instantiated by the Flat class. Used by Obj_New; do not invoke directly.

 

FUNCTION get_fit_pts

Return pointer fitPts

Returns a the object's fitPts data member, which is a pointer to an array of int specifying the pixel locations along the dispersion direction to be used for cubic spline fitting of the echelle blaze during flat field spectrum creation.

 

FUNCTION get_flat_fit

Return pointer flatFit

Returns a the object's flatFit data member, which is a pointer to an array containing cubic spline fits to the order profiles. For SSS data, this is a float array of dimensions [512, 20].

 

FUNCTION get_flat_spectrum

Return pointer flatSpec

Returns a the object's flatSpec data member, which is a pointer to an array containing the flat field spectrum (i.e., the extracted data from the white light frame). Unlike the flatFit array, which gives the general smooth shape of the echelle blaze for each order, this data member contains the actual white light variations. For SSS data, this is a float array of dimensions [512, 20].

 

PRO go

Performs flat field operations in several steps.

First, the routine defines the order apertures using the order map and the profile width specified by the orderWidth data members. Fractional pixels at aperture edges are used.

If makeFlat is TRUE: An existing spectrum of the flat field frame (produced by a Spectrum object) is used. A cubic spline is fit to each order of the spectrum. First, the mean data value in the flat field spectrum in the five pixels around each fit point is calculated and stored in the fitData data member, and then a cubic spline fit is calculated and stored in the flatFit data member. The flat field spectrum is then divided by the spline to normalize it to unity, while preserving the gain variations along the dispersion axis. This produces, for each order, a map of the gain variations relative to 1.0 that can be used for flat field division.

If makeFlat is FALSE: flatSpec is divide by flatFit. Each pixel j across the profile at a given pixel i along the dispersion direction is divided by the single value of the flat field spectrum, and that the flat field method adopted here works well.

 

FUNCTION init

keyword bool verbose

Return bool TRUE

Constructor. If the keyword verbose is set, the verbose data member (inherited from Tool) is set to TRUE. Never call this function directly; it is invoked by IDL's Obj_New function.

 

PRO load_fit_pts

argument string f

Loads a user-defined array of spline fitting points into the object's fitPts data member. The array must reside in a file f in the res directory. The first line contains an integer M giving the number of points per order to be used for fitting. The second line contains an integer N giving the number of orders. The remaining N lines contain M integers per line giving the pixel numbers to be used for the spline fits. This method reads the file and stores the fit point array in fitPts.

 

PRO load_flat_fit

argument string f

argument int orderLength

argument int numberOfOrders

Loads the contents of the file f.flatfit into the object's flatFit data member. This is an array of floats containing the cubic spline fits to the orders. For SSS data, it has dimensions [512,20].

 

PRO load_flat_spectrum

argument string f

argument int orderLength

argument int numberOfOrders

Loads the contents of the file f.spec into the object's flatSpec data member. This is an array of floats containing the extracted flat field spectrum. For SSS data, it has dimensions [512,20].

 

PRO load_ordermap

argument string f

argument int orderLength

argument int numberOfOrders

Loads the contents of the file f.ordmap into the object's ordMap data member. This is an array of floats containing the centroids of each pixel in each order, the principal output of the Ordermap class. For SSS data, it has dimensions [512,20].

 

PRO set_fit_pts

argument pointer pts

Sets the value of the object's fitPts data member. The argument pts should point to an array containing the desired set of spline fitting points.

 

PRO set_makeflat_mode

argument bool mode

Sets the value of the object's makeFlat data member. The argument mode should be TRUE to make the class create a flat from a white light spectrum, or FALSE to apply a flat field spectrum to an object frame.

 

PRO store_flat_fit

argument string f

Writes the flatFit data member to the file f.flatfit.

 

PRO store_flat_spectrum

argument string f

Writes the flatSpec data member to the file f.spec.

 


[Back to contents]

Supported by grants from the National Science Foundation.
[ Back to my home page | Email me: jch [at] lowell [dot] edu ]
The SSS is publicly funded. Unless explicitly noted otherwise, everything on this site is in the public domain.
If you use or quote our results or images, we appreciate an acknowledgment.
This site is best viewed with Mozilla Firefox.