C-Munipack 1.2 / Application programming interface / API reference

Functions for the making master-flat correction frame.

cmpack_mflat.h

Type definitions

CmpackMasterFlatMaster-flat output frame context.

Functions

cmpack_mflat_initMake new context for the Master-flat tool.
cmpack_mflat_set_consoleAttach console to the context.
cmpack_mflat_set_bitpixSet output data format.
cmpack_mflat_get_bitpixGet output data format.
cmpack_mflat_set_levelSet average output level.
cmpack_mflat_get_levelGet average output level.
cmpack_mflat_set_borderSet image border size.
cmpack_mflat_get_borderGet image flip flags.
cmpack_mflat_openOpen output file.
cmpack_mflat_readAdd a frame to the accumulation buffer.
cmpack_mflat_closeMake master-flat frame and save it to the file.

Description

Set of functions defined in this module allows user to make a master-flat frame from a set of CCD frames.

CmpackMasterFlat (data type)

Master-flat output frame context.

Synopsis

typedef struct _CmpackMasterFlat CmpackMasterFlat

Description

This private data structure holds information needed to build one master-flat frame.

cmpack_mflat_init (function)

Make new context for the Master-flat tool.

Synopsis

CmpackMasterFlat * cmpack_mflat_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 the new master-flat context or zero on failure

cmpack_mflat_set_console (function)

Attach console to the context.

Synopsis

void cmpack_mflat_set_console (CmpackMasterFlat * 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] master-flat context
con[in] console context

cmpack_mflat_set_bitpix (function)

Set output data format.

Synopsis

void cmpack_mflat_set_bitpix (CmpackMasterFlat * ctx, CmpackBitpix bitpix)

Parameters

ctx[in] master-flat context
bitpix[in] output data format

cmpack_mflat_get_bitpix (function)

Get output data format.

Synopsis

CmpackBitpix cmpack_mflat_get_bitpix (CmpackMasterFlat * ctx)

Parameters

ctx[in] master-flat context

Return value

output data format

cmpack_mflat_set_level (function)

Set average output level.

Synopsis

void cmpack_mflat_set_level (CmpackMasterFlat * ctx, double level)

Parameters

ctx[in] master-flat context
level[in] mean level in ADU

cmpack_mflat_get_level (function)

Get average output level.

Synopsis

double cmpack_mflat_get_level (CmpackMasterFlat * ctx)

Parameters

ctx[in] master-flat context

Return value

mean level in ADU

cmpack_mflat_set_border (function)

Set image border size.

Synopsis

void cmpack_mflat_set_border (CmpackMasterFlat * ctx, 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

ctx[in] master-flat context
border[in] border size in pixels

cmpack_mflat_get_border (function)

Get image flip flags.

Synopsis

void cmpack_mflat_get_border (CmpackMasterFlat * ctx, CmpackBorder * border)

Parameters

ctx[in] master-flat context
border[out] border size in pixels

cmpack_mflat_open (function)

Open output file.

Synopsis

int cmpack_mflat_open (CmpackMasterFlat * ctx, CmpackCcdFile * outfile)

Description

Opens new master-flat frame. The caller is responsible to close the file by calling the cmpack_mflat_close() function.

Parameters

ctx[in] master-flat context
outfile[in] output file context

Return value

zero on success or error code on failure.

cmpack_mflat_read (function)

Add a frame to the accumulation buffer.

Synopsis

int cmpack_mflat_read (CmpackMasterFlat * ctx, CmpackCcdFile * infile)

Description

The function reads the frame from specified CCD-frame file into memory.

Parameters

ctx[in] master-flat context
infile[in] input file context

Return value

zero on success or error code on failure.

cmpack_mflat_close (function)

Make master-flat frame and save it to the file.

Synopsis

int cmpack_mflat_close (CmpackMasterFlat * ctx)

Description

The function computes the output CCD data, writes it to the file, closes the output file and frees allocated data.

Parameters

ctx[in] master-flat context

Return value

zero on success or error code on failure.