The Solar-Stellar Spectrograph

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



The Ordermap class is a data reduction class to handle tracing of spectral orders on a CCD frame. It inherits ReduceTool. Ordermaps are created from white light sources as the second reduction step following removal of the bias. The Ordermap object employs a three-step method to perform map creation, described in the go documentation below. The method employed works well on CCD data with the characteristically low order drifts common with modern instrumentation.

As with all the reducer objects, Ordermap 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.

Version History

2008 July 23 - Documentation written.


Data Members

float orderWidth

pointer peaks

pointer profFitPts

pointer ordProfFits

pointer ordMap

pointer fit


Method List



get_ord_fit_pts( )

get_order_width( )

get_ordmap( )



init( )

order_centroid( )

order_peak( )





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 Header class. Used by Obj_New; do not invoke directly.


FUNCTION get_ord_fit_pts( )

Return pointer Self.profFitPts

Returns the profFitPts data member, which points to an array specifying the pixel numbers in the dispersion direction that will be used for explicit Gaussian fits to the orders.


FUNCTION get_order_width( )

Return long orderWidth

Returns the orderWidth data member, which specifies the number of pixels across the order profiles that will be used in contructing the Gaussian fits.


FUNCTION get_ordmap( )

Return pointer ordMap

Returns the ordMap data member, which contains the full set of order map locations; it will have dimensions [ M x N ], where M is the number of pixels in the dispersion direction and N is the number of orders.


PRO go

Calls Root::add_history, Ordermap::order_peak, Ordermap::order_centroid

Creates the ordermap using a three-pass procedure.

First, the order peaks are explicitly traced. Approximate locations of the peaks at the central pixel of each order are loaded from a user-specified file in the resource directory. This file must be a plain text file containing (1) the total number of orders N to be extracted from the frame and (2) the pixel number in the cross-dispersion direction of each order to be extracted. The exact peak location of each order will be determined by the object, and an initial rough trace of the order carried out. Central peak locations are stored in the peaks data member, which will have dimension [ N ]. Creation of the text file containing the order peaks is a brief, one-time task required of the investigator that yields a consistent starting point for order map creation.

Once the rough trace is complete, the object makes double-precision Gaussian fits to six evenly spaced locations along the order. The locations of these fit points are stored in the profFitPts data member, which will have dimension [ 6, N ]. The fits themselves are stored in the ordProfFits data member, which will have dimension [ fOrderWidth, 6, N ]. The Gaussian fits provide precise order centroids at each fit location.

Finally, a second-order polynomial is fit to the centroids determined for each order. The polynomial coefficients are stored in the fit data member, which will have dimension [ 3, N ]. The fit is used to calculate the centroid of each pixel for each order, resulting in the final ordermap, which is stored in the ordMap data member, which will have dimension [ M, N ], where M is the number of pixels in the frame in the dispersion direction. The order map is written as a binary file to the solar or stellar resource directory with filename [frame number].ordmap.



keyword bool verbose

Return bool TRUE, FALSE

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_map

argument string path

argument int ordLength

argument int numOrds

Loads order map information from the map from files f.ordmap and f.ordproffits.


FUNCTION order_centroid( )

argument int x

argument int y

Return float[ ] fitInfo

This function assists go by fitting a Gaussian to an order profile and returning both the centroid and the fit values themselves. The dispersion direction is assumed to be in the x direction on the frame, the the initial estimate of the centroid position is given by the arguments. Using this as a starting point, the function (1) creates arrays containing the pixels numbers and the data values across the order profile, (2) creates a Gaussian parameter array with starting estimates of [ amplitude, centroid, FWHM ] of [ data value at orderWidth/2, x, orderWidth/2 ], and (3) fits a Gaussian to the data:

yArrFit = GaussFit( xArr, yArr, gParams, Estimates = gParams, NTerms = 3 ).

The function then returns an array containing the centroid and the fit:

Return, [ gParams[ 1 ], yArrFit ].


FUNCTION order_peak( )

argument int x

argument int y

Return float[ 2 ] [ peakPixel, PeakBkgndRatio ]

This function assists go by finding the pixel in the profile that has the highest value, using starting peak location estimates given by the arguments. It simply searches the profile and returns an array of two floats, the first element containing the pixel with the peak location, and the second containing the ratio of the order peak to the background.


PRO set_order_width

argument int w

Set the orderWidth data member to w.


PRO set_peaks

argument int[ ] peaks

Set the peaks data member to a pointer to the array of integers passed in the argument. This array contains the approximate locations of the peaks of the orders at the central pixel in the dispersion axis, used as a starting point for fitting.


PRO store_map

argument string f

Writes the map to the file f. The file name passed in the argument should include the path. The ordermap itself is written to a file called f.ordmap, and the Gaussian order profiles are written to a file f.ordproffits.


[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.