C-Munipack 1.2 / Application programming interface / API reference

Functions for making photometry files.

cmpack_phot.h

Type definitions

CmpackPhotConfiguration context for the Photometry tool.

Functions

cmpack_phot_initMake new photometry configuration context.
cmpack_phot_set_consoleAttach console to the context.
cmpack_phot_set_rnoiseSet readout noise level.
cmpack_phot_get_rnoiseGet readout noise level.
cmpack_phot_set_adcgainSet ADC gain.
cmpack_phot_get_adcgainGet ADC gain.
cmpack_phot_set_minvalSet threshold for bad pixels.
cmpack_phot_get_minvalGet threshold for bad pixels.
cmpack_phot_set_maxvalSet threshold for overexposed pixels.
cmpack_phot_get_maxvalGet threshold for overexposed pixels.
cmpack_phot_set_fwhmSet expected value of FWHM of objects.
cmpack_phot_get_fwhmGet expected value of FWHM of objects.
cmpack_phot_set_threshSet detection threshold.
cmpack_phot_get_threshGet detection threshold.
cmpack_phot_set_minshrpSet min.
cmpack_phot_get_minshrpGet min.
cmpack_phot_set_maxshrpSet max.
cmpack_phot_get_maxshrpGet max.
cmpack_phot_set_minrndSet min.
cmpack_phot_get_minrndGet min.
cmpack_phot_set_maxrndSet max.
cmpack_phot_get_maxrndGet max.
cmpack_phot_set_borderSet image border size.
cmpack_phot_get_borderGet image flip flags.
cmpack_phot_set_skyinSet inner radius of the sky annulus.
cmpack_phot_get_skyinGet inner radius of the sky annulus.
cmpack_phot_set_skyoutSet outer radius of the sky annulus.
cmpack_phot_get_skyoutGet outer radius of the sky annulus.
cmpack_phot_set_aperSet apertures.
cmpack_phot_get_aperGet apertures.
cmpack_photMake photometry file from a calibrated CCD frame.

Description

Set of functions defined in this module allows user to make a photometry file from a CCD frame.

CmpackPhot (data type)

Configuration context for the Photometry tool.

Synopsis

typedef struct _CmpackPhot CmpackPhot

Description

This private data structure holds the configuration parameters for the photometry.

cmpack_phot_init (function)

Make new photometry configuration context.

Synopsis

CmpackPhot * cmpack_phot_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_phot_set_console (function)

Attach console to the context.

Synopsis

void cmpack_phot_set_console (CmpackPhot * 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_phot_set_rnoise (function)

Set readout noise level.

Synopsis

void cmpack_phot_set_rnoise (CmpackPhot * file, double rnoise)

Parameters

file[in] output file context
rnoise[in] readout noise

cmpack_phot_get_rnoise (function)

Get readout noise level.

Synopsis

double cmpack_phot_get_rnoise (CmpackPhot * file)

Parameters

file[in] output file context

Return value

current value of readout noise level

cmpack_phot_set_adcgain (function)

Set ADC gain.

Synopsis

void cmpack_phot_set_adcgain (CmpackPhot * file, double adcgain)

Parameters

file[in] output file context
adcgain[in] ADC gain

Return value

zero on success or error code on failure

cmpack_phot_get_adcgain (function)

Get ADC gain.

Synopsis

double cmpack_phot_get_adcgain (CmpackPhot * file)

Parameters

file[in] output file context

Return value

current ADC gain

cmpack_phot_set_minval (function)

Set threshold for bad pixels.

Synopsis

void cmpack_phot_set_minval (CmpackPhot * file, double minval)

Parameters

file[in] output file context
minval[in] minimal valid value in ADU

Return value

zero on success or error code on failure

cmpack_phot_get_minval (function)

Get threshold for bad pixels.

Synopsis

double cmpack_phot_get_minval (CmpackPhot * file)

Parameters

file[in] output file context

Return value

minimal valid value in ADU

cmpack_phot_set_maxval (function)

Set threshold for overexposed pixels.

Synopsis

void cmpack_phot_set_maxval (CmpackPhot * file, double maxval)

Parameters

file[in] output file context
maxval[in] maximal valid value in ADU + 1

Return value

zero on success or error code on failure

cmpack_phot_get_maxval (function)

Get threshold for overexposed pixels.

Synopsis

double cmpack_phot_get_maxval (CmpackPhot * file)

Parameters

file[in] output file context

Return value

current value of threshold for overexposed pixels

cmpack_phot_set_fwhm (function)

Set expected value of FWHM of objects.

Synopsis

void cmpack_phot_set_fwhm (CmpackPhot * file, double fwhm)

Parameters

file[in] output file context
fwhm[in] FWHM in pixels

cmpack_phot_get_fwhm (function)

Get expected value of FWHM of objects.

Synopsis

double cmpack_phot_get_fwhm (CmpackPhot * file)

Parameters

file[in] output file context

Return value

FWHM in pixels

cmpack_phot_set_thresh (function)

Set detection threshold.

Synopsis

void cmpack_phot_set_thresh (CmpackPhot * file, double thresh)

Parameters

file[in] output file context
thresh[in] threshold

cmpack_phot_get_thresh (function)

Get detection threshold.

Synopsis

double cmpack_phot_get_thresh (CmpackPhot * file)

Parameters

file[in] output file context

Return value

threshold

cmpack_phot_set_minshrp (function)

Set min.

Synopsis

void cmpack_phot_set_minshrp (CmpackPhot * file, double minshrp)

Description

sharpness threshold

Parameters

file[in] output file context
minshrp[in] threshold

Return value

zero on success or error code on failure

cmpack_phot_get_minshrp (function)

Get min.

Synopsis

double cmpack_phot_get_minshrp (CmpackPhot * file)

Description

sharpness threshold

Parameters

file[in] output file context

Return value

current value of min. sharpness threshold

cmpack_phot_set_maxshrp (function)

Set max.

Synopsis

void cmpack_phot_set_maxshrp (CmpackPhot * file, double maxshrp)

Description

sharpness threshold

Parameters

file[in] output file context
maxshrp[in] threshold

Return value

zero on success or error code on failure

cmpack_phot_get_maxshrp (function)

Get max.

Synopsis

double cmpack_phot_get_maxshrp (CmpackPhot * file)

Description

sharpness threshold

Parameters

file[in] output file context

Return value

current value of max. sharpness threshold

cmpack_phot_set_minrnd (function)

Set min.

Synopsis

void cmpack_phot_set_minrnd (CmpackPhot * file, double minrnd)

Description

roundness threshold

Parameters

file[in] output file context
minrnd[in] threshold

Return value

zero on success or error code on failure

cmpack_phot_get_minrnd (function)

Get min.

Synopsis

double cmpack_phot_get_minrnd (CmpackPhot * file)

Description

roundness threshold

Parameters

file[in] output file context

Return value

current value of min. roundness threshold

cmpack_phot_set_maxrnd (function)

Set max.

Synopsis

void cmpack_phot_set_maxrnd (CmpackPhot * file, double maxrnd)

Description

roundness threshold

Parameters

file[in] output file context
maxrnd[in] threshold

Return value

zero on success or error code on failure

cmpack_phot_get_maxrnd (function)

Get max.

Synopsis

double cmpack_phot_get_maxrnd (CmpackPhot * file)

Description

roundness threshold

Parameters

file[in] output file context

Return value

current value of max. roundness threshold

cmpack_phot_set_border (function)

Set image border size.

Synopsis

void cmpack_phot_set_border (CmpackPhot * 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_phot_get_border (function)

Get image flip flags.

Synopsis

void cmpack_phot_get_border (CmpackPhot * file, CmpackBorder * border)

Parameters

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

cmpack_phot_set_skyin (function)

Set inner radius of the sky annulus.

Synopsis

void cmpack_phot_set_skyin (CmpackPhot * file, double skyin)

Parameters

file[in] output file context
skyin[in] radius in pixels

Return value

zero on success or error code on failure

cmpack_phot_get_skyin (function)

Get inner radius of the sky annulus.

Synopsis

double cmpack_phot_get_skyin (CmpackPhot * file)

Parameters

file[in] output file context

Return value

current value of inner radius of the sky annulus

cmpack_phot_set_skyout (function)

Set outer radius of the sky annulus.

Synopsis

void cmpack_phot_set_skyout (CmpackPhot * file, double skyout)

Parameters

file[in] output file context
skyout[in] radius in pixels

Return value

zero on success or error code on failure

cmpack_phot_get_skyout (function)

Get outer radius of the sky annulus.

Synopsis

double cmpack_phot_get_skyout (CmpackPhot * file)

Parameters

file[in] output file context

Return value

current value of outer radius of the sky annulus

cmpack_phot_set_aper (function)

Set apertures.

Synopsis

void cmpack_phot_set_aper (CmpackPhot * file, const double * items, int nitems)

Parameters

file[in] output file context
items[in] table of aperture radii
nitems[in] number of apertures

Return value

zero on success or error code on failure

cmpack_phot_get_aper (function)

Get apertures.

Synopsis

void cmpack_phot_get_aper (CmpackPhot * file, double ** items, int * nitems)

Description

The function makes copy of the data and returns the pointer to it. The caller is reponsible to free the memory by means of the cmpack_free() method.

Parameters

file[in] output file context
items[out] table of aperture radii
nitems[out] number of apertures

Return value

zero on success or error code on failure

cmpack_phot (function)

Make photometry file from a calibrated CCD frame.

Synopsis

int cmpack_phot (CmpackPhot * ctx, CmpackCcdFile * infile, CmpackPhtFile * outfile, int * nstars)

Description

The function reads input frame, finds stars and determine their brightness. The result is stored in the photometry file.

Parameters

ctx[in] photometry configuration context
infile[in] input file context
outfile[in] output file context
nstars[out] number of stars detected

Return value

zero on success or error code on failure