C-Munipack 1.2 / Application programming interface / API reference
C-Munipack 1.2 / Application programming interface / API reference
CmpackAMassFlags | Correction flags. |
CmpackAirMass | Air-mass coefficient context. |
cmpack_amass_init | Make new air-mass coefficient computation context. |
cmpack_amass_set_console | Attach console to the context. |
cmpack_amass_set_lon | Set observer's longitude. |
cmpack_amass_get_lon | Get observer's longitude. |
cmpack_amass_set_lat | Set observer's latitude. |
cmpack_amass_get_lat | Get observer's latitude. |
cmpack_amass_set_ra | Set object's right ascension. |
cmpack_amass_get_ra | Get object's right ascension. |
cmpack_amass_set_dec | Set object's declination. |
cmpack_amass_get_dec | Get object's declination. |
cmpack_amass | Include air-mass coefficients to a table stored in file. |
cmpack_amass_jd | Compute air-mass coefficient for single julian date. |
Set of functions defined in this module allows user to include the air-mass coefficients to a table stored in the file.
Air-mass coefficient context.
typedef struct _CmpackAirMass CmpackAirMass
This private data structure holds the parameter for air-mass coefficient computation.
Correction flags.
enum CmpackAMassFlags
{
CMPACK_AMASS_DEFAULT = 0,
CMPACK_AMASS_ALTITUDE = (1<<0),
CMPACK_AMASS_NOAIRMASS = (1<<1)
};
CMPACK_AMASS_DEFAULT | Default behavior. |
CMPACK_AMASS_ALTITUDE | Add altitude in degrees to a new column. |
CMPACK_AMASS_NOAIRMASS | Do not add air mass coefficients. |
Make new air-mass coefficient computation context.
CmpackAirMass * cmpack_amass_init (void)
The reference counter is set to one. The caller is responsible to call cmpack_unref() when it is no longer needed.
pointer to context or zero on failure.
Attach console to the context.
void cmpack_amass_set_console (CmpackAirMass * ctx, CmpackConsole * con)
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.
ctx | [in] | air-mass computation context |
con | [in] | console context |
Set observer's longitude.
void cmpack_amass_set_lon (CmpackAirMass * ctx, double lon)
ctx | [in] | air-mass computation context |
lon | [in] | longitude in degrees (E+, W-) |
Get observer's longitude.
int cmpack_amass_get_lon (CmpackAirMass * ctx, double * lon)
ctx | [in] | air-mass computation context |
lon | [out] | longitude in degrees (E+, W-) |
zero on success or error code on failure
Set observer's latitude.
void cmpack_amass_set_lat (CmpackAirMass * ctx, double lat)
ctx | [in] | air-mass computation context |
lat | [in] | latitude in degrees (N+, S-) |
Get observer's latitude.
int cmpack_amass_get_lat (CmpackAirMass * ctx, double * lat)
ctx | [in] | air-mass computation context |
lat | [out] | latitude in degrees (N+, S-) |
zero on success or error code on failure
Set object's right ascension.
void cmpack_amass_set_ra (CmpackAirMass * ctx, double ra)
ctx | [in] | air-mass computation context |
ra | [in] | right ascension in hours |
Get object's right ascension.
int cmpack_amass_get_ra (CmpackAirMass * ctx, double * ra)
ctx | [in] | air-mass computation context |
ra | [out] | right ascension in hours |
zero on success or error code on failure
Set object's declination.
void cmpack_amass_set_dec (CmpackAirMass * ctx, double dec)
ctx | [in] | air-mass computation context |
dec | [in] | declination in degrees |
Get object's declination.
int cmpack_amass_get_dec (CmpackAirMass * ctx, double * dec)
ctx | [in] | air-mass computation context |
dec | [out] | declination in degrees |
zero on success or error code on failure
Include air-mass coefficients to a table stored in file.
int cmpack_amass (CmpackAirMass * ctx, CmpackTable * table, int column, CmpackAMassFlags flags)
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.
ctx | [in] | air-mass computation context |
table | [in] | table |
column | [in] | column containing values of JD |
flags | [in] | see CMPACK_AMASS_xxx constants |
zero on success or error code on failure.
Compute air-mass coefficient for single julian date.
int cmpack_amass_jd (CmpackAirMass * ctx, double jd, double * altitude, double * amass)
ctx | [in] | air-mass computation context |
jd | [in] | julian date of observation |
altitude | [out] | altitude in degrees above horizon |
amass | [out] | air-mass coefficient |
zero on success or error code on failure