The Bias class is a data reduction class to handle removal of the electronic bias from a CCD frame. It inherits ReduceTool. It allows bias removal in two ways: (1) subtraction of a scalar from each pixel of the CCD frame or (2) pixel-by-pixel subtraction of a 2D bias frame from the object frame. The class performs pixel-by-pixel subtraction if the bias2D data member points to a valid heap variable; otherwise it performs scalar subtraction. As with all the reducer objects, Bias 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 22 - Documentation written.
argument pointer data
Sets the object's bias2D data member to the pointer passed as the argument. This argument should be a pointer to a valid heap variable containing the 2D bias frame to be subtracted from the data frame. If a bias frame is already attached, a warning is sent to the event list. To change the bias frame to be used, remove the present reference using detach_2dbias.
Calling this function and then invoking the object's go method will cause 2D bias subtraction to be performed on the data frame, since the bias2D data member will point to a valid variable. To switch back to scalar debiasing, detach any attached 2D bias first.
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 Bias class. Used by Obj_New; do not invoke directly.
Sets the object's bias2D data member to Ptr_New( ) (i.e., a null pointer that will return FALSE if tested with Ptr_Valid( ). It does not free the pointer, since this would destroy the heap variablem leaving it inaccessible to other objects if needed. It sends an advisory to the event list if the pointer is already invalid.
Return variant stats
Returns the object's stats data member. Note that the stats themselves are returned, not the pointer.
Performs debiasing. If the data data member (of superclass Tool) is invalid, then no data are attached to the tool and debiasing cannot proceed. An error is sent to the log in this case. Otherwise, debiasing proceeds in the following steps.
1. The bias statistics are cleared.
2. If a valid 2D bias is attached to the Bias object, a pixel-by-pixel bias subtraction is performed. The simple operation is
*Self.data -= *Self.bias2D.
Then the stats data member is set to contain the result of IDL's Moment function called on bias2D, plus information about the distribution of data values in the bias frame:
mm = Moment( *Self.bias2D )
Self.stats = Ptr_New( [ mm, Min( *Self.bias2D ), Histogram( *Self.bias2D ) ] )
3. If a valid 2D bias is not attached to the Bias object, a scalar bias subtraction is performed. The method calculates the mean bias level in an overscan region determined by the dimensions of the active rectangle attached to the Tool. This rectangle is assumed to be the zeroth element of the ObArray Tool.rectList. We have
*Self.data -= mm,
where mm is again the output of Moment. In this case, the stats are set as follows:
Self.stats = Ptr_New( [ mm, Min( overscan ), Histogram( overscan ) ] )
To do a scalar bias subtraction, a valid rectangle must first be defined with set_overscan.
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. It then adds a single, empty active rectangle to the tool. It does not initialize its stats data member, since this variable will be set and populated by go. Never call this function directly; it is invoked by IDL's Obj_New function.
keyword int left
keyword int bottom
keyword int right
keyword int top
Sets the zeroth active rectangle in the object's rectangle list to be defined by the coordinates passed in the arguments.