Processing math: 25%

SCULIB_FIT_SKYDIP

Fit the skydip data

Description:

This routine fits a sub-instrument’s measurements of the sky brightness at a range of airmasses to obtain the sky opacity, ETAtel and ‘b’ parameters. The fit is to the function:-
J meas = (1 - η

tel) J_tel + η

tel J_atm - b η

tel J_atm e^-Aτ, (48)

Jtel is known and Jatm is related to Jamb by:-

J atm = J_amb 040A k exp hh 2 exp Akh2 exp hh 2 1 1 h h 1 dh, (49)

where h2 = scale height of absorption ( = 2km), h1 = coefficient to give 6.5K/km temperature drop in absorber, A = airmass, k = extinction.

which relation has been fudged by Bill Duncan to:-

J atm = J_amb X_g 1 exp Akh2 , (50) with X

ghavingtheform

X

g = 1 + h_2 T_lapse T

amb exp Aτ X

gconst(51) with

h1 = 2, h2 = -6.5 (note this h2 is defined differently to that in the previous equation), X

gconst = 3.669383

See ‘Calibration of mm and sub-mm Photometers by Skydipping’, W.D.Duncan preprint and ‘Inversion of Sky Dips’, SCU/WDD/31.1/1093 for further details.

The fit can be made with ETAtel and/or b either fixed or varying. To allow one of these parameters to vary it should be input to the routine with a value below zero. If the input value is greater than zero then the routine will fix it at that for the fit.

Invocation

CALL SCULIB_FIT_SKYDIP (CVAR, N_MEASUREMENTS, AIRMASS, J_MEASURED, J_VARIANCE, SUB_WAVELENGTH, SUB_INSTRUMENT, SUB_FILTER, T_TEL, T_AMB, ETA_TEL_IN, B_IN, ETA_TEL_FIT, B_FIT, TAUZ_FIT, REXISQ, TAU_ERROR, ETA_ERROR, B_ERROR, RESIDUAL, SIGMA, STATUS)

Arguments

CVAR = LOGICAL (Given)
flag to govern whether to use a fixed variance (true) or the actual variance. The fixed variance is the mean of the actual variances.
N_MEASUREMENTS = INTEGER (Given)
the number of SKYDIP measurements
AIRMASS (N_MEASUREMENTS) = REAL (Given)
the airmasses at which the measurements were made
DATA (N_MEASUREMENTS) = REAL (Given)
the measured sky brightness temperatures
VARIANCE (N_MEASUREMENTS) = REAL (Given)
the variance on DATA
SUB_WAVELENGTH = REAL (Given)
the wavelength of the measurements
SUB_INSTRUMENT = CHARACTER() (Given)
the name of the sub-instrument used
SUB_FILTER = CHARACTER() (Given)
the name of the filter used
T_TEL = REAL (Given)
the telescope temperature (K)
T_AMB = REAL (Given)
the ambient temperature (K)
ETA_TEL_IN = REAL (Given)
if >= 0 then this will the ETAtel assumed in the fit. if < 0 then ETAtel will be allowed to vary in the fit.
B_IN = REAL (Given)
if >=0 then this value of b will be assumed in the fit. if < 0 then b will be allowed to vary in the fit.
ETA_TEL_FIT = REAL (Returned)
the result for ETAtel
B_FIT = REAL (Returned)
the result for b
TAUZ_FIT = REAL (Returned)
the fitted result for tauz
REXISQ = REAL (Returned)
the reduced chi square of the fit
TAU_ERROR = REAL (Returned)
error in the tau
ETA_ERROR = REAL (Returned)
error in eta_tel
B_ERROR = REAL (Returned)
error in B
RESIDUAL = DOUBLE (Returned)
Absolute difference between the model and the fit.
SIGMA = DOUBLE (Returned)
standard deviation of the difference between the model and the fit.
STATUS = INTEGER (Given and returned)
Global status