X-shooter Pipeline Reference Manual 3.8.15
Macros | Functions
Velocity correction

Macros

#define MIDAS_BUG   0
 

Functions

static void deg2dms (double in_val, double *degs, double *minutes, double *seconds)
 convert degrees -> degrees, minutes, seconds
 
static void deg2hms (double in_val, double *hours, double *minutes, double *seconds)
 convert hours -> degrees, minutes, seconds
 
static void compxy (double inputr[19], char inputc[4], double outputr[4], double utr, double mod_juldat)
 Compute velocity correction.
 
static void barvel (double DJE, double DEQ, double DVELH[4], double DVELB[4])
 compute rectangular heliocentric and barycentric components of the earth's orbital velocity
 
void xsh_baryvel (const cpl_propertylist *raw_header, double *bary_corr, double *helio_corr)
 Compute velocity correction.
 
double xsh_baryvel_correct_value (double value, double correction)
 
double xsh_baryvel_get_correction_factor (cpl_propertylist *keys, xsh_bary_corr_param *bary_corr_param)
 
cpl_error_code xsh_baryvel_adjust_header (cpl_propertylist *header, const char *keyword, double barycorr)
 
cpl_error_code xsh_baryvel_set_specsys (cpl_propertylist *header, xsh_bary_corr_param *bary_param)
 
cpl_error_code xsh_baryvel_correct_header (cpl_propertylist *header, cpl_propertylist *bary_header, xsh_bary_corr_param *bary_param)
 

Detailed Description

Compute barycentric, heliocentric velocity corrections

The code in this source file is a 1-to-1 translation of MIDAS COMPUT/BARYCOR as defined in /prim/general/src/compxy.for (only the necessary parts were translated). The code is not meant to be particularly readable/maintainable. To understand the computation the best starting point is probably P. Stumpff, A&A Suppl. Ser. 41, pp. 1-8 (1980)

Macro Definition Documentation

◆ MIDAS_BUG

#define MIDAS_BUG   0

To get the exact same behaviour as MIDAS this should be define'd to 1. (Fixing it does not seem to make a difference in the resulting numbers but do it anyway)

Definition at line 1166 of file xsh_baryvel.c.

Function Documentation

◆ barvel()

static void barvel ( double  DJE,
double  DEQ,
double  DVELH[4],
double  DVELB[4] 
)
static

compute rectangular heliocentric and barycentric components of the earth's orbital velocity

Parameters
DJEJulian date
DEQ???
DVELH(output) heliocentric velocity
DVELB(output) barycentric velocity

REFERENCE : STUMPFF P. ASTRON. ASTOPHYS. SUPPL. 41,1,1980 MODIFICATION : D. GILLET 1983-9-15

Definition at line 607 of file xsh_baryvel.c.

References N.

Referenced by compxy().

◆ compxy()

static void compxy ( double  inputr[19],
char  inputc[4],
double  outputr[4],
double  utr,
double  mod_juldat 
)
static

Compute velocity correction.

Parameters
inputrinput parameters
inputcinput parameters
outputroutput parameters
utrobservation time (seconds)
mod_juldatobservation modified julian date

INPUTR/R/1/3 date: year,month,day INPUTR/R/4/3 universal time: hour,min,sec INPUTR/R/7/3 EAST longitude of observatory: degree,min,sec !! NOTE INPUTR/R/10/3 latitude of observatory: degree,min,sec INPUTR/R/13/3 right ascension: hour,min,sec INPUTR/R/16/3 declination: degree,min,sec OUTPUTD/D/1/1 barycentric correction to time (days) OUTPUTD/D/2/1 heliocentric correction to time (days) OUTPUTR/R/1/1 barycentric correction to radial velocity (km/s) OUTPUTR/R/2/1 heliocentric correction to radial velocity (km/s) OUTPUTR/R/3/1 diurnal rotation of the earth

Definition at line 273 of file xsh_baryvel.c.

References barvel(), and M_PI.

Referenced by xsh_baryvel().

◆ deg2dms()

static void deg2dms ( double  in_val,
double *  degs,
double *  minutes,
double *  seconds 
)
static

convert degrees -> degrees, minutes, seconds

Parameters
in_valthe value to convert
degs(output) degrees (integer)
minutes(output) minutes (integer)
seconds(output) seconds (fractional)

Definition at line 1155 of file xsh_baryvel.c.

References deg2hms().

Referenced by xsh_baryvel().

◆ deg2hms()

static void deg2hms ( double  in_val,
double *  hours,
double *  minutes,
double *  seconds 
)
static

convert hours -> degrees, minutes, seconds

Parameters
in_valthe value to convert
hours(output) hours (integer). 360 degrees correspond to 24 h
minutes(output) minutes (integer)
seconds(output) seconds (fractional)

360 deg corresponds to 24 h=> 15 deg corresponds to 1 h

Definition at line 1178 of file xsh_baryvel.c.

References xsh_round_double().

Referenced by deg2dms(), and xsh_baryvel().

◆ xsh_baryvel()

void xsh_baryvel ( const cpl_propertylist *  raw_header,
double *  bary_corr,
double *  helio_corr 
)

Compute velocity correction.

Parameters
raw_headerinput FITS header
bary_corr(output) baryocentric correction
helio_corr(output) heliocentric correction

Definition at line 95 of file xsh_baryvel.c.

References check_msg, compxy(), deg2dms(), deg2hms(), xsh_msg_debug, xsh_msg_warning, xsh_pfits_get_dec(), xsh_pfits_get_geolat(), xsh_pfits_get_geolon(), xsh_pfits_get_mjdobs(), xsh_pfits_get_ra(), and xsh_pfits_get_utc().

Referenced by xsh_rectify_orders().

◆ xsh_baryvel_adjust_header()

cpl_error_code xsh_baryvel_adjust_header ( cpl_propertylist *  header,
const char *  keyword,
double  barycorr 
)

Definition at line 1279 of file xsh_baryvel.c.

References xsh_baryvel_correct_value().

Referenced by xsh_baryvel_correct_header().

◆ xsh_baryvel_correct_header()

cpl_error_code xsh_baryvel_correct_header ( cpl_propertylist *  header,
cpl_propertylist *  bary_header,
xsh_bary_corr_param bary_param 
)

◆ xsh_baryvel_correct_value()

double xsh_baryvel_correct_value ( double  value,
double  correction 
)

Definition at line 1250 of file xsh_baryvel.c.

Referenced by xsh_baryvel_adjust_header().

◆ xsh_baryvel_get_correction_factor()

double xsh_baryvel_get_correction_factor ( cpl_propertylist *  keys,
xsh_bary_corr_param bary_corr_param 
)

◆ xsh_baryvel_set_specsys()

cpl_error_code xsh_baryvel_set_specsys ( cpl_propertylist *  header,
xsh_bary_corr_param bary_param 
)