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

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
const char *const fors_license
 The pipeline copyright and license.

Function Documentation

int fors_get_version_binary ( void   ) 

Get FORS library binary version number.

Returns:
Binary version number

Definition at line 86 of file fors_utils.c.

References REQ_CPL_MAJOR, REQ_CPL_MICRO, and REQ_CPL_MINOR.

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 160 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:
f frame
Returns:
frame type, or NULL

Definition at line 298 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:
f frame
Returns:
frame group, or NULL

Definition at line 323 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:
f frame
Returns:
frame level, or NULL

Definition at line 348 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:
frames Frame set to print
This function prints all frames in a CPL frame set.

Definition at line 372 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:
f Frame to print
This function prints a CPL frame.

Definition at line 406 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:
frames frame set
tag to search for
Returns:
newly allocated, possibly empty, frameset, or NULL on error

Definition at line 447 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:
t type
Returns:
the given type as a string

Definition at line 475 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:
parlist A parameter list
The function initializes the provided parameter list by setting the current parameter values to the default parameter values.

Definition at line 524 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:
images see 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 576 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:
images see fors_imagelist_collapse_create
Returns:
see fors_imagelist_collapse_create
See fors_imagelist_collapse_create

Definition at line 595 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:
a1 1st angle (radians)
a2 2nd angle (radians)
Returns:
difference in [0;pi]

Definition at line 615 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:
level message level
fct function id
format printf style format string
This function can be called directly or through the macro fors_msg()

Definition at line 639 of file fors_utils.c.

References MAX_MESSAGE_LENGTH.

double fors_utils_median_corr ( int  n  ) 

median stacking correction factor

Parameters:
n number 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 675 of file fors_utils.c.

References assure.

Referenced by fors_image_collapse_median_create(), and write_qc().


Variable Documentation

const char* const fors_license

Initial value:

 
"This file is currently part of the FORS Instrument Pipeline\n"
"Copyright (C) 2002-2010 European Southern Observatory\n"
"\n"
"This program is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published by\n"
"the Free Software Foundation; either version 2 of the License, or\n"
"(at your option) any later version.\n"
"\n"
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
"GNU General Public License for more details.\n"
"\n"
"You should have received a copy of the GNU General Public License\n"
"along with this program; if not, write to the Free Software Foundation,\n"
"Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"
The pipeline copyright and license.

Definition at line 61 of file fors_utils.c.

Referenced by cpl_plugin_get_info().


Generated on Fri Mar 4 09:46:01 2011 for FORS Pipeline Reference Manual by  doxygen 1.4.7