FORS Pipeline Reference Manual 4.9.20
Defines | Functions | Variables
fors_recipe Recipe

Defines

#define cleanup
#define cleanup
#define cleanup
#define cleanup

Functions

static void remove_large_scale (fors_image *master_screen_flat, const cpl_parameterlist *parameters, const char *context, const fors_setting *setting)
 Fit and divide out large scale structure.
static void remove_large_scale_fit (fors_image *master_screen_flat, const cpl_parameterlist *parameters, const char *context, const fors_setting *setting)
 Fit and divide out large scale structure.
static void write_qc (cpl_propertylist *qc, const cpl_frame *first_raw_frame, const fors_image_list *sflats, const fors_image *master_sflat, const fors_setting *setting, double saturation)
 Compute QC.
void fors_img_screen_flat_define_parameters (cpl_parameterlist *parameters)
 Define recipe parameters.
void fors_img_screen_flat (cpl_frameset *frames, const cpl_parameterlist *parameters)
 Do the processing.
int cpl_plugin_get_info (cpl_pluginlist *list)
 Build the list of available plugins, for this module.
static int fors_img_screen_flat_create (cpl_plugin *plugin)
 Setup the recipe options.
static int fors_img_screen_flat_exec (cpl_plugin *plugin)
 Execute the plugin instance given by the interface.
static int fors_img_screen_flat_destroy (cpl_plugin *plugin)
 Destroy what has been created by the 'create' function.

Variables

const char *const fors_img_screen_flat_name = "fors_img_screen_flat"
const char *const fors_img_screen_flat_description_short = "Compute master screen flat frame"
const char *const fors_img_screen_flat_author = "Jonas M. Larsen"
const char *const fors_img_screen_flat_email = PACKAGE_BUGREPORT
const char *const fors_img_screen_flat_description = " MASTER_SCREEN_FLAT_IMG FITS image Master screen flat field\n"

Detailed Description

See recipe description for details.


Define Documentation

#define cleanup
Value:
do { \
    cpl_frameset_delete(sflat_frames); \
    fors_setting_delete(&setting); \
    cpl_frameset_delete(master_bias_frame); \
    fors_image_delete_const(&master_bias); \
    fors_stack_method_delete(&sm); \
    cpl_free((void *)context); \
    fors_image_delete(&master_screen_flat); \
    fors_image_delete(&master_norm_flat); \
    fors_image_list_delete_const(&sflats, fors_image_delete); \
    cpl_propertylist_delete(qc); \
} while (0)

Definition at line 472 of file fors_img_screen_flat_impl.c.

#define cleanup
Value:
do { \
    cpl_image_delete(smoothed); \
} while (0)

Definition at line 472 of file fors_img_screen_flat_impl.c.

#define cleanup
Value:
do { \
    cpl_image_delete(smoothed); \
} while (0)

Definition at line 472 of file fors_img_screen_flat_impl.c.

#define cleanup
Value:
do { \
    fors_image_delete(&image); \
} while (0)

Definition at line 472 of file fors_img_screen_flat_impl.c.


Function Documentation

static void remove_large_scale ( fors_image master_screen_flat,
const cpl_parameterlist *  parameters,
const char *  context,
const fors_setting setting 
) [static]

Fit and divide out large scale structure.

Parameters:
master_screen_flatpre-normalized screen flat image
parameterssmoothing parameters
contextread parameters from this context
settinginstrument setting

This function applies a median filter to the screen flat field image. The master screen flat field is then divided by this smoothed image which removes large scale structure and normalizes the flat field to one.

To avoid dealing with correlated noise, the obtained smoothed image is assumed to be effectively noiseless. For a median filter window size of only 11x11, this assumption introduces a relative error in the error bars of only ~ 1/sqrt(11x11) = 10 %.

Definition at line 299 of file fors_img_screen_flat_impl.c.

References assure, dfs_get_parameter_int_const(), fors_image_divide_noerr(), fors_image_filter_median_create(), fors_image_get_size_x(), fors_image_get_size_y(), and remove_large_scale_fit().

Referenced by fors_img_screen_flat().

static void remove_large_scale_fit ( fors_image master_screen_flat,
const cpl_parameterlist *  parameters,
const char *  context,
const fors_setting setting 
) [static]

Fit and divide out large scale structure.

Parameters:
master_screen_flatpre-normalized screen flat image
parametersfitting parameters
contextread parameters from this context
settinginstrument setting

This function fits the illuminated part of the screen flat field frame with a low degree polynomial. The input frame is then divided by this fit-smoothed image which removes large scale structure and normalizes the flat field to one.

To avoid dealing with correlated noise, the obtained smoothed image is assumed to be effectively noiseless.

Definition at line 407 of file fors_img_screen_flat_impl.c.

References assure, dfs_get_parameter_int_const(), fors_image_divide_noerr(), and fors_image_get_median().

Referenced by remove_large_scale().

static void write_qc ( cpl_propertylist *  qc,
const cpl_frame *  first_raw_frame,
const fors_image_list *  sflats,
const fors_image master_sflat,
const fors_setting setting,
double  saturation 
) [static]
void fors_img_screen_flat_define_parameters ( cpl_parameterlist *  parameters)

Define recipe parameters.

Parameters:
parametersparameter list to fill

Definition at line 96 of file fors_img_screen_flat_impl.c.

References fors_stack_define_parameters().

Referenced by fors_img_screen_flat_create(), and test_img_screen_flat().

void fors_img_screen_flat ( cpl_frameset *  frames,
const cpl_parameterlist *  parameters 
)

Do the processing.

Parameters:
framesinput frames
parametersThe parameters list
Returns:
0 if everything is ok

Definition at line 186 of file fors_img_screen_flat_impl.c.

References assure, fors_dfs_save_image(), fors_frameset_extract(), fors_image_duplicate(), fors_image_load(), fors_image_load_list_const(), fors_setting_new(), fors_stack_const(), fors_stack_method_new(), remove_large_scale(), and write_qc().

Referenced by fors_img_screen_flat_exec(), and test_img_screen_flat().

int cpl_plugin_get_info ( cpl_pluginlist *  list)

Build the list of available plugins, for this module.

Parameters:
listThe plugin list
Returns:
0 if everything is ok, -1 otherwise

Create the recipe instance and make it available to the application using the interface. This function is exported.

Definition at line 62 of file fors_img_screen_flat.c.

References fors_get_license(), fors_get_version_binary(), fors_img_screen_flat_create(), fors_img_screen_flat_destroy(), and fors_img_screen_flat_exec().

static int fors_img_screen_flat_create ( cpl_plugin *  plugin) [static]

Setup the recipe options.

Parameters:
pluginThe plugin
Returns:
0 if everything is ok

Defining the command-line/configuration parameters for the recipe.

Definition at line 109 of file fors_img_screen_flat.c.

References fors_img_screen_flat_define_parameters().

Referenced by cpl_plugin_get_info().

static int fors_img_screen_flat_exec ( cpl_plugin *  plugin) [static]

Execute the plugin instance given by the interface.

Parameters:
pluginthe plugin
Returns:
0 if everything is ok

Definition at line 158 of file fors_img_screen_flat.c.

References fors_begin(), fors_end(), and fors_img_screen_flat().

Referenced by cpl_plugin_get_info().

static int fors_img_screen_flat_destroy ( cpl_plugin *  plugin) [static]

Destroy what has been created by the 'create' function.

Parameters:
pluginThe plugin
Returns:
0 if everything is ok

Definition at line 207 of file fors_img_screen_flat.c.

Referenced by cpl_plugin_get_info().