fors_recipe Recipe


Data Structures

struct  fors_fit_ncoeff_paropts
struct  entry

Defines

#define LIST_ELEM   entry
#define LIST_DEFINE
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup
#define cleanup

Enumerations

enum  fors_fit_ncoeff { FORS_FIT_NCOEFF_NO = 0, FORS_FIT_NCOEFF_ONE, FORS_FIT_NCOEFF_PERFRAME, FORS_FIT_NCOEFF_PERNIGHT }

Functions

entryentry_new (int frame_index, int star_index, double airmass, double gain, double exptime, int atm_ext_identifier, fors_star *star)
 entry constructor
void entry_delete (entry **e)
 Destructor.
static void entry_delete_but_standard (entry **e)
 Destructor.
static double entry_get_powers_x_y (const entry *e, const cpl_array *powers)
void entry_list_print (const entry_list *l, cpl_msg_severity level)
 Print list.
static double entry_get_powers_airmass_color (const entry *e, const cpl_array *powers)
static entry_list * fors_photometry_read_input (const cpl_frameset *alphot_frames, const fors_setting *setting, int(*get_atm_ext_id_function)(const cpl_propertylist *header), bool import_unknown, int *n_frames, fors_std_star_list **std_star_list, int filter)
 Read input data from aligned phot tables.
static fors_std_star * fors_photometry_read_input_listinsert_star_if_new (fors_std_star_list *std_list, fors_std_star *std, double mind_arcsec)
 Insert a std star into a list, if the closest existing distance > maxd_arcsec.
static void fors_delete_star_lists (entry_list **el, fors_std_star_list **sl)
 Delete a fors_std_star_list and an entry list referring to it.
static bool fors_fits_compare_string (const char *s1, const char *s2)
 Compare two strings while ignoring trailing blanks.
static void fors_matrix_null (cpl_matrix **m)
 Delete a cpl_matrix and set the pointer to NULL.
static void fors_matrix_append_delete (cpl_matrix **m1, cpl_matrix **m2)
static double fors_property_get_num (const cpl_property *prop)
static double fors_photometry_parameter_get_num (const cpl_parameterlist *parameters, const char *name, cpl_type type)
static const char * fors_photometry_parameter_get_string (const cpl_parameterlist *parameters, const char *name)
static fors_fit_ncoeff fors_photometry_parameter_get_ncoeff (const cpl_parameterlist *parameters, const char *name)
void fors_photometry_define_parameters (cpl_parameterlist *parameters)
 Define recipe parameters.
static cpl_polynomial * fors_photometry_define_polyf (int degreef1, int degreef2)
 Create a polynomial containing the desired coefficients (set to 1).
static cpl_polynomial * fors_photometry_define_polyp (int degreep)
 Create a 2-dim polynomial with the desired coefficients (set to 1).
static cpl_error_code fors_photometry_poly_new_from_coefficients (const cpl_polynomial *p_def, const cpl_matrix *coeffs, const cpl_matrix *cov_coeffs, cpl_polynomial **poly, cpl_polynomial **var_poly)
 Create a polynomial from a definition and a coefficients container.
int fors_photometry_get_timezone_observer (const cpl_propertylist *header)
 Return the timezone of the observer in hours against UT.
int fors_photometry_get_night_id (const cpl_propertylist *header)
 Get a unique identifier for the night of the observation.
static int fors_photometry_atm_ext_create_index_by_identifier (entry_list *obs_list)
 Collect all atm. extinction identifiers and create the indices.
static int fors_photometry_atm_ext_create_indices (entry_list *obsl, fors_fit_ncoeff fit_e)
 Create all atmospheric extinction indices.
static cpl_table * fors_photometry_atm_ext_print_index_by_framename (const entry_list *obs_list, const cpl_frameset *frames)
 Print the frame filenames for each atm. ext. index.
static cpl_error_code fors_photometry_check_input_value (double value, double value_error, const char *value_name, const char *input_name, double min_limit, double max_limit, double max_error)
 Check input value and its error to stay in a range.
static cpl_error_code fors_photometry_check_fitparam_atm_ext (entry_list *obsl, fors_fit_ncoeff fit_e, bool fit_z)
 Check whether fitting is possible (see below).
static cpl_error_code fors_photometry_adjust_fit_mag_flags (fors_std_star_list *stdl, entry_list *obsl, bool override_fit_m, int *n_mag_fits)
static cpl_error_code fors_photometry_remove_unnecessary (fors_std_star_list *std_list, entry_list *obs_list, int *n_mag_fits)
 Remove all standard stars which are fitted but were observed only once.
static cpl_array * fors_photometry_count_observations (fors_std_star_list *std_list, entry_list *obs_list)
 Count the number of observations of each standard star.
static cpl_matrix * build_equations_lhs_matrix_from_parameters (const entry_list *obs_list, const fors_std_star_list *std_list, bool fit_z, bool fit_c, int *n_fit_e_cols)
 Build left hand side matrix equation part.
static cpl_matrix * build_equations_lhs_matrix_from_poly (const entry_list *obs_list, const cpl_polynomial *poly, const char *pname, double(*powerfunc)(const entry *,const cpl_array *))
 Build polynomial fitting matrix with coefficients represented in columns.
static cpl_error_code build_equations_rhs_cov (const entry_list *obs_list, const fors_std_star_list *std_list, bool fit_z, bool fit_c, bool fit_e, double color_coeff, double dcolor_coeff, double ext_coeff, double dext_coeff, double zpoint, double dzpoint, cpl_matrix **rhs, cpl_matrix **rhs_cov)
 Build right hand side matrix equation part.
static void myprintf (const char *format,...)
static cpl_matrix * matrix_product_normal_create (const cpl_matrix *self)
static cpl_matrix * solve_normal (const cpl_matrix *coeff, const cpl_matrix *rhs, const cpl_matrix *cov_rhs, double *red_chisq)
void fors_photometry (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_photometry_create (cpl_plugin *plugin)
 Setup the recipe options.
static int fors_photometry_exec (cpl_plugin *plugin)
 Execute the plugin instance given by the interface.
static int fors_photometry_destroy (cpl_plugin *plugin)
 Destroy what has been created by the 'create' function.

Variables

const char *const fors_photometry_name = "fors_photometry"
const char *const fors_photometry_description_short = "Compute corrected flatfield"
const char *const fors_photometry_author = "Jonas M. Larsen"
const char *const fors_photometry_email = PACKAGE_BUGREPORT
const char *const fors_photometry_description
const double arcsec_tol = 5.0

Detailed Description

See recipe description for details.

Define Documentation

#define cleanup

Value:

do { \
    cpl_polynomial_delete(polyf); polyf = NULL; \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    cpl_polynomial_delete(polyp); polyp = NULL; \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    if (poly != NULL) { cpl_polynomial_delete(*poly); *poly = NULL; } \
    if (var_poly != NULL) {cpl_polynomial_delete(*var_poly); *var_poly = NULL;}\
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    cpl_free(ident_array); ident_array = NULL; \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    if (frame_printed != NULL) \
    { \
        cpl_free(frame_printed); \
        frame_printed = NULL; \
    } \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    cpl_array_delete(airmasses); airmasses = NULL; \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    fors_matrix_null(&solution); \
    fors_matrix_null(&cov1); \
    fors_matrix_null(&At); \
    fors_matrix_null(&AtC); \
    fors_matrix_null(&AtCA); \
    fors_matrix_null(&p); \
    fors_matrix_null(&Ap); \
    fors_matrix_null(&bAp); \
    fors_matrix_null(&bApt); \
    fors_matrix_null(&C1bAp); \
    fors_matrix_null(&chi2); \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    cpl_frameset_delete((cpl_frameset *)aligned_phot_frames);        \
    cpl_frameset_delete((cpl_frameset *)master_flat_frame); \
    cpl_frameset_delete((cpl_frameset *)phot_table); \
    fors_setting_delete(&setting); \
    fors_image_delete(&master_flat); \
    fors_image_delete(&correction); \
    cpl_table_delete(phot_coeff); \
    cpl_table_delete(summary); \
    fors_delete_star_lists(&obs, &std_star_list); \
    cpl_array_delete(n_std_star_obs); n_std_star_obs = NULL; \
    fors_matrix_null(&eqn_lhs); \
    fors_matrix_null(&eqn_rhs); \
    fors_matrix_null(&eqn_cov_rhs); \
    fors_matrix_null(&eqn_result); \
    fors_matrix_null(&tmp_mat); \
    fors_matrix_null(&result_polyf); \
    fors_matrix_null(&result_cov_polyf); \
    fors_matrix_null(&result_params); \
    fors_matrix_null(&result_cov_params); \
    fors_matrix_null(&result_polyp); \
    fors_matrix_null(&result_cov_polyp); \
    cpl_polynomial_delete(polyf); polyf = NULL; \
    cpl_polynomial_delete(polyf_definition); polyf_definition = NULL; \
    cpl_polynomial_delete(polyf_variance); polyf_variance = NULL; \
    cpl_polynomial_delete(polyp); polyp = NULL; \
    cpl_polynomial_delete(polyp_definition); polyp_definition = NULL; \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    fors_std_star_delete(&std_star); \
    cpl_propertylist_delete(header); header = NULL; \
    cpl_table_delete(aligned_phot); aligned_phot = NULL; \
    fors_setting_delete(&setting_f); \
    fors_delete_star_lists(&obs, std_star_list); \
    fors_star_delete_but_standard(&obs_star); \
    fors_std_star_delete(&std_star); \
    \
    *n_frames = 0; \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    cpl_array_delete(n_obs_per_std); n_obs_per_std = NULL; \
    fors_std_star_list_delete(&std_list_copy, NULL); \
    entry_list_delete(&obs_list_copy, NULL); \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    cpl_array_unwrap(n_obs_a); n_obs_a = NULL; \
    cpl_free(n_obs); n_obs = NULL; \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    fors_matrix_null(&lhs); \
    if (n_fit_e_cols != NULL) \
        *n_fit_e_cols = 0; \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    fors_matrix_null(&mat); \
    cpl_array_delete(Apowers); Apowers = NULL; \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.

#define cleanup

Value:

do { \
    fors_matrix_null(&rhs_input_cov); \
    fors_matrix_null(&rhs_jacobian); \
    fors_matrix_null(&rhs_input); \
    fors_matrix_null(&rhs_jacobian_T); \
    fors_matrix_null(&tmp_matrix); \
    fors_matrix_null(rhs); \
    fors_matrix_null(rhs_cov); \
} while (0)

Definition at line 3703 of file fors_photometry_impl.c.


Function Documentation

entry * entry_new ( int  frame_index,
int  star_index,
double  airmass,
double  gain,
double  exptime,
int  atm_ext_identifier,
fors_star star 
)

entry constructor

Parameters:
star ownership is transferred, so deallocate only using entry_delete

Definition at line 289 of file fors_photometry_impl.c.

Referenced by fors_photometry_read_input().

void entry_delete ( entry **  e  ) 

Destructor.

Parameters:
e to delete

Definition at line 320 of file fors_photometry_impl.c.

References fors_star_delete().

Referenced by fors_delete_star_lists().

static void entry_delete_but_standard ( entry **  e  )  [static]

Destructor.

Parameters:
e to delete

Definition at line 336 of file fors_photometry_impl.c.

References fors_star_delete_but_standard().

Referenced by fors_photometry(), and fors_photometry_remove_unnecessary().

void entry_list_print ( const entry_list *  l,
cpl_msg_severity  level 
)

Print list.

Parameters:
l to print
level message level

Definition at line 354 of file fors_photometry_impl.c.

References entry::airmass, entry::exptime, fors_star_print(), entry::frame_index, entry::gain, entry::star, and entry::star_index.

Referenced by fors_photometry().

static entry_list * fors_photometry_read_input ( const cpl_frameset *  alphot_frames,
const fors_setting setting,
int(*)(const cpl_propertylist *header)  get_atm_ext_id_function,
bool  import_unknown,
int *  n_frames,
fors_std_star_list **  std_star_list,
int  filter 
) [static]

Read input data from aligned phot tables.

Parameters:
alphot_frames Input frames
setting Instrument setting
get_atm_ext_id_function Function to create an identifier for the atmospheric extinction by frame header
import_unknown Flag whether to import also untrusted and non-standard stars
n_frames (Output) number of frames
std_star_list (Output) list of standard stars
Returns:
set of observations
We match by (RA, DEC) and tolerance, not by OBJECT string which is not unique across different catalogs.

Definition at line 2756 of file fors_photometry_impl.c.

References arcsec_tol, assure, _fors_setting::average_gain, cleanup, _fors_star::dmagnitude, entry_new(), _fors_setting::exposure_time, fors_extract_check_sex_star(), fors_photometry_read_input_listinsert_star_if_new(), fors_setting_delete(), fors_setting_verify(), fors_star_delete_but_standard(), fors_star_new_from_table(), fors_type_get_string(), _fors_star::id, entry::star, entry::star_index, and _fors_std_star::trusted.

Referenced by fors_photometry().

static fors_std_star * fors_photometry_read_input_listinsert_star_if_new ( fors_std_star_list *  std_list,
fors_std_star *  std,
double  mind_arcsec 
) [static]

Insert a std star into a list, if the closest existing distance > maxd_arcsec.

Parameters:
std_list Standard star list
std Standard star to test
mind_arcsec Minimum distance in arc seconds
Returns:
Pointer either to input star or to list star
In the case that the std star is already found in the standard star list, the input std star object is deleted.

In the case of error, the input star is not deleted and its pointer is returned.

Definition at line 3102 of file fors_photometry_impl.c.

Referenced by fors_photometry_read_input().

static void fors_delete_star_lists ( entry_list **  el,
fors_std_star_list **  sl 
) [static]

Delete a fors_std_star_list and an entry list referring to it.

Parameters:
el Entry list
sl Standard star list
Returns:
Nothing

Definition at line 414 of file fors_photometry_impl.c.

References entry_delete(), _fors_star::id, and entry::star.

static bool fors_fits_compare_string ( const char *  s1,
const char *  s2 
) [static]

Compare two strings while ignoring trailing blanks.

Parameters:
s1 String 1
s2 String 2
Returns:
true if identic, otherwise false
A NULL input is treated as "".

Definition at line 443 of file fors_photometry_impl.c.

Referenced by fors_photometry_get_timezone_observer().

static void fors_matrix_null ( cpl_matrix **  m  )  [static]

Delete a cpl_matrix and set the pointer to NULL.

Parameters:
m Matrix to delete
Returns:
Nothing

Definition at line 480 of file fors_photometry_impl.c.

Referenced by build_equations_rhs_cov(), fors_matrix_append_delete(), fors_photometry(), and solve_normal().

void fors_photometry_define_parameters ( cpl_parameterlist *  parameters  ) 

Define recipe parameters.

Parameters:
parameters parameter list to fill

Definition at line 669 of file fors_photometry_impl.c.

References fors_photometry_name.

Referenced by fors_photometry_create(), and test_photometry().

static cpl_polynomial * fors_photometry_define_polyf ( int  degreef1,
int  degreef2 
) [static]

Create a polynomial containing the desired coefficients (set to 1).

Parameters:
degreef1 Degree in x (>= 0)
degreef2 Degree in y, or negative for triangular coefficient matrix.
Returns:
The polynomial, NULL in the case of error
Note:
This function should contain the only definition of the shape of the f polynomial (according to the manual).

Definition at line 805 of file fors_photometry_impl.c.

References assure, cleanup, fors_polynomial_count_coeff(), and fors_polynomial_dump().

Referenced by fors_photometry().

static cpl_polynomial * fors_photometry_define_polyp ( int  degreep  )  [static]

Create a 2-dim polynomial with the desired coefficients (set to 1).

Parameters:
degreep Total Degree
Returns:
The polynomial, NULL in the case of error
The first dimension refers to the airmass, the second to the color.

Note:
This function should contain the only definition of the shape of the p polynomial (according to the manual).

Definition at line 885 of file fors_photometry_impl.c.

References assure, cleanup, fors_polynomial_count_coeff(), and fors_polynomial_dump().

Referenced by fors_photometry().

static cpl_error_code fors_photometry_poly_new_from_coefficients ( const cpl_polynomial *  p_def,
const cpl_matrix *  coeffs,
const cpl_matrix *  cov_coeffs,
cpl_polynomial **  poly,
cpl_polynomial **  var_poly 
) [static]

Create a polynomial from a definition and a coefficients container.

Parameters:
p_def Polynomial definition (using non-zero coeffs)
coeffs Column vector (N x 1) containing the coefficients in the order defined by the functions fors_polynomial_*(), ignored if p_def contains no non-zero coefficients
cov_coeffs (Optional) covariance matrix (N x N) of the coefficients in the order defined by the functions fors_polynomial_*(), ignored if p_def contains no non-zero coefficients or if var_poly == NULL
poly Output polynomial
var_poly (Optional) output variance polynomial

Definition at line 952 of file fors_photometry_impl.c.

References cleanup, fors_polynomial_count_coeff(), fors_polynomial_create_variance_polynomial(), and fors_polynomial_set_existing_coeff().

Referenced by fors_photometry().

int fors_photometry_get_timezone_observer ( const cpl_propertylist *  header  ) 

Return the timezone of the observer in hours against UT.

Parameters:
header Frame header
Returns:
Number of hours in the range [-12 ... +12]

Definition at line 1039 of file fors_photometry_impl.c.

References fors_fits_compare_string().

Referenced by fors_photometry_get_night_id().

int fors_photometry_get_night_id ( const cpl_propertylist *  header  ) 

Get a unique identifier for the night of the observation.

Parameters:
header Frame header
Returns:
ID
In the case of error, the output ID is undefined.

Definition at line 1092 of file fors_photometry_impl.c.

References assure, fors_photometry_get_timezone_observer(), and fors_property_get_num().

Referenced by fors_photometry().

static int fors_photometry_atm_ext_create_index_by_identifier ( entry_list *  obs_list  )  [static]

Collect all atm. extinction identifiers and create the indices.

Parameters:
obs_list Observation list
Number of indices (= max index + 1), 0 in the case of error
The indices are created counting from zero, and in the order their identifiers appear.

Definition at line 1170 of file fors_photometry_impl.c.

References entry::atm_ext_identifier, and entry::atm_ext_index.

Referenced by fors_photometry_atm_ext_create_indices().

static int fors_photometry_atm_ext_create_indices ( entry_list *  obsl,
fors_fit_ncoeff  fit_e 
) [static]

Create all atmospheric extinction indices.

Parameters:
obsl Observation list
fit_e How many atmospheric extinctions to fit
Returns:
Number of atmospheric extinction indices, -1 in the case of error
The following indices in the entries of obs_list are set:

If fit_e is neither FORS_FIT_NCOEFF_NO nor FORS_FIT_NCOEFF_ONE nor FORS_FIT_NCOEFF_PERFRAME, then the atmospheric extinction identifier in the entries of obs_list must be set, otherwise the atmospheric extinction indices will contain garbage.

Definition at line 1243 of file fors_photometry_impl.c.

References entry::atm_ext_index, fors_photometry_atm_ext_create_index_by_identifier(), and entry::frame_index.

Referenced by fors_photometry().

static cpl_table * fors_photometry_atm_ext_print_index_by_framename ( const entry_list *  obs_list,
const cpl_frameset *  frames 
) [static]

Print the frame filenames for each atm. ext. index.

Parameters:
obs_list Observation list
frames Frameset used as reference for printing
CPL error code

Definition at line 1313 of file fors_photometry_impl.c.

References entry::atm_ext_index, and entry::frame_index.

Referenced by fors_photometry().

static cpl_error_code fors_photometry_check_input_value ( double  value,
double  value_error,
const char *  value_name,
const char *  input_name,
double  min_limit,
double  max_limit,
double  max_error 
) [static]

Check input value and its error to stay in a range.

Parameters:
value Input value to check
value_error Input value's uncertainty (1 sigma) to check
value_name Input value's name to use in error messages
input_name Input's name (e.g. filename) to use in error messages
min_limit Minimum limit for value
max_limit Maximum limit for value
max_error Maximum limit for value_error
Returns:
CPL error code
As a minimum limit for value_error, 0 is supposed.

Definition at line 1447 of file fors_photometry_impl.c.

Referenced by fors_photometry().

static cpl_error_code fors_photometry_check_fitparam_atm_ext ( entry_list *  obsl,
fors_fit_ncoeff  fit_e,
bool  fit_z 
) [static]

Check whether fitting is possible (see below).

Parameters:
fit_e How many atmospheric extinctions to fit
fit_z Flag whether to fit the zeropoint
Returns:
CPL error code

Definition at line 1522 of file fors_photometry_impl.c.

References entry::airmass, and entry::atm_ext_index.

Referenced by fors_photometry().

static cpl_error_code fors_photometry_remove_unnecessary ( fors_std_star_list *  std_list,
entry_list *  obs_list,
int *  n_mag_fits 
) [static]

Remove all standard stars which are fitted but were observed only once.

Parameters:
std_list Standard star list (modified)
obs_list Observation list (modified)
n_mag_fits (Output) number of remaining untrusted std stars
Returns:
CPL error code

Definition at line 3249 of file fors_photometry_impl.c.

References assure, cleanup, entry_delete_but_standard(), fors_photometry_count_observations(), _fors_star::id, entry::star, and entry::star_index.

Referenced by fors_photometry().

static cpl_array * fors_photometry_count_observations ( fors_std_star_list *  std_list,
entry_list *  obs_list 
) [static]

Count the number of observations of each standard star.

Parameters:
std_list Standard star list
obs_list Observation list
Returns:
Array of type CPL_TYPE_INT and the same size as std_list, NULL in the case of error.

Definition at line 3379 of file fors_photometry_impl.c.

References entry::star_index.

Referenced by fors_photometry(), and fors_photometry_remove_unnecessary().

static cpl_matrix * build_equations_lhs_matrix_from_parameters ( const entry_list *  obs_list,
const fors_std_star_list *  std_list,
bool  fit_z,
bool  fit_c,
int *  n_fit_e_cols 
) [static]

Build left hand side matrix equation part.

Parameters:
obs_list List of star observations
std_list List of std. stars
fit_z fit zeropoint?
fit_c fit color coeff.?
n_fit_e_cols (Optional) output number of atmospheric extinctions
Returns:
Matrix
Details:
  • This function returns NULL, if the number of parameters is 0 (i.e. if nothing is to be fitted here), without setting an error.
Atmospheric Extinctions:
  • This function creates as many columns for atmospheric extinctions as there are indices for atmospheric extinction found in obs_list (the number can be zero).
  • The atmospheric extinction indices (if one should be valid) must count from zero and must not lack numbers inbetween (unchecked).
  • Indices < 0 do not contribute, obs_list entries with an index < 0 will get a row of zeros in these columns.
  • The number of created columns for the individual atmospheric extinctions is returned via n_fit_e_cols.

Definition at line 3446 of file fors_photometry_impl.c.

References entry::airmass, assure, entry::atm_ext_index, cleanup, entry::frame_index, _fors_star::id, entry::star, and entry::star_index.

Referenced by fors_photometry().

static cpl_matrix * build_equations_lhs_matrix_from_poly ( const entry_list *  obs_list,
const cpl_polynomial *  poly,
const char *  pname,
double(*)(const entry *, const cpl_array *)  powerfunc 
) [static]

Build polynomial fitting matrix with coefficients represented in columns.

Parameters:
obs_list Observation list
poly Polynomial definition
pname (Optional) name of the polynomial for debug messages
powerfunc Function to evaluate a combination of powers
Returns:
Matrix, NULL if the polynomial contains no non-zero coefficients
Principle:
  • For every observation in obs_list, a matrix row is created,
  • for every non-zero coefficient in poly, a matrix column is created,
  • looping through the existing coefficients (first dimension is fastest index), the fitting value is inserted into the respective matrix element calling powerfunc with the coefficient'c combination of powers,
  • where the powers are provided as a cpl_array whose size equals the number of dimensions of poly,
  • if poly has no non-zero coefficients, then NULL is returned.

Definition at line 3624 of file fors_photometry_impl.c.

References assure, fors_polynomial_count_coeff(), fors_polynomial_powers_find_first_coeff(), fors_polynomial_powers_find_next_coeff(), and fors_polynomial_sprint_coeff().

Referenced by fors_photometry().

static cpl_error_code build_equations_rhs_cov ( const entry_list *  obs_list,
const fors_std_star_list *  std_list,
bool  fit_z,
bool  fit_c,
bool  fit_e,
double  color_coeff,
double  dcolor_coeff,
double  ext_coeff,
double  dext_coeff,
double  zpoint,
double  dzpoint,
cpl_matrix **  rhs,
cpl_matrix **  rhs_cov 
) [static]

Build right hand side matrix equation part.

Parameters:
obs_list List of star observations
std_list List of std. stars
fit_z fit zeropoint?
fit_c fit color coeff.?
fit_e fit extinction coeff.?
color_coeff color coefficient
dcolor_coeff color coefficient error
ext_coeff extinction coefficient
dext_coeff ext_coeff error
rhs (output) right hand side
rhs_cov (output) covariance of rhs
Returns:
CPL error code

Definition at line 3730 of file fors_photometry_impl.c.

References entry::airmass, cleanup, _fors_star::dmagnitude, entry::exptime, fors_matrix_null(), entry::gain, _fors_star::id, _fors_star::magnitude, entry::star, and entry::star_index.

Referenced by fors_photometry().

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

Do the processing.

Parameters:
frames input frames
parameters recipe parameters
Returns:
0 if everything is ok

Definition at line 1876 of file fors_photometry_impl.c.

References assure, build_equations_lhs_matrix_from_parameters(), build_equations_lhs_matrix_from_poly(), build_equations_rhs_cov(), cleanup, entry_delete_but_standard(), entry_get_powers_airmass_color(), entry_get_powers_x_y(), entry_list_print(), fors_dfs_save_image(), fors_dfs_save_table(), fors_frameset_extract(), fors_image_divide_scalar(), fors_image_exponential(), fors_image_get_median(), fors_image_get_size_x(), fors_image_get_size_y(), fors_image_load(), fors_image_multiply(), fors_image_multiply_scalar(), fors_image_new(), fors_matrix_append_delete(), fors_matrix_null(), fors_photometry_adjust_fit_mag_flags(), fors_photometry_atm_ext_create_indices(), fors_photometry_atm_ext_print_index_by_framename(), fors_photometry_check_fitparam_atm_ext(), fors_photometry_check_input_value(), fors_photometry_count_observations(), fors_photometry_define_polyf(), fors_photometry_define_polyp(), fors_photometry_get_night_id(), fors_photometry_name, fors_photometry_parameter_get_ncoeff(), fors_photometry_parameter_get_num(), fors_photometry_poly_new_from_coefficients(), fors_photometry_read_input(), fors_photometry_remove_unnecessary(), fors_polynomial_dump(), fors_qc_dic_version, fors_qc_end_group(), fors_qc_start_group(), fors_qc_write_qc_double(), fors_setting_new(), _fors_setting::instrument, and solve_normal().

Referenced by fors_photometry_exec(), and test_photometry().

int cpl_plugin_get_info ( cpl_pluginlist *  list  ) 

Build the list of available plugins, for this module.

Parameters:
list The 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_photometry.c.

References fors_get_version_binary(), fors_license, fors_photometry_author, fors_photometry_create(), fors_photometry_description, fors_photometry_description_short, fors_photometry_destroy(), fors_photometry_email, fors_photometry_exec(), and fors_photometry_name.

static int fors_photometry_create ( cpl_plugin *  plugin  )  [static]

Setup the recipe options.

Parameters:
plugin The plugin
Returns:
0 if everything is ok
Defining the command-line/configuration parameters for the recipe.

Definition at line 109 of file fors_photometry.c.

References fors_photometry_define_parameters().

Referenced by cpl_plugin_get_info().

static int fors_photometry_exec ( cpl_plugin *  plugin  )  [static]

Execute the plugin instance given by the interface.

Parameters:
plugin the plugin
Returns:
0 if everything is ok

Definition at line 158 of file fors_photometry.c.

References fors_begin(), fors_end(), fors_photometry(), and fors_photometry_description_short.

Referenced by cpl_plugin_get_info().

static int fors_photometry_destroy ( cpl_plugin *  plugin  )  [static]

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

Parameters:
plugin The plugin
Returns:
0 if everything is ok

Definition at line 207 of file fors_photometry.c.

Referenced by cpl_plugin_get_info().


Variable Documentation

const char* const fors_photometry_description

Initial value:

 
"Input files:\n"
"  DO category:               Type:       Explanation:             Number:\n"
"  PHOT_TABLE                 FITS table  Expected extinction params  1\n"
"  ALIGNED_PHOT               FITS table  Photometry                  1+\n"
"  MASTER_SKY_FLAT_IMG        FITS image  Master flat field           1\n"
"\n"
"Output files:\n"
"  DO category:               Data type:  Explanation:\n"
"  PHOT_COEFF_TABLE           FITS image  Observed extinction coefficients\n"
"  CORRECTION_MAP             FITS image  Correction map (magnitude)\n"
"  CORRECTION_FACTOR          FITS image  Correction map (flux)\n"
"  MASTER_FLAT_IMG            FITS image  Corrected master flat field\n"

Definition at line 60 of file fors_photometry_impl.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