C-Munipack 1.2 / Application programming interface / API reference

Functions for the dark-frame correction.

cmpack_dark.h

Type definitions

CmpackDarkCorrDark-frame correction context.

Functions

cmpack_dark_initMake new dark-frame correction context.
cmpack_dark_set_consoleAttach console to the context.
cmpack_dark_set_scalingEnable or disable dark-frame scaling.
cmpack_dark_get_scalingGet status of dark-frame scaling.
cmpack_dark_set_borderSet image border size.
cmpack_dark_get_borderGet image flip flags.
cmpack_dark_rdarkLoad dark-frame from a file.
cmpack_darkExecute dark-frame correction on a file.
cmpack_dark_exExecute dark-frame correction on a file.

Description

Set of functions defined in this module allows user to apply dark-frame correction to CCD frames.

CmpackDarkCorr (data type)

Dark-frame correction context.

Synopsis

typedef struct _CmpackDarkCorr CmpackDarkCorr

Description

This private data structure holds the parameter for dark-frame correction as well as the dark frame itself.

cmpack_dark_init (function)

Make new dark-frame correction context.

Synopsis

CmpackDarkCorr * cmpack_dark_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_dark_set_console (function)

Attach console to the context.

Synopsis

void cmpack_dark_set_console (CmpackDarkCorr * 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_dark_set_scaling (function)

Enable or disable dark-frame scaling.

Synopsis

void cmpack_dark_set_scaling (CmpackDarkCorr * ctx, int scaling)

Parameters

ctx[in] air-mass computation context
scaling[in] 0 = disable, 1 = enable feature

cmpack_dark_get_scaling (function)

Get status of dark-frame scaling.

Synopsis

int cmpack_dark_get_scaling (CmpackDarkCorr * ctx)

Parameters

ctx[in] air-mass computation context

Return value

zero = disabled, nonzero = enabled

cmpack_dark_set_border (function)

Set image border size.

Synopsis

void cmpack_dark_set_border (CmpackDarkCorr * file, const CmpackBorder * border)

Description

If you set the border to nonzero size, the conversion function will set the pixels which belongs to the border area to zero. You can use this feature to clear an unusable part of a frame.

Parameters

file[in] conversion context
border[in] border size in pixels

cmpack_dark_get_border (function)

Get image flip flags.

Synopsis

void cmpack_dark_get_border (CmpackDarkCorr * file, CmpackBorder * border)

Parameters

file[in] conversion context
border[out] border size in pixels

cmpack_dark_rdark (function)

Load dark-frame from a file.

Synopsis

int cmpack_dark_rdark (CmpackDarkCorr * ctx, CmpackCcdFile * darkfile)

Description

The function reads the correction frame from the given frame context. The internal copy of the image data is made, no reference to the frame is held, so you can free it when this function has returned.

Parameters

ctx[in] dark-frame correction context
darkfile[in] dark frame context

Return value

zero on success or error code on failure

cmpack_dark (function)

Execute dark-frame correction on a file.

Synopsis

int cmpack_dark (CmpackDarkCorr * ctx, CmpackCcdFile * file)

Description

The function reads image data from the context, performs the dark correction and stores the output image to the same context.

Parameters

ctx[in] dark-frame correction context
file[inout] frame context

Return value

zero on success or error code on failure

cmpack_dark_ex (function)

Execute dark-frame correction on a file.

Synopsis

int cmpack_dark_ex (CmpackDarkCorr * ctx, CmpackCcdFile * infile, CmpackCcdFile * outfile)

Description

The function reads image data from the infile context, performs the dark correction and stores the output image to the outfile context.

Parameters

ctx[in] dark-frame correction context
infile[in] input frame context
outfile[in] output frame context

Return value

zero on success or error code on failure