Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members  

scan_t Class Reference

#include <scan.hxx>

List of all members.

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


Detailed Description

Usage:

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.


Member Enumeration Documentation

enum scan_t::direct
 

which -flag to access forward scan


Constructor & Destructor Documentation

scan_t::scan_t int    ncnt = 0,
double    nonlin = -1
 

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.

scan_t::~scan_t   [inline]
 

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.


Member Function Documentation

void scan_t::accum const count_t   scan,
direct    which
 

Add the current scan to the respective scan storage.

Parameters:
scan  pointer to the count_t -type scan array
which  Direction flag: FORW: forward, BACK: backward
Function adds the given array to the forward and backward scans, latter with inversed sequence of counts. Thus, forward and backward scans must be identical (see get()) if the measurement consitions are stable and no noise is taken into account. The correction for non-linearity is done with the non-linearity constant loaded in set().

void scan_t::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.

Parameters:
x1  Resulting coordinate of the crossing point of the left triangle edge [microstep, i.e. pixel of scan]
x2  Resulting coordinate of the crossing point of the right triangle edge [microstep]
which  BACK for backward scan , FORW for forward scan, MERG for merged scan
fixcenter  Device adjustment mode: if true, then the resulting x1 and x2 are treated as for the non-shifted star and saved in scan_t::x1c and scan_t::x2c. See loadconst().
Function searches for the positions on the scan where the scan counts cross the 50%-level of the light variation range: the points where the star appears from and disappears behind the edges of the triangle aperture. "Appearance" stays for the result x1 and has a smaller index in (forward and merged) scan than x2 (see xshift() for the star shift calibration issue based on x1 and x2).

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.

Note:
If one of the crossing points is not covered by the aperture edge while scanning, the respective coordinate is returned as zero.
Attention:
If the error is set in the system on enter (see nrerror()), the zero results are returned in x1 and x2.

double* scan_t::get direct    which = MERG const
 

Return the pointer to the needed scan.

Parameters:
which  BACK for backward scan , FORW for forward scan, MERG for merged scan
Returns:
pointer to the scan array (not to be deleted!)

void scan_t::loadconst double    scale,
double    a = 0,
double    b = -99,
double    x1c = 0,
double    x2c = 0
[static]
 

Assign the static calibration parameters for calculation of the star shifts.

Parameters:
scale  Focal scale near the center [arcsec/microstep]
a  sum of tangent of angles between the edges of the triangle diaphragm and the direction to the axis of the aperture wheel
b  semidifference of tangent of angles between the edges of the triangle diaphragm and the direction to the axis of the aperture wheel
x1c  scan coordinate of appearance of the non-shifted star
x2c  scan coordinate of disappearance of the non-shifted star
The function assignes the parameters to the class variables to be used in subsequent calculations of the star displacement with xshift() and yshift(). Only the non-defaulted parameters are assigned. Defaults are selected to have no sense.

Note:
These calibration parameters serve for all instances of the type scan_t because they are static. E.g. for many channels of the device, the single call to scan_t::loadconst() has to be done.

void scan_t::merge  
 

Merge back- and forward scans.

Function coadds the forward and backward scans into the merged scan.

See also:
accum()

void scan_t::set int    ncnt = 0,
double    nonlin = -1
 

Initialize the scan arrays before accumulation.

Parameters:
ncnt  Number of counts in a scan (forward or backward)
nonlin  non-linearity parameter for the detector (i.e. the deadtime of detector divided by the microexposure time, e.g.: nonlin = 24ns / 4ms = 6.0e-6)
The object contains the arrays fscan, bscan where the forward and backward scans are accumulated, and mscan to coadd them afterwards in a merged scan. These vectors have the logical length ncnt. If their physical length is smaller, they are reallocated with a new length ncnt.

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.

See also:
accum()

double scan_t::sharpness int    defrange,
direct    which = MERG
const
 

Compute the sharpness of the scan.

Parameters:
defrange  Radius of sharpness calculation around the scan peak [microsteps]
which  BACK for backward scan , FORW for forward scan, MERG for merged scan
Returns:
sharpness
Function computes some integral characteristic of the scan which depends significantly on the defocussing of the system.

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.

double scan_t::xshift   const [inline]
 

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.

scan.jpg

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()).

double scan_t::yshift   const [inline]
 

Return the shift of the star relative to the center of the field of view in radial direction.

See also:
xshift()


The documentation for this class was generated from the following file:
Generated on Wed Jan 16 00:40:06 2002 for MASS Software by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001