C-Munipack 1.2 / Application programming interface / API reference
C-Munipack 1.2 / Application programming interface / API reference
CmpackAllFile | Read-all file. |
cmpack_all_init | Create a new read-all file. |
cmpack_all_load | Load the read-all file. |
cmpack_all_save | Save the read-all file. |
cmpack_all_copy | Copy a file. |
cmpack_all_clear | Clear all data. |
cmpack_all_test | Test if given file seems to be a readall file. |
cmpack_all_test_buffer | Test if the content of the buffer might be a readall file. |
cmpack_all_set_aperture | Set aperture identifier. |
cmpack_all_get_aperture | Get aperture identifier. |
cmpack_all_set_filter | Set filter name. |
cmpack_all_get_filter | Get filter name. |
cmpack_all_set_helcor | Set heliocentric correction flag. |
cmpack_all_get_helcor | Get heliocentric correction flag. |
cmpack_all_nframes | Get number of frames defined in the file. |
cmpack_all_nstars | Get number of stars defined in the file. |
cmpack_all_add_frame | Add new frame to the file. |
cmpack_all_get_jd | Get date of observation. |
cmpack_all_set | Add measurement to the file. |
cmpack_all_get | Get measurement from the file. |
cmpack_all_lightcurve | Make table of differential intrumental magnitudes. |
The read-all file contains simplified result of photometry for a set of frames. Use cmpack-readall object to make a read-all file from a set of photometry files. You can pass it to the cmpack-list object to make an output table.
This file format was inherited from the varfind project and because it not extensible without breaking the compatibility it's planed to be replaced in C-Munipack version 2. Please, do not use this functions in newly written code.
Read-all file.
typedef struct _CmpackAllFile CmpackAllFile
This private structure holds the content of the read-all file.
Create a new read-all file.
CmpackAllFile * cmpack_all_init (void)
This function makes an empty read-all file and returns pointer to it.
pointer a new reference to the file
Load the read-all file.
int cmpack_all_load (CmpackAllFile ** file, const char * filename, CmpackLoadMode flags)
file | [out] | new file context |
filename | [in] | path + file name |
flags | [in] | reserved, use always zero |
zero on success, error code on failure
Save the read-all file.
int cmpack_all_save (CmpackAllFile * file, const char * filename)
file | [in] | file context |
filename | [in] | path + file name |
zero on success, error code on failure
Copy a file.
int cmpack_all_copy (CmpackAllFile * dstfile, const CmpackAllFile * srcfile)
Makes a copy of source file to the destination file. All content of the destination file will be deleted.
dstfile | [in] | destination file context |
srcfile | [in] | source file context |
zero on success, error code on failure
Clear all data.
void cmpack_all_clear (CmpackAllFile * file)
file | [in] | file context |
Test if given file seems to be a readall file.
int cmpack_all_test (const char * filename)
nonzero if the file is a photometry file, zero otherwise
Test if the content of the buffer might be a readall file.
int cmpack_all_test_buffer (const char * buffer, int buflen, int filesize)
The function checks the data in the buffer and returns nonzero, when the buffer contain first 'buflen' bytes from a readall file. This function is used for file format autodetection.
nonzero if the file is a photometry file, zero otherwise
Set aperture identifier.
void cmpack_all_set_aperture (CmpackAllFile * file, int aperture)
file | [in] | file context |
aperture | [in] | aperture identifier |
Get aperture identifier.
int cmpack_all_get_aperture (CmpackAllFile * file)
file | [in] | file context |
aperture identifier or zero on failure
Set filter name.
void cmpack_all_set_filter (CmpackAllFile * file, const char * filter)
file | [in] | file context |
filter | [in] | filter name |
Get filter name.
const char * cmpack_all_get_filter (CmpackAllFile * file)
file | [in] | file context |
pointer to internal memory buffer or NULL of failure
Set heliocentric correction flag.
void cmpack_all_set_helcor (CmpackAllFile * file, int helcor)
Set the flag to false if the julian dates are geocentric, set the flag to true if the julian dates are heliocentric.
file | [in] | file context |
helcor | [in] | heliocentric correction flag |
Get heliocentric correction flag.
int cmpack_all_get_helcor (CmpackAllFile * file)
if the value is nonzero, julian dates are heliocentric, otherwise, they are geocentric.
file | [in] | file context |
value of heliocentric correction flag
Get number of frames defined in the file.
int cmpack_all_nframes (CmpackAllFile * file)
file | [in] | file context |
number of frames or zero if the file is not valid context or if it is empty.
Get number of stars defined in the file.
int cmpack_all_nstars (CmpackAllFile * file)
file | [in] | file context |
number of stars or zero if the file is not valid context or if it is empty.
Add new frame to the file.
int cmpack_all_add_frame (CmpackAllFile * file, double jd)
file | [in] | file context |
jd | [in] | date of observation |
frame index or negative value on failure.
Get date of observation.
double cmpack_all_get_jd (CmpackAllFile * file, int frame)
file | [in] | file context |
frame | [in] | frame index |
julian date of observation or zero on failure
Add measurement to the file.
void cmpack_all_set (CmpackAllFile * file, int frame, int star, int mask, double mag, double err)
file | [in] | file context |
frame | [in] | frame index |
star | [in] | star index |
mask | [in] | bitmask of valid fields |
mag | [in] | magnitude |
err | [in] | magnitude error |
Get measurement from the file.
int cmpack_all_get (CmpackAllFile * file, int frame, int star, int * mask, double * mag, double * err)
file | [in] | file context |
frame | [in] | frame index |
star | [in] | star index |
mask | [out] | bitmask of valid fields |
mag | [out] | magnitude |
err | [out] | magnitude error |
zero on success, error code on failure
Make table of differential intrumental magnitudes.
int cmpack_all_lightcurve (CmpackAllFile * file, int var, int comp, CmpackTable * tab)
file | [in] | file context |
var | [in] | index of variable star |
comp | [in] | index of comparison star |
tab | [out] | light curve |
zero on success, error code on failure