The allowable arithmetic combinations are :
2. For each wavelength in primary AAR, the closest point is found in reference wavelength array. These closest wavelengths and all other associated data are saved to make arrays containing the same number of elements as in wavelengths of primary AAR
3. Compare the above two arrays in wavelengths and
find all the points satisfying the criteria
ABS(prim_wave - ref_wave) <= epsilon
where epsilon is the maximum separation for matching
the two points. The default value of epsilon is half the distance between
the two farthest adjacent values in wavelength of primary AAR. For 'div'
operation, the fluxes in reference aar with zero values are also ignored.
4. All zero or negative values of standard deviation in primary and reference data are replaced by 1.0
5. For all the points found in step 3, the desired operation is performed as follows:
sub: new_flux = prim_flux - ref_flux
new_stdev
= SQRT( prim_stdev^2 + ref_stdev^2 )
mul: new_flux = prim_flux * ref_flux
new_stdev = SQRT((prim_stdev* ref_flux)^2 + (ref_stdev*prim_flux)^2 )
div: new_flux = prim_flux / ref_flux
new_stdev
= SQRT((prim_stdev* ref_flux)^2 + (ref_stdev*prim_flux/ref_flux^2)^2 )
mean: new_flux = (prim_flux + ref_flux) / 2.0
new_stdev = SQRT( prim_stdev^2 + ref_stdev^2 ) / 2.0