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.
2008 July 23 - Documentation written.
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.
Structure definition. Specifies the contents of the IDL structure instantiated by the Header class. Used by Obj_New; do not invoke directly.
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.
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.
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.
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.
argument string path
argument int ordLength
argument int numOrds
Loads order map information from the map from files f.ordmap and f.ordproffits.
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 ].
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.
argument int w
Set the orderWidth data member to w.
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.
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.