C-Munipack 1.2 / Application programming interface / API reference

Functions for the air-mass coefficient computation.

cmpack_amass.h

Enumerations

CmpackAMassFlagsCorrection flags.

Type definitions

CmpackAirMassAir-mass coefficient context.

Functions

cmpack_amass_initMake new air-mass coefficient computation context.
cmpack_amass_set_consoleAttach console to the context.
cmpack_amass_set_lonSet observer's longitude.
cmpack_amass_get_lonGet observer's longitude.
cmpack_amass_set_latSet observer's latitude.
cmpack_amass_get_latGet observer's latitude.
cmpack_amass_set_raSet object's right ascension.
cmpack_amass_get_raGet object's right ascension.
cmpack_amass_set_decSet object's declination.
cmpack_amass_get_decGet object's declination.
cmpack_amassInclude air-mass coefficients to a table stored in file.
cmpack_amass_jdCompute air-mass coefficient for single julian date.

Description

Set of functions defined in this module allows user to include the air-mass coefficients to a table stored in the file.

CmpackAirMass (data type)

Air-mass coefficient context.

Synopsis

typedef struct _CmpackAirMass CmpackAirMass

Description

This private data structure holds the parameter for air-mass coefficient computation.

CmpackAMassFlags (enumeration)

Correction flags.

Synopsis

enum CmpackAMassFlags
{
     CMPACK_AMASS_DEFAULT = 0,
     CMPACK_AMASS_ALTITUDE = (1<<0),
     CMPACK_AMASS_NOAIRMASS = (1<<1)
};

Enumerators

CMPACK_AMASS_DEFAULTDefault behavior.
CMPACK_AMASS_ALTITUDEAdd altitude in degrees to a new column.
CMPACK_AMASS_NOAIRMASSDo not add air mass coefficients.

cmpack_amass_init (function)

Make new air-mass coefficient computation context.

Synopsis

CmpackAirMass * cmpack_amass_init (void)

Description

The reference counter is set to one. The caller is responsible to call cmpack_unref() when it is no longer needed.

Return value

pointer to context or zero on failure.

cmpack_amass_set_console (function)

Attach console to the context.

Synopsis

void cmpack_amass_set_console (CmpackAirMass * ctx, CmpackConsole * con)

Description

Increment console's reference counter. Only one console can be attached to a single context. If another console is attached, by calling this function dettaches it. Set console to NULL to dettach the current console.

Parameters

ctx[in] air-mass computation context
con[in] console context

cmpack_amass_set_lon (function)

Set observer's longitude.

Synopsis

void cmpack_amass_set_lon (CmpackAirMass * ctx, double lon)

Parameters

ctx[in] air-mass computation context
lon[in] longitude in degrees (E+, W-)

cmpack_amass_get_lon (function)

Get observer's longitude.

Synopsis

int cmpack_amass_get_lon (CmpackAirMass * ctx, double * lon)

Parameters

ctx[in] air-mass computation context
lon[out] longitude in degrees (E+, W-)

Return value

zero on success or error code on failure

cmpack_amass_set_lat (function)

Set observer's latitude.

Synopsis

void cmpack_amass_set_lat (CmpackAirMass * ctx, double lat)

Parameters

ctx[in] air-mass computation context
lat[in] latitude in degrees (N+, S-)

cmpack_amass_get_lat (function)

Get observer's latitude.

Synopsis

int cmpack_amass_get_lat (CmpackAirMass * ctx, double * lat)

Parameters

ctx[in] air-mass computation context
lat[out] latitude in degrees (N+, S-)

Return value

zero on success or error code on failure

cmpack_amass_set_ra (function)

Set object's right ascension.

Synopsis

void cmpack_amass_set_ra (CmpackAirMass * ctx, double ra)

Parameters

ctx[in] air-mass computation context
ra[in] right ascension in hours

cmpack_amass_get_ra (function)

Get object's right ascension.

Synopsis

int cmpack_amass_get_ra (CmpackAirMass * ctx, double * ra)

Parameters

ctx[in] air-mass computation context
ra[out] right ascension in hours

Return value

zero on success or error code on failure

cmpack_amass_set_dec (function)

Set object's declination.

Synopsis

void cmpack_amass_set_dec (CmpackAirMass * ctx, double dec)

Parameters

ctx[in] air-mass computation context
dec[in] declination in degrees

cmpack_amass_get_dec (function)

Get object's declination.

Synopsis

int cmpack_amass_get_dec (CmpackAirMass * ctx, double * dec)

Parameters

ctx[in] air-mass computation context
dec[out] declination in degrees

Return value

zero on success or error code on failure

cmpack_amass (function)

Include air-mass coefficients to a table stored in file.

Synopsis

int cmpack_amass (CmpackAirMass * ctx, CmpackTable * table, int column, CmpackAMassFlags flags)

Description

The function read the input file line by line. All lines which started with value JD value are extended by corresponding air-mass coefficient. Other lines are copied into destination file without change.

Parameters

ctx[in] air-mass computation context
table[in] table
column[in] column containing values of JD
flags[in] see CMPACK_AMASS_xxx constants

Return value

zero on success or error code on failure.

cmpack_amass_jd (function)

Compute air-mass coefficient for single julian date.

Synopsis

int cmpack_amass_jd (CmpackAirMass * ctx, double jd, double * altitude, double * amass)

Parameters

ctx[in] air-mass computation context
jd[in] julian date of observation
altitude[out] altitude in degrees above horizon
amass[out] air-mass coefficient

Return value

zero on success or error code on failure