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

wf Namespace Reference

Additional to wf_t, this namespace wf contains two supplementary functions - getzshift() and the sample progress indicator progress(). Also, all the module constants are defined here. More...


Enumerations

enum  { LEFFTEST = 0, LEFFFIX = 1 }

Functions

double getzshift (double foclen_feed, double foclen_conj)
 Compute altitude shift in generalized mode from parameters of optics. More...

void progress (int stage)
 Sample progress indicator for console. More...

int zgrid_set (double **zgrid, double z0, double zmax, double dz, double dzmin)
 Generate the grid of values given its generation parameters. More...

void make_fft (double *lambda, double *edist, int nedist)
 Compute the FT of SED in units of [1/cm]. More...

double sfunc (double)
 Compute the imaginary part of the Fourier transform of the light SED. More...

double sdum (double f)
 Test-case of S-function: analytical for "quasi-gaussian" SED. More...

double flama (double x)
 Compute the under-integral expression for the weight integration. More...

double weight (double z, double d, double eps1, double eps2, double eps3, double eps4)
 Compute the weight of a given z in a scintillation index. More...

void getspechar (double *lambda, double *edist, int nedist, double *leff, double *lblue, double *lred)
 Compute some characteristic points on the spectrum. More...


Variables

const double MAX_DIAM = 1000
const int MAXNZ = 10000
const double WSCALE = 1E11
const int WVALEN = 15
const double Z0 = 0
const double ZMAX = 30
const double DZ = 0.2
const double DZMIN = 0.04
const double EPSD = 2E-2
const double EPSLEFF = 0.003
const double EPSDZ = 1.5
const int LTEXT = 80
const char FDELIM [] = " \t\n\r"
const double DER0 = 0.0
const double DERNAT = 1.0E31
const double MKM2CM = 1E-4
double diameter
double epsilon1
double epsilon2
double epsilon3
double epsilon4
double lambda0
double * edist_ft
double * edist_freq
double * re_edist_ft
double * im_edist_ft
double * re_edist_ftspln
double * im_edist_ftspln
int edist_ftnn
double altitude


Detailed Description

Additional to wf_t, this namespace wf contains two supplementary functions - getzshift() and the sample progress indicator progress(). Also, all the module constants are defined here.

< these three functions are taken from Numerical Recipes


Enumeration Type Documentation

anonymous enum
 

Flag for calcleff() to fix the computed spectral characteristics after comparison


Function Documentation

double wf::flama double    x
 

Compute the under-integral expression for the weight integration.

Parameters:
x  spatial frequency in inverse meters
Returns:
Under-integral expression (see doc)
Private function used by weight().

In polychromatic treatment, the weight is integrated from:

where the function S(f) is a squared integral of SED of incident light with sine-modulation over wavelengths:

which is, in fact, the squared imaginary part of the Fourier Transform of computed by sfunc().

If SED is a delta-function centered at , then the expression turns into the known monochromatic one:

Here A(f) is a normalized aperture OTF for the given geometry of two annular apertures. For simplicity, the geometry parameters diameter, epsilon1..4 are transferred via the global parameters; function S() is also the global (private) function sfunc().

void wf::getspechar double *    lambda,
double *    edist,
int    nedist,
double *    leff,
double *    lblue,
double *    lred
 

Compute some characteristic points on the spectrum.

Parameters:
lambda  wavelength grid
edist  respective spectral energy distribution
nedist  length of lambda and edist grids
leff  Returned effective wavelength in [units of lambda]
lblue  Returned wavelength of the 50% level of SED at blue side from the SED's peak in [units of lambda]
lred  ditto at the red side from the SED's peak
Function searchs for the maximum of edist[] computing simultaneously the gravity center of edist to be returned as leff. Then, it goes to the left and to the right from the maximum until the level of 50% level of the maximal one is crossed by the curve. The lblue and lred points are computed by the local linear interpolation between the adjacent points.

See also:
wf_leff()

double wf::getzshift double    foclen_feed,
double    foclen_conj
 

Compute altitude shift in generalized mode from parameters of optics.

Parameters:
foclen_feed  Focal length of feeding optics, [mm]
foclen_conj  Focal length of conjugating lens, [mm]
Returns:
zshift Altitude shift in generalized mode, [km]
Function computes the shift from the ratio of squared focal length of feeding optics and focal length of conjugating lens.

Note:
May depend on defocus, to be modified.

void wf::make_fft double *    lambda,
double *    edist,
int    nedist
 

Compute the FT of SED in units of [1/cm].

Parameters:
lambda  wavelength grid
edist  light SED
nedist  w/l grid length
Returns:
0 if Ok, <0 on error
The Fast Fourrier Transform is used to compute the FT.

Before FFT, the SED is normalized by division of each value by the integral of SED. Then, the grid of SED is expanded four times with padding the obtained "tail" with zero values; SED values are divided by their argument wavelengths. Thus, the result of the FFT algorithm (four1() utility from NR is used) has a better sampling in the frequency domain which makes the spline interpolation of the spectrum more robust.

Since the grid of SED starts at non-zero wavelength but immediately near the wavelength of the blue-end of the sensitivity curve of MASS, the FT is made on this origin-shifted spectrum. So, the correction for this shift is needed afterwards (see below).

The units of the wavelengths are converted into [cm], the shift of the SED to its origin and the sampling of the wavelength grid are also expressed in [cm]. This ensures the correct normalization of the resulting FT and a proper correction of the real and imaginary parts of the FT for the made shift of SED to its origin. The latter correction is made in sfunc() analytically.

void wf::progress int    stage
 

Sample progress indicator for console.

Parameters:
stage  Part of the "work-done" (0..100) [percents]
Returns:
void
Example progress indicator, to be replaced with a suitable one

double wf::sdum double    f
 

Test-case of S-function: analytical for "quasi-gaussian" SED.

Parameters:
f  frequency [1/cm]
Returns:
S
Private function which may replace sfunc() in flama() for test-calculations.

In case of the SED being the "quasi-gaussian" function, the S-function is a purely analytical expression:

for the SED which is a normalized -multiplied gaussian with a -dispersion centered at .

The substitution of sdum() instead of sfunc() in flama() may help to test the influence of "non-gaussianity" of the spectrum on the resulting shape of the weight function. The effect, in general, does not exceed a few percents (below 10 in any case) for the A0V star and the MASS response function.

double wf::sfunc double    f
 

Compute the imaginary part of the Fourier transform of the light SED.

Parameters:
f  frequency in [1/cm] units
Returns:
Im(FT(SED))**2
Private function used by flama().

The results of the spline approximation of the real and imaginary parts of FT of -shifted SED are used. Spline coefficients are already computed in make_fft() and put into re_edist_ftspln[] and im_edist_ftspln[] arrays. Re- and Im-parts are taken from splines, corrected for the shift of SED to its origin (made while making FFT) by multiplication by and the square of the imaginary part of the product is returned.

Spline coefficients re/im_edist_ftspln[], computed FT grid re/im_edist_ft[] and the frequency grid edist_freq[] are the global (private) arrays with the length edist_ftnn.

See also:
wf_t::calc()

double wf::weight double    z,
double    d,
double    eps1,
double    eps2,
double    eps3,
double    eps4
 

Compute the weight of a given z in a scintillation index.

Parameters:
z  altitude [km]
d  reference size of an aperture [cm]
eps1  relative outer size of 1st (larger) aperture
eps2  relative inner size of 1st (larger) aperture
eps3  relative outer size of 2nd (smaller) aperture (may be 0)
eps4  relative inner size of 2nd (smaller) aperture (may be 0)
Returns:
Weight value in [m^(1/3)]
Private function used by wf_t::calc().

Function returns the weight for an altitude z in the stellar scintillation. The FT of the incident light SED divided by lambda is assumed to be ready and accessible by the function sfunc(). The diameter of the largest entrance aperture is d and the radii of annular apertures are obtained by its multiplication by eps1..4.

The first (say, larger) aperture has the outer diameter d*eps1 and the inner d*eps2. The second (smaller) aperture has the outer diameter d*eps3 and the inner d*eps4.

If only two of four epsilons differ from each other (non-zero ring width) then the weighting function value for the normal scintillation index is returned for a given aperture (for the larger one - if eps1>eps2>0, eps3=eps4; for the smaller one - if vise versa).

If three or four epsilons are different (eps1>eps2 and eps3>eps4) then the weighting finction value for the differential scintillation index is returned for a pair of apertures with sizes (d*eps1,d*eps2) -- (d*eps3,d*eps4).

The polychromatic expression for the weight is used here, which uses the FT of the light SED to compute the so called S-function sfunc(). This function stays for the part of the under-integral expression of the weight which is computed by flama(). And the latter is already the function which is integrated by the qromo() integrator with the relative convergence criterion. It integrates the weight for the range of spatial frequencies from X1=1e-4 to X2=18.

The weight for the zero altitude is artificially set to zero.

int wf::zgrid_set double **    zgrid,
double    z0,
double    zmax,
double    dz,
double    dzmin
 

Generate the grid of values given its generation parameters.

Parameters:
zgrid  pointer double-type array
z0  starting value
zmax  value to reach
dz  value modifier
dzmin  minimal value step
Returns:
Number of steps in z, -6 if NOT NULL zgrid pointer, -3 if bad params
This function implements the generation of a grid of abscissa values used by wf_t::setzgrid() to generate the altitude grid in weight function structure. See weif.hxx for description of an algorithm given in wf::setzgrid() documentation.

The function counts the steps that will be computed, allocates the double-type array (to which the first parameter must point) and fills in it. The array must be freed after usage (free_dvector()).


Variable Documentation

const double wf::DZ = 0.2
 

Optimal altitude modifier for z-grid creation in proportional mode

const double wf::DZMIN = 0.04
 

Optimal minimal altitude step for z-grid creation in proportional mode

const double wf::EPSD = 2E-2
 

Relative tolerance in aperture sizes to accept the weight file

const double wf::EPSDZ = 1.5
 

Relative tolerance in the altitude grid spacing: maximal acceptable ratio of dz and dzmin in file and in the comparison structure, >1

const double wf::EPSLEFF = 0.003
 

Tolerance level in effective wavelength and SED's 50% points [mkm]. This value corresponds to change of these wavelengths which causes the change of weights not more than 1--2%.

const int wf::LTEXT = 80
 

Length of lines in a header part of the weight file

const int wf::MAXNZ = 10000
 

Maximal number of altitude steps

const double wf::MAX_DIAM = 1000
 

Maximal size of aperture [cm] (arbitrary but plausible)

const double wf::WSCALE = 1E11
 

Writing weights to the file : the Scale factor to divide the values by

const int wf::WVALEN = 15
 

Longest plausible weight value record in a file (normal format: 10.4E)

const double wf::Z0 = 0
 

Usual value for low boundary of altitude range

const double wf::ZMAX = 30
 

Maximal feasible value for upper boundary of altitude range


Generated on Wed Jan 16 00:40:07 2002 for MASS Software by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001