CR2RE Pipeline Reference Manual 1.6.8
Functions
DAR (Differential Atmospheric Refraction)

Functions

hdrl_parameter * hdrl_dar_parameter_create (hdrl_value airmass, hdrl_value parang, hdrl_value posang, hdrl_value temp, hdrl_value rhum, hdrl_value pres, cpl_wcs *wcs)
 Creates DAR parameters object with the values in the header.
 
cpl_error_code hdrl_dar_compute (const hdrl_parameter *params, const hdrl_value lambdaRef, const cpl_vector *lambdaIn, cpl_vector *xShift, cpl_vector *yShift, cpl_vector *xShiftErr, cpl_vector *yShiftErr)
 Correct the pixel coordinates of all pixels of a given pixel table for differential atmospheric refraction (DAR).
 
hdrl_value hdrl_dar_owens_saturation_pressure (hdrl_value hvT)
 Compute the saturation pressure using the Owens calibration.
 
hdrl_value hdrl_dar_filippenko_refractive_index (hdrl_value hvL, hdrl_value hvP, hdrl_value hvT, hdrl_value hvF)
 Compute the refractive index for the given wavelength following Filippenko formulae. This function is called by hdrl_dar_compute().
 

Detailed Description

Function Documentation

◆ hdrl_dar_compute()

cpl_error_code hdrl_dar_compute ( const hdrl_parameter *  params,
const hdrl_value  lambdaRef,
const cpl_vector *  lambdaIn,
cpl_vector *  xShift,
cpl_vector *  yShift,
cpl_vector *  xShiftErr,
cpl_vector *  yShiftErr 
)

Correct the pixel coordinates of all pixels of a given pixel table for differential atmospheric refraction (DAR).

Parameters
paramsIn: h_parameter with all of params. in the observation
lambdaRefIn: Reference wavelength (in Angstroms)
lambdaInIn: One lambda for each plane (in Angstroms)
xShiftOut: Correction for each plane in x-axis (pixels)
yShiftOut: Correction for each plane in y-axis (pixels)
xShiftErrOut: Error in correction for each plane in x-axis (pix)
yShiftErrOut: Error in correction for each plane in x-axis (pix)
Returns
CPL_ERROR_NONE on success another CPL error code on failure
Remarks
The resulting correction can be directly applied to the pixel table.

Loop that compute the DAR offset for the wavelength difference with respect to the reference wavelength, and storage the shift in the coordinates, taking into account the instrument rotation angle on the sky and the parallactic angle at the time of the observations.

The algorithm from Filippenko (1982, PASP, 94, 715). This only uses the formula from Owens which converts relative humidity to water vapor pressure.

Note
The calculation is performed by calling the top-level function hdrl_dar_compute() and the parameters passed to this function can be created by calling hdrl_dar_parameter_create().
This module contains routines to calculate the refractive index of air. See here for the formulae used.

Definition at line 218 of file hdrl_dar.c.

References hdrl_dar_filippenko_refractive_index(), and hdrl_dar_owens_saturation_pressure().

◆ hdrl_dar_filippenko_refractive_index()

hdrl_value hdrl_dar_filippenko_refractive_index ( hdrl_value  hvL,
hdrl_value  hvP,
hdrl_value  hvT,
hdrl_value  hvF 
)

Compute the refractive index for the given wavelength following Filippenko formulae. This function is called by hdrl_dar_compute().

Parameters
hvLthe wavelength (in um) with it error associated
hvPatmospheric pressure (in mmHg) with it error associated
hvTtemperature (in degrees Celsius) with it error associated
hvFwater vapor pressure (in mmHg) with it error associated
Returns
The refractive index with it error propagation

At sea level (P=760 mm Hg, T = 15 $^oC$) the refractive index of dry air is given by (Edlen 1953; Coleman, Bozman, and Meggers 1960):

\[
(n( \lambda )_{15,760}-1)10^6 = 64.328 + \frac{29498.1}{146-(1/ \lambda )^2} +\frac{255.4}{41-(1/ \lambda )^2}
\]

where $\lambda$ is the wavelength of light in vacue (microns). Since observatories are usually located at high altitudes, the index of refraction must be corrected for the lower ambient temperature and pressure (Barrell 1951):

\[
(n(\lambda)_{T,P} -1) = (n(\lambda)_{15,760} - 1) \cdot
\frac{P[1+(1.049-0.0157\ T) 10^{-6}\ P]}{720.883 (1+0.003661\ T)}
\]

In addition, the presence of water vapor in the atmosphere reduces $(n-1)10^6$ by:

\[
\frac{0.0624-0.000680/\lambda^2}{1 + 0.003661\ T} f
\]

here $f$ is the water vapor pressure in mm of Hg and T is the air temperature in $^oC$ (Barrell 1951).

\[
f = 0.75006158 \cdot s_p \cdot h
\]

where $s_p$ is the saturation pressure with Owens calibration and h is the fraction of humidity in [%].

Definition at line 426 of file hdrl_dar.c.

Referenced by hdrl_dar_compute().

◆ hdrl_dar_owens_saturation_pressure()

hdrl_value hdrl_dar_owens_saturation_pressure ( hdrl_value  hvT)

Compute the saturation pressure using the Owens calibration.

Parameters
hvTtemperature (in Kelvin) with it error associated (in Celsius)
Returns
the saturation pressure for the given temperature with it error propagation

\[
s_p = -10474 +116.43\ T -0.43284\ T^2 +0.00053840\ T^3
\]

where T is the temperature.

Note
This function is used for the Filippenko formulae.

Definition at line 380 of file hdrl_dar.c.

Referenced by hdrl_dar_compute().

◆ hdrl_dar_parameter_create()

hdrl_parameter * hdrl_dar_parameter_create ( hdrl_value  airmass,
hdrl_value  parang,
hdrl_value  posang,
hdrl_value  temp,
hdrl_value  rhum,
hdrl_value  pres,
cpl_wcs *  wcs 
)

Creates DAR parameters object with the values in the header.

Parameters
airmassAir mass
parangParallactic angle during exposure
posangPosition angle on the sky from the angles we have
tempTemperature [Celsius]
rhumRelative humidity [%]
presPressure [mbar]
wcsWorld Coordinate system (WCS) in degrees(CDi_j)
Returns
The dar parameters object. It needs to be deallocated with hdrl_parameter_delete() or _destroy()
Note
References:
  • based on public domain code of the IDL astro-lib procedure getrot.pro
  • See getrot for more info.

Definition at line 159 of file hdrl_dar.c.

References hdrl_parameter_delete().