C-Munipack 1.2 / Application programming interface / API reference
C-Munipack 1.2 / Application programming interface / API reference
CmpackCcdFormat | Image format identifiers. |
CmpackImageTrafo | Image transformation bits. |
CmpackCcdFile | CCD frame file context. |
cmpack_ccd_test | Check if the file is a CCD frame. |
cmpack_ccd_test_buffer | Check if the content in buffer is a beginning of a CCD frame. |
cmpack_ccd_new | Open a temporary CCD frame (stored in memory only). |
cmpack_ccd_open | Open a CCD frame file. |
cmpack_ccd_copy | Make a copy of CCD frame. |
cmpack_ccd_get_format | Get file format descriptor. |
cmpack_ccd_get_datetime | Get date and time of observation. |
cmpack_ccd_get_exptime | Get exposure duration. |
cmpack_ccd_get_ccdtemp | Get CCD temperature. |
cmpack_ccd_get_filter | Get optical filter name. |
cmpack_ccd_get_object | Get object's designation. |
cmpack_ccd_get_objra | Get object's right ascension (R.A. |
cmpack_ccd_get_objdec | Get object's declination. |
cmpack_ccd_get_observer | Get observer's name. |
cmpack_ccd_get_observatory | Get observatory name. |
cmpack_ccd_get_obslon | Get observer's longitude. |
cmpack_ccd_get_obslat | Get observer's latitude. |
cmpack_ccd_get_frames | Get number of frames combined together. |
cmpack_ccd_get_param | Parameter enumeration. |
cmpack_ccd_get_str | Get a string value from a file header. |
cmpack_ccd_get_int | Get a integer value from a file header. |
cmpack_ccd_get_bool | Get a logical value from a file header. |
cmpack_ccd_get_double | Get a real value from a file header. |
cmpack_ccd_get_bitpix | Get frame size in pixels. |
cmpack_ccd_get_range | Get image data range. |
cmpack_ccd_get_size | Get frame size in pixels. |
cmpack_ccd_get_image | Get image data (signed char). |
cmpack_ccd_print_info | Print short info about specified CCD-frame. |
cmpack_ccd_print_head | Print full header from ccd frame of any format. |
Set of function defined in this module allows user to read CCD frame files in various formats by means of single interface. Writing files is not supported, use the cfitsio library directly.
CCD frame file context.
typedef struct _CmpackCcdFile CmpackCcdFile
This private structure is used to access CCD frame file
Image format identifiers.
enum CmpackCcdFormat
{
CMPACK_FORMAT_UNKNOWN = 0,
CMPACK_FORMAT_FITS,
CMPACK_FORMAT_SBIG,
CMPACK_FORMAT_OES
};
CMPACK_FORMAT_UNKNOWN | Unknown format. |
CMPACK_FORMAT_FITS | FITS format. |
CMPACK_FORMAT_SBIG | SBIG format. |
CMPACK_FORMAT_OES | OES Astro format. |
Image transformation bits.
enum CmpackImageTrafo
{
CMPACK_FLIP_0 = 0x00,
CMPACK_FLIP_X = 0x01,
CMPACK_FLIP_Y = 0x02,
CMPACK_FLIP_XY = 0x03
};
CMPACK_FLIP_0 | No flipping. |
CMPACK_FLIP_X | Flip horizontally. |
CMPACK_FLIP_Y | Flip vertically. |
CMPACK_FLIP_XY | Rotate image 180 degrees. |
Check if the file is a CCD frame.
int cmpack_ccd_test (const char * filename)
filename | [in] | path + file name |
nonzero if the file is a CCD frame, zero otherwise
Check if the content in buffer is a beginning of a CCD frame.
int cmpack_ccd_test_buffer (const char * buffer, int buflen, int filesize)
buffer | [in] | beginning of the file |
buflen | [in] | number of bytes stored in the buffer |
filesize | [in] | size of file in bytes |
nonzero if the file is a CCD frame, zero otherwise
Open a temporary CCD frame (stored in memory only).
CmpackCcdFile * cmpack_ccd_new (void)
The reference counter is set to one. The caller is responsible to call cmpack_unref() when it is no longer needed.
pointer to new file context or zero on failure
Open a CCD frame file.
int cmpack_ccd_open (CmpackCcdFile ** fc, const char * filename, CmpackOpenMode flags)
fc | [out] | file context |
filename | [in] | path + file name |
flags | [in] | open flags |
zero on success, error code on failure
Make a copy of CCD frame.
int cmpack_ccd_copy (CmpackCcdFile * fc, CmpackCcdFile * from)
fc | [in] | target frame context |
from | [in] | source frame context |
zero on success, error code on failure
Get file format descriptor.
const char * cmpack_ccd_get_format (CmpackCcdFile * fc)
The function returns pointer to the internal memory. You must not free or modify it. The string is valid as far as the context exists.
fc | [in] | file context |
file format descriptor or NULL on failure
Get date and time of observation.
int cmpack_ccd_get_datetime (CmpackCcdFile * fc, CmpackDateTime * dt)
The function reads the date and time at the start of the observation.
fc | [in] | file context |
dt | [out] | date and time (zeros = not available) |
zero on success, error code on failure
Get exposure duration.
int cmpack_ccd_get_exptime (CmpackCcdFile * fc, double * exptime)
The function reads exposure duration in seconds.
fc | [in] | file context |
exptime | [in] | exposure duration |
zero on success, error code on failure
Get CCD temperature.
int cmpack_ccd_get_ccdtemp (CmpackCcdFile * fc, double * ccdtemp)
The function reads the CCD temperature in degrees C.
fc | [in] | file context |
ccdtemp | [in] | CCD temperature |
zero on success, error code on failure
Get optical filter name.
const char * cmpack_ccd_get_filter (CmpackCcdFile * fc)
The function returns pointer to the internal memory. You must not free or modify it. The string is valid as far as the context exists.
fc | [in] | file context |
filter name or NULL on failure
Get object's designation.
const char * cmpack_ccd_get_object (CmpackCcdFile * fc)
The function returns pointer to the internal memory. You must not free or modify it. The string is valid as far as the context exists.
fc | [in] | file context |
pointer to string or NULL on failure
Get object's right ascension (R.A.
const char * cmpack_ccd_get_objra (CmpackCcdFile * fc)
)
The function returns pointer to the internal memory. You must not free or modify it. The string are valid as far as the context exists.
fc | [in] | file context |
pointer to string or NULL on failure
Get object's declination.
const char * cmpack_ccd_get_objdec (CmpackCcdFile * fc)
The function returns pointer to the internal memory. You must not free or modify it. The string is valid as far as the context exists.
fc | [in] | file context |
pointer to string or NULL on failure
Get observer's name.
const char * cmpack_ccd_get_observer (CmpackCcdFile * fc)
The function returns pointer to the internal memory. You must not free or modify it. The string is valid as far as the context exists.
fc | [in] | file context |
pointer to string or NULL on failure
Get observatory name.
const char * cmpack_ccd_get_observatory (CmpackCcdFile * fc)
The function returns pointer to the internal memory. You must not free or modify it. The string is valid as far as the context exists.
fc | [in] | file context |
pointer to string or NULL on failure
Get observer's longitude.
const char * cmpack_ccd_get_obslon (CmpackCcdFile * fc)
The function returns pointer to the internal memory. You must not free or modify it. The string is valid as far as the context exists.
fc | [in] | file context |
pointer to string or NULL on failure
Get observer's latitude.
const char * cmpack_ccd_get_obslat (CmpackCcdFile * fc)
The function returns pointer to the internal memory. You must not free or modify it. The string is valid as far as the context exists.
fc | [in] | file context |
pointer to string or NULL on failure
Get number of frames combined together.
int cmpack_ccd_get_frames (CmpackCcdFile * fc, int * frames)
The function reads the number of frames. If the field is not defined, it returns zero.
fc | [in] | file context |
frames | [in] | number of frames |
zero on success, error code on failure
Parameter enumeration.
int cmpack_ccd_get_param (CmpackCcdFile * fc, int index, char ** key, char ** val, char ** com)
Index of the first parameter is zero. The output parameters receive the pointers to newly allocated memory buffers. The caller is responsible to free it by calling of cmpack_free() function. You can set the value of output parameter to NULL if you do not need it.
fc | [in] | file context |
index | [in] | parameter index (starting by 0) |
key | [out] | parameter name |
val | [out] | parameter value |
com | [out] | comment text |
zero on success, error code on failure
Get a string value from a file header.
int cmpack_ccd_get_str (CmpackCcdFile * fc, const char * key, char ** val)
The val parameter is set to a pointer to a newly allocated memory buffer. The caller is responsible to free it by calling of cmpack_free() function. Keys are case sensitive.
fc | [in] | file context |
key | [in] | parameter name (key) |
val | [out] | parameter value |
zero on success, error code on failure
Get a integer value from a file header.
int cmpack_ccd_get_int (CmpackCcdFile * fc, const char * key, int * val)
fc | [in] | file context |
key | [in] | parameter name (key) |
val | [out] | parameter value |
zero on success, error code on failure
Get a logical value from a file header.
int cmpack_ccd_get_bool (CmpackCcdFile * fc, const char * key, int * val)
fc | [in] | file context |
key | [in] | parameter name (key) |
val | [out] | parameter value |
zero on success, error code on failure
Get a real value from a file header.
int cmpack_ccd_get_double (CmpackCcdFile * fc, const char * key, double * val)
fc | [in] | file context |
key | [in] | parameter name (key) |
val | [out] | parameter value |
zero on success, error code on failure
Get frame size in pixels.
CmpackBitpix cmpack_ccd_get_bitpix (CmpackCcdFile * fc)
fc | [in] | file context |
image data type on success, zero on failure
Get image data range.
int cmpack_ccd_get_range (CmpackCcdFile * fc, double * minvalue, double * maxvalue)
fc | [in] | file context |
minvalue | [in] | minimum pixel value |
maxvalue | [in] | maximum pixel value |
zero on success, error code on failure
Get frame size in pixels.
int cmpack_ccd_get_size (CmpackCcdFile * fc, int * width, int * height)
fc | [in] | file context |
width | [out] | frame width in pixels (0 = not available) |
height | [out] | frame height in pixels (0 = not available) |
zero on success, error code on failure
Get image data (signed char).
int cmpack_ccd_get_image (CmpackCcdFile * fc, CmpackBitpix bitpix, int flipx, int flipy, void * buf)
Image content is copied into given memory buffer.
fc | [in] | file context |
bitpix | [in] | image resolution |
flipx | [in] | horizonal image flipping |
flipy | [in] | vertical image flipping |
buf | [out] | image data |
zero on success, error code on failure
Print short info about specified CCD-frame.
int cmpack_ccd_print_info (CmpackCcdFile * file, CmpackConsole * con)
file | [in] | CCD-frame file path + name |
con | [in] | console context |
zero on success or error code on failure
Print full header from ccd frame of any format.
int cmpack_ccd_print_head (CmpackCcdFile * file, CmpackConsole * con)
file | [in] | CCD-frame file path + name |
con | [in] | console context |
zero on success or error code on failure