FORS Pipeline Reference Manual  4.12.5
Data Structures | Macros | Functions
Image source extraction

Data Structures

struct  _extract_method
 

Macros

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

Functions

static fors_star_list * extract_sex (const fors_image *image, const fors_setting *setting, const char *sex_exe, const char *sex_config, const char *sex_mag, const char *sex_magerr, int radius, double magsyserr, fors_extract_sky_stats *sky_stats, cpl_image **background, cpl_table **extracted_sources)
 Extract sources using SExtractor. More...
 
static fors_star_list * extract_test (fors_extract_sky_stats *sky_stats, cpl_image **background, cpl_table **extracted_sources)
 Extract sources. More...
 
bool fors_extract_check_sex_flag (unsigned int sex_flag)
 Check SExtractor object feature: FLAG. More...
 
bool fors_extract_check_sex_star (const fors_star *star, const cpl_image *ref_img)
 Check a sextracted star for validity. More...
 
void fors_extract_define_parameters (cpl_parameterlist *parameters, const char *context)
 Define recipe parameters. More...
 
extract_method * fors_extract_method_new (const cpl_parameterlist *parameters, const char *context)
 Get extraction method from parameter list. More...
 
void fors_extract_method_delete (extract_method **em)
 Deallocate extraction method and set the pointer to NULL.
 
fors_star_list * fors_extract (const fors_image *image, const fors_setting *setting, const extract_method *em, double magsyserr, fors_extract_sky_stats *sky_stats, cpl_image **background, cpl_table **extracted_sources)
 Extract sources. More...
 

Detailed Description

Macro Definition Documentation

#define cleanup
Value:
do { \
cpl_free((void *)name); \
cpl_free((void *)method); \
} while (0)

Definition at line 852 of file fors/fors_extract.c.

#define cleanup
Value:
do { \
cpl_table_delete(out); out = NULL; \
cpl_free((void *)command); \
cpl_image_delete(work_back); work_back = NULL; \
cpl_image_delete(bmaxsigma); bmaxsigma = NULL; \
cpl_image_delete(bsigma); bsigma = NULL; \
fors_image_delete(&fbsigma); \
} while (0)
void fors_image_delete(fors_image **image)
Deallocate image and set pointer to NULL.
Definition: fors_image.c:162

Definition at line 852 of file fors/fors_extract.c.

Function Documentation

static fors_star_list * extract_sex ( const fors_image image,
const fors_setting setting,
const char *  sex_exe,
const char *  sex_config,
const char *  sex_mag,
const char *  sex_magerr,
int  radius,
double  magsyserr,
fors_extract_sky_stats sky_stats,
cpl_image **  background,
cpl_table **  extracted_sources 
)
static

Extract sources using SExtractor.

Parameters
imagesource image
settinginstrument setting (gain)
sex_exeSExtractor executable
sex_configSExtractor configuration file
sex_magSExtractor catalog magnitude
sex_magerrSExtractor catalog magnitude error
radiusbackground error map median filter radius
sky_stats(output) statistics on determined sky
background(output) background image
extracted_sources(output) if non-NULL, SExtractor output table
Returns
newly allocated list of stars

Note: The gain given in the setting must describe the image. Therefore, if the provided value of the gain is just the detector gain, the input image must not be stacked or normalized to e.g. 1s exposure time.

A background error map is given to SExtractor. This error map is obtained by applying a median filter to the input image error map (in order to remove sources).

Definition at line 431 of file fors/fors_extract.c.

References assure, fors_extract_check_sex_flag(), fors_extract_check_sex_star(), fors_image_crop(), fors_image_delete(), fors_image_duplicate(), fors_image_filter_max_create(), fors_image_get_size_x(), fors_image_get_size_y(), fors_image_new(), fors_image_save_sex(), fors_star_delete(), and fors_star_new_from_table().

Referenced by fors_extract().

static fors_star_list * extract_test ( fors_extract_sky_stats sky_stats,
cpl_image **  background,
cpl_table **  extracted_sources 
)
static

Extract sources.

Parameters
sky_stats(output) sky statistics
background(output) background
extracted_sources(output) if non-NULL, table of sources
Returns
newly allocated list of extracted stars

The star positions are hardcoded!

This method is used only for testing without relying on external packages

Definition at line 867 of file fors/fors_extract.c.

References assure, fors_create_sources_table(), and fors_star_new().

Referenced by fors_extract().

bool fors_extract_check_sex_flag ( unsigned int  sex_flag)

Check SExtractor object feature: FLAG.

Parameters
SExtractorobject's binary contamination flags
Returns
1 if successful, 0 on failure

All FLAGS 1, 2, 4, ..., 128 are severe enough that we do not want to use the source for photometry see SExtractor doc. for the meaning of each flag.

Definition at line 100 of file fors/fors_extract.c.

Referenced by extract_sex().

bool fors_extract_check_sex_star ( const fors_star star,
const cpl_image *  ref_img 
)

Check a sextracted star for validity.

Parameters
star(S)Extracted star
ref_img(Optional) reference image (to check for image range)
Returns
1 if successful, 0 on failure

The following SExtractor failures are caught:

  • Check for allowed general parameters using fors_star_check_values()
  • Invalid SExtractor magnitude (can be 99.0)
  • (x, y) out of range (if ref_img != NULL)

Definition at line 122 of file fors/fors_extract.c.

References fors_star_check_values().

Referenced by extract_sex().

void fors_extract_define_parameters ( cpl_parameterlist *  parameters,
const char *  context 
)

Define recipe parameters.

Parameters
parametersparameter list to fill
contextparameters context

Definition at line 153 of file fors/fors_extract.c.

extract_method* fors_extract_method_new ( const cpl_parameterlist *  parameters,
const char *  context 
)

Get extraction method from parameter list.

Parameters
parametersrecipe parameter list
contextread extraction method from this context
Returns
newly allocated extraction method

The parameter list should have been previously created using fors_extract_define_parameters()

Definition at line 258 of file fors/fors_extract.c.

References assure, dfs_get_parameter_int_const(), and dfs_get_parameter_string_const().

fors_star_list* fors_extract ( const fors_image image,
const fors_setting setting,
const extract_method *  em,
double  magsyserr,
fors_extract_sky_stats sky_stats,
cpl_image **  background,
cpl_table **  extracted_sources 
)

Extract sources.

Parameters
imagesource image
settinginstrument setting (gain)
emextraction method to use
sky_stats(output) statistics on determined sky
background(output) inferred background image
extracted_sources(output) if non-NULL, table of extracted sources
Returns
newly allocated list of extracted stars

Definition at line 365 of file fors/fors_extract.c.

References assure, extract_sex(), and extract_test().