#include <stdio.h>
#include "iocount.h"
Go to the source code of this file.
Namespaces | |
namespace | sc |
The module SCIND implements the calculation of stellar scintillation indices observed in a number of apertures (channels). The correction of observed normalized dispersion of the signal involves the background sky level, non-linearity of the detector and the non-Poisson factor (close to 1) which converts the mean of the detector signal into dispersion (the unity for an ideal detector).
As a result, the normal scintillation index is produced which is free from photonic statistics influences and detector imperfections. The differential indices related to the signals covariance of different channels are also computed. The notions of "aperture" and "channel" are identical here. The computed indices can be accessed, read or written to the disk with a number of additional utilities.
This code originates from the program select.c written by V.Kornilov for DASS project. All the functions and constants which deal with scintillation indices are available in the namespace "sc".
Usage:
For the sake of performance and simplicity, the work-arrays which are used for calculations of indices are allocated only once, by the initiation utility sc::init(). Deallocation is devoted to done(). After init(), all the necessary computations are done by sc::compute() a certain number of times, during which the (instant) indices should be saved to disk by sc::writeidx(). If the value of some parameter of sc::init() has changed (or if even nothing has changed), this function may be called again, one does not need to call done() before. The additional space will be reallocated if needed.
The index storages filled by sc::compute() may be accessed with sc::getidx(). The sequential number of a certain index in accessed array may be obtained with sc::ind_seqnum() from the name of an aperture or of the combination of two apertures. Vice versa, the character name of an index which is accessed as i-th in index storage is returned by sc::apername().
After some accumulation of indices (in local index storages), the indices can be averaged by sc::average(). These average indices can already be used for calculations of atmosphere models and parameters (see at::calcint() and atm::calcn2() in the module ATMOS). Also, they may be saved to disk with sc::writeavgidx().
The counter of accumulated indices must be reset by sc::again() before beginning of the next accumulation time and then the cycle of instantaneous index computations with sc::compute() can be restarted. Alternative to sc::again() is sc::init().
After finishing the job, the memory should be cleaned with sc::done().