#include <scan.hxx>
Public Types | |
enum | direct { BACK = -1, MERG = 0, FORW = +1 } |
Public Methods | |
void | set (int ncnt=0, double nonlin=-1) |
Initialize the scan arrays before accumulation. More... | |
scan_t (int ncnt=0, double nonlin=-1) | |
Constructor: set the private fields zero and call set(). More... | |
~scan_t () | |
Destructor: deallocate the memory reserved for storages. More... | |
void | accum (const count_t *scan, direct which) |
Add the current scan to the respective scan storage. More... | |
void | merge () |
Merge back- and forward scans. More... | |
double * | get (direct which=MERG) const |
Return the pointer to the needed scan. More... | |
void | center (double *x1, double *x2, direct which=MERG, bool fixcenter=false) |
Locate the coordinates where the star crosses the edges of a centering triangle aperture. More... | |
double | xshift () const |
Return the shift of the star relative to the center of the field of view in scanning direction. More... | |
double | yshift () const |
Return the shift of the star relative to the center of the field of view in radial direction. More... | |
double | sharpness (int defrange, direct which=MERG) const |
Compute the sharpness of the scan. More... | |
Static Public Methods | |
void | loadconst (double scale, double a=0, double b=-99, double x1c=0, double x2c=0) |
Assign the static calibration parameters for calculation of the star shifts. More... |
For each device channel where the scanning has to be done the object of the class scan_t has to be declared. The constructor by default which is involved in declaration of the array of scan_t allocates no space. So, before accumulation of scans, the function set() is called for scan of each channel.
Each time the new scan is received, the scan accumulation accum() is called with the proper value of the flag scan_t::direct of scanning direction. After finishing the scanning, the utility merge() should be called to obtain the resulting merged scan where forward and backward scans are coadded. The utility get() returns the pointer to one of the scans (forward, backward or merged). The "scientific" functions center() and sharpness() extract from the selected accumulated scan (again 3 kinds) the information on the position of the star in the centering triangle aperture and on the focus displacement, respectively. The results of center() are also stored internally and used to compute the calibrated shifts of the star xshift() and yshift(). For latter functions, the calibration constants can be loaded with loadconst().
Before the new accumulation of scan, the function set() has to be called. If nothing has changed (dimention of scan or non-linearity), the cleaning of the storages is only done.
The scans are made of individual counts from the MASS device channels and represent the count_t-type arrays. The latter type definition is borrowed from the module SCIND.
|
which -flag to access forward scan |
|
Constructor: set the private fields zero and call set().
The default constructor is realized with default parameters passed to set(). Thus, for array of scan_t, it is obligatory to use set() after declaration; for a single scan_t instance, the constructor with proper length and non-linearity can be called immediately before accum(). If default (invalid) non-linearity is supplied, it is set zero in constructor. |
|
Destructor: deallocate the memory reserved for storages.
This function releases the memory which is allocated for forward, back and merged scans by set() with zero parameter. |
|
Add the current scan to the respective scan storage.
|
|
Locate the coordinates where the star crosses the edges of a centering triangle aperture.
The method is based on a linear interpolation of points on the middles of slopes of the curve. The points are taken which surround the middle of slopes. "Middle" is considered as a mean of background level (some k-th smallest count in a scan) and the plateau level (median of counts which have intensity more than 75% of the highest one. Under average conditions (seeing and wandering of images = 1'', scintillations of 10%, see testing main() of the module) the precision of centering is about 0.1 microsteps.
|
|
Return the pointer to the needed scan.
|
|
Assign the static calibration parameters for calculation of the star shifts.
|
|
Merge back- and forward scans.
Function coadds the forward and backward scans into the merged scan.
|
|
Initialize the scan arrays before accumulation.
If ncnt is zero, the storages are deallocated and no allocation is done (the call from destructor is done like this). This function should be called, obviously, before the first scanning pass is finished. Default non-linearity is made invalid to leave it unchanged.
|
|
Compute the sharpness of the scan.
In current implementation, this characteristic is the ratio of the mean square of the signal to the squared mean of the signal. The signal is taken from the scan at the positions closer than defrange to the position of scan with a highest count. |
|
Return the shift of the star relative to the center of the field of view in scanning direction.
The function uses the x1 and x2 values computed and stored in private members by center() to derive the shift of the star from the center of the field of view. ![]() Scheme of MASS scanning for centering the star As one can see from the picture, the difference of x1 and x2 is easily converted into the Y-shift, and the sum of them - into the X-shift via the calibration parameters A and B (see loadconst()). |
|
Return the shift of the star relative to the center of the field of view in radial direction.
|