FORS Pipeline Reference Manual 4.9.9
Defines | Functions | Variables
Miscellaneous Utilities

Defines

#define REQ_CPL_MAJOR   4
#define REQ_CPL_MINOR   0
#define REQ_CPL_MICRO   0
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define MAX_MESSAGE_LENGTH   1024

Functions

const char * fors_get_license (void)
 Get the pipeline copyright and license.
void fors_print_banner (void)
 Issue a banner with the pipeline version.
int fors_get_version_binary (void)
 Get FORS library binary version number.
double fors_rand_gauss (void)
 Pseudo-random gaussian distributed number.
double fors_tools_get_kth_double (double *a, int n, int k)
 Same as cpl_tools_get_kth_double.
float fors_tools_get_median_float (float *a, int n)
 Unbiased median.
float fors_tools_get_median_fast_float (float *a, int n)
 Biased median.
float fors_tools_get_kth_float (float *a, int n, int k)
 Same as cpl_tools_get_kth_float.
const char * fors_frame_get_type_string (const cpl_frame *f)
 Get frame type as a string.
const char * fors_frame_get_group_string (const cpl_frame *f)
 Get frame group as a string.
const char * fors_frame_get_level_string (const cpl_frame *f)
 Get frame level as a string.
void fors_frameset_print (const cpl_frameset *frames)
 Print a frame set.
void fors_frame_print (const cpl_frame *f)
 Print a frame.
cpl_frameset * fors_frameset_extract (const cpl_frameset *frames, const char *tag)
 Extract frames with given tag from frameset.
const char * fors_type_get_string (cpl_type t)
 Textual representation of CPL type.
void fors_parameterlist_set_defaults (cpl_parameterlist *parlist)
 Set unset parameters to default value.
cpl_image * fors_imagelist_collapse_create (const cpl_imagelist *ilist)
 Workaround for cpl_imagelist_collapse_create.
cpl_image * fors_imagelist_collapse_median_create (const cpl_imagelist *ilist)
 Workaround for cpl_imagelist_collapse_median_create.
double fors_angle_diff (const double *a1, const double *a2)
 Difference between angles.
void fors_msg_macro (cpl_msg_severity level, const char *fct, const char *format,...)
 Print message.
double fors_utils_median_corr (int n)
 median stacking correction factor

Variables

const double STDEV_PR_MAD = 1/0.6744897

Function Documentation

const char* fors_get_license ( void  )

Get the pipeline copyright and license.

Returns:
The copyright and license string

The function returns a pointer to the statically allocated license string. This string should not be modified using the returned pointer.

Definition at line 65 of file fors_utils.c.

Referenced by cpl_plugin_get_info().

int fors_get_version_binary ( void  )

Get FORS library binary version number.

Returns:
Binary version number

Definition at line 107 of file fors_utils.c.

Referenced by cpl_plugin_get_info(), and test_version().

double fors_rand_gauss ( void  )

Pseudo-random gaussian distributed number.

Returns:
Pseudo-random gasssian value with mean zero, stdev 1, based on C's rand()

It is left to the user when/how to call srand().

Definition at line 181 of file fors_utils.c.

Referenced by create_bias(), create_dark(), create_screen_flat(), create_sky_flat(), and test_identify().

const char* fors_frame_get_type_string ( const cpl_frame *  f)

Get frame type as a string.

Parameters:
fframe
Returns:
frame type, or NULL

Definition at line 319 of file fors_utils.c.

References assure.

Referenced by fors_frame_print().

const char* fors_frame_get_group_string ( const cpl_frame *  f)

Get frame group as a string.

Parameters:
fframe
Returns:
frame group, or NULL

Definition at line 344 of file fors_utils.c.

References assure.

Referenced by fors_frame_print(), and fors_image_load().

const char* fors_frame_get_level_string ( const cpl_frame *  f)

Get frame level as a string.

Parameters:
fframe
Returns:
frame level, or NULL

Definition at line 369 of file fors_utils.c.

References assure.

Referenced by fors_frame_print().

void fors_frameset_print ( const cpl_frameset *  frames)

Print a frame set.

Parameters:
framesFrame set to print

This function prints all frames in a CPL frame set.

Definition at line 393 of file fors_utils.c.

References fors_frame_print().

Referenced by fors_begin().

void fors_frame_print ( const cpl_frame *  f)

Print a frame.

Parameters:
fFrame to print

This function prints a CPL frame.

Definition at line 427 of file fors_utils.c.

References fors_frame_get_group_string(), fors_frame_get_level_string(), and fors_frame_get_type_string().

Referenced by fors_end(), and fors_frameset_print().

cpl_frameset* fors_frameset_extract ( const cpl_frameset *  frames,
const char *  tag 
)

Extract frames with given tag from frameset.

Parameters:
framesframe set
tagto search for
Returns:
newly allocated, possibly empty, frameset, or NULL on error

Definition at line 468 of file fors_utils.c.

References assure.

Referenced by fors_bias(), fors_dark(), fors_img_science(), fors_img_screen_flat(), fors_img_sky_flat(), fors_photometry(), and fors_zeropoint().

const char* fors_type_get_string ( cpl_type  t)

Textual representation of CPL type.

Parameters:
ttype
Returns:
the given type as a string

Definition at line 496 of file fors_utils.c.

Referenced by fors_image_new(), and fors_photometry_read_input().

void fors_parameterlist_set_defaults ( cpl_parameterlist *  parlist)

Set unset parameters to default value.

Parameters:
parlistA parameter list

The function initializes the provided parameter list by setting the current parameter values to the default parameter values.

Definition at line 545 of file fors_utils.c.

References assure.

Referenced by test_bias(), test_dark(), test_identify(), test_img_science(), test_img_screen_flat(), test_img_sky_flat(), and test_zeropoint().

cpl_image* fors_imagelist_collapse_create ( const cpl_imagelist *  ilist)

Workaround for cpl_imagelist_collapse_create.

Parameters:
imagessee cpl_imagelist_collapse_create()
Returns:
see cpl_imagelist_collapse_create()

This function is the same as cpl_imagelist_collapse_create but does not allocate a new bad pixel buffer when it is not needed.

Images with bpm causes the function cpl_image_get_median_window() to slowdown by a factor ~200000 for a 2 megapixel image and 9 pixel window

Definition at line 597 of file fors_utils.c.

Referenced by fors_image_collapse_create(), and fors_image_collapse_median_create().

cpl_image* fors_imagelist_collapse_median_create ( const cpl_imagelist *  ilist)

Workaround for cpl_imagelist_collapse_median_create.

Parameters:
imagessee fors_imagelist_collapse_create
Returns:
see fors_imagelist_collapse_create

See fors_imagelist_collapse_create

Definition at line 616 of file fors_utils.c.

Referenced by fors_image_collapse_median_create().

double fors_angle_diff ( const double *  a1,
const double *  a2 
)

Difference between angles.

Parameters:
a11st angle (radians)
a22nd angle (radians)
Returns:
difference in [0;pi]

Definition at line 636 of file fors_utils.c.

References assure.

Referenced by match_patterns().

void fors_msg_macro ( cpl_msg_severity  level,
const char *  fct,
const char *  format,
  ... 
)

Print message.

Parameters:
levelmessage level
fctfunction id
formatprintf style format string

This function can be called directly or through the macro fors_msg()

Definition at line 660 of file fors_utils.c.

double fors_utils_median_corr ( int  n)

median stacking correction factor

Parameters:
nnumber of stacked frames
Returns:
correction factor defined as the ratio sigma_median / sigma_avg

sigma_median is the propagated error when computing the median of n numbers with the same error. sigma_avg is the propagated error of the average of n numbers with the same error.

Definition at line 696 of file fors_utils.c.

References assure.

Referenced by fors_image_collapse_median_create().