|
MOONS Pipeline Reference Manual 0.13.2
|
Functions | |
| const char * | moo_get_license (void) |
| Get the pipeline copyright and license. | |
| cpl_image * | moo_compute_sigma_map (cpl_imagelist *list, cpl_imagelist *qlist, cpl_image *img) |
| Compute image of sigma variation. | |
| cpl_mask * | moo_kappa_sigma_clipping (cpl_image *sigma_img, int niter, double kappa, double cdiff, double maxfrac) |
| Compute mask of rejected pixels using kappa sigma algorithm. | |
| cpl_error_code | moo_barycenter_fit (cpl_bivector *points, double *center, double *width) |
| Fit positions using weighted fluxes. | |
| cpl_error_code | moo_gaussian_fit (cpl_bivector *points, cpl_fit_mode fit_pars, double *center, double *width, double *background, double *area) |
| Fit the data with a gaussian. | |
| double | moo_gaussian_eval (double x, double x0, double sigma, double offset, double area) |
| Evaluate the gaussian at the given x position. | |
| cpl_error_code | moo_gaussian_eval_inv (double y, double x0, double sigma, double offset, double area, double *x1, double *x2) |
| Find the x positions of the gaussian at the given y position. | |
| cpl_error_code | moo_find_threshold_limits (cpl_bivector *points, double threshold, double *xmin, double *xmax) |
| Find threshold limits of a 1D signal. | |
| moo_tcheby_polynomial * | moo_tcheby_polynomial_fit (cpl_bivector *data, int degree, double xmin, double xmax) |
| Computes Tchebitchev transformation of data. | |
| moo_tcheby2d_polynomial * | moo_tcheby2d_polynomial_fit (cpl_vector *in_x, int xdegree, double xmin, double xmax, cpl_vector *in_y, int ydegree, double ymin, double ymax, cpl_vector *in_l, double lmin, double lmax) |
| Computes Tchebitchev transformation of data. | |
| cpl_error_code | moo_tchebychev_fit (cpl_bivector *data, int *flag, int degree, double xmin, double xmax, double ymin, double ymax) |
| Computes Tchebitchev transformation of data. | |
| double | moo_vector_get_min (const cpl_vector *v, int *flags) |
| Find minimum values in a vector using flags. | |
| double | moo_vector_get_max (const cpl_vector *v, int *flags) |
| Find maximum values in a vector using flags. | |
| cpl_error_code | moo_interpolate_linear (cpl_bivector *fout, cpl_vector *fout_errs, int *fout_qual, const cpl_bivector *fref, const cpl_vector *fref_errs, const int *fref_qual) |
| Linear interpolation of a 1d-function. | |
| double | moo_vector_get_percentile (cpl_vector *v, double f) |
| Get percentile of input vector. | |
| cpl_vector * | moo_vector_filter_nan (cpl_vector *v) |
| Create new vector with nan values filter. | |
| cpl_bivector * | moo_bivector_filter_nan (cpl_bivector *v) |
| Create new bi vector with nan values filter. | |
| hdrl_image * | moo_image_collapse_median_create (hdrl_image *image) |
| Collapse row of an image using a median and compute associate error. | |
| double | moo_sky_distance (double alpha1, double delta1, double alpha2, double delta2) |
| Compute sky distance (in rad) | |
| cpl_error_code | moo_fit_mul (const cpl_vector *vx, const cpl_vector *vw, const cpl_vector *vy, const cpl_vector *vy_err, double *c, double *sig_c) |
| This function computes the best-fit linear regression coefficient c1 of the model Y = c_1 X for the weighted datasets (x, y) | |
| cpl_vector * | moo_savgol_filter (cpl_vector *v, int window_length, int polyorder) |
| Apply a Savitzky-Golay filter to a vector. | |
| cpl_vector * | moo_median_filter (cpl_vector *v, int winhsize) |
| Apply a median filter to a vector. | |
| cpl_image * | moo_imagelist_collapse_bitwiseor (cpl_imagelist *list, hdrl_imagelist *datalist) |
| get the QUAL resulting in a bitwise OR operation on the QUAL list | |
| double | moo_image_get_ron (cpl_image *diff, int llx, int lly, int urx, int ury, int nb_boxes, int box_hsize, double max_error_frac, int max_niter) |
| compute ron in a diff image using boxes | |
| cpl_error_code | moo_image_get_quartile (cpl_image *image, double *qmin, double *qmax) |
| compute first and last quartile from an image | |
| double | moo_vector_get_dersnr (const cpl_vector *ve) |
| This function computes the signal to noise ratio DER_SNR following the definition set forth by the Spectral Container Working Group of ST-ECF, MAST and CADC. | |
| int | moo_string_is_strictly_equal (const char *a, const char *b) |
| This function compares to string to see if the two string are stricly equal. | |
| cpl_size | moo_table_or_selected_sequal_string (cpl_table *table, const char *name, const char *string) |
| Select from unselected table rows, by comparing column values with a constant. | |
| cpl_size | moo_table_and_selected_sequal_string (cpl_table *table, const char *name, const char *string) |
| Select from unselected table rows, by comparing column values with a constant. | |
| cpl_error_code moo_barycenter_fit | ( | cpl_bivector * | points, |
| double * | center, | ||
| double * | width | ||
| ) |
Fit positions using weighted fluxes.
| points | to fit (ordered ASC) |
| center | the fitted center |
| width | the width |
Possible cpl_error_code set in this function:
Definition at line 254 of file moo_utils.c.
| cpl_bivector * moo_bivector_filter_nan | ( | cpl_bivector * | v | ) |
Create new bi vector with nan values filter.
| v | input bivector |
Definition at line 1343 of file moo_utils.c.
| cpl_image * moo_compute_sigma_map | ( | cpl_imagelist * | list, |
| cpl_imagelist * | qlist, | ||
| cpl_image * | img | ||
| ) |
Compute image of sigma variation.
| list | list of images to compare to reference image |
| qlist | list of QUAL images to ignore badpixel in computation og sigma |
| img | reference image |
Possible cpl_error_code set in this function:
Definition at line 100 of file moo_utils.c.
References MOO_BADPIX_GOOD.
Referenced by moo_single_compute_noise_map().
| cpl_error_code moo_find_threshold_limits | ( | cpl_bivector * | points, |
| double | threshold, | ||
| double * | xmin, | ||
| double * | xmax | ||
| ) |
Find threshold limits of a 1D signal.
| points | data to analyse |
| threshold | the threshold |
| xmin | [OUT] minimum X position of the threshold |
| xmax | [OUT] maximum X position of the threshold |
Definition at line 423 of file moo_utils.c.
| cpl_error_code moo_fit_mul | ( | const cpl_vector * | vx, |
| const cpl_vector * | vw, | ||
| const cpl_vector * | vy, | ||
| const cpl_vector * | vy_err, | ||
| double * | c, | ||
| double * | sig_c | ||
| ) |
This function computes the best-fit linear regression coefficient c1 of the model Y = c_1 X for the weighted datasets (x, y)
| vx | |
| vw | |
| vy | |
| vy_err | |
| c | fit result |
| sig_c | error on fit |
Definition at line 1567 of file moo_utils.c.
| double moo_gaussian_eval | ( | double | x, |
| double | x0, | ||
| double | sigma, | ||
| double | offset, | ||
| double | area | ||
| ) |
Evaluate the gaussian at the given x position.
| x | x position |
| x0 | center of gaussian. |
| sigma | width of gaussian |
| offset | background level of gaussian |
| area | area of gaussian |
Definition at line 348 of file moo_utils.c.
| cpl_error_code moo_gaussian_eval_inv | ( | double | y, |
| double | x0, | ||
| double | sigma, | ||
| double | offset, | ||
| double | area, | ||
| double * | x1, | ||
| double * | x2 | ||
| ) |
Find the x positions of the gaussian at the given y position.
| y | y position |
| x0 | center of gaussian. |
| sigma | width of gaussian |
| offset | background level of gaussian |
| area | area of gaussian |
| x1 | [OUT] first x solution (minimum) |
| x2 | [OUT] second x solution (maximum) |
Definition at line 373 of file moo_utils.c.
| cpl_error_code moo_gaussian_fit | ( | cpl_bivector * | points, |
| cpl_fit_mode | fit_pars, | ||
| double * | center, | ||
| double * | width, | ||
| double * | background, | ||
| double * | area | ||
| ) |
Fit the data with a gaussian.
| points | the data to fit |
| fit_pars | specifies which parameters participate in the fit (any other parameters will be held constant). Possible values are CPL_FIT_CENTROID, CPL_FIT_STDEV, CPL_FIT_AREA, CPL_FIT_OFFSET and any bitwise combination of these. As a shorthand for including all four parameters in the fit, use CPL_FIT_ALL. |
| center | [OUT] center of the fitted gaussian |
| width | [OUT] width of the fitted gaussian |
| background | [OUT] background of the fitted gaussian |
| area | [OUT] area of the fitted gaussian |
Definition at line 309 of file moo_utils.c.
| const char * moo_get_license | ( | void | ) |
Get the pipeline copyright and license.
The function returns a pointer to the statically allocated license string. This string should not be modified using the returned pointer.
Definition at line 81 of file moo_utils.c.
| hdrl_image * moo_image_collapse_median_create | ( | hdrl_image * | image | ) |
Collapse row of an image using a median and compute associate error.
| image | input image |
Definition at line 1386 of file moo_utils.c.
| cpl_error_code moo_image_get_quartile | ( | cpl_image * | image, |
| double * | qmin, | ||
| double * | qmax | ||
| ) |
compute first and last quartile from an image
| image | input image |
| qmin | the first quartile |
| qmax | the last quartile |
Possible error code :
Definition at line 1906 of file moo_utils.c.
| double moo_image_get_ron | ( | cpl_image * | diff, |
| int | llx, | ||
| int | lly, | ||
| int | urx, | ||
| int | ury, | ||
| int | nb_boxes, | ||
| int | box_hsize, | ||
| double | max_error_frac, | ||
| int | max_niter | ||
| ) |
compute ron in a diff image using boxes
| diff | input diff image |
| llx | lower left x coord |
| lly | lower left y coord |
| urx | upper right x coord |
| ury | upper right y coord |
| nb_boxes | number of boxes |
| box_hsize | half size of a box |
| max_error_frac | max error fraction on ron |
| max_niter | max number of iteration to find ron |
Possible error code :
Definition at line 1863 of file moo_utils.c.
| cpl_image * moo_imagelist_collapse_bitwiseor | ( | cpl_imagelist * | list, |
| hdrl_imagelist * | datalist | ||
| ) |
get the QUAL resulting in a bitwise OR operation on the QUAL list
| list | image list |
| datalist | the image data list |
Possible error code :
Definition at line 1791 of file moo_utils.c.
Referenced by moo_coadd().
| cpl_error_code moo_interpolate_linear | ( | cpl_bivector * | fout, |
| cpl_vector * | fout_errs, | ||
| int * | fout_qual, | ||
| const cpl_bivector * | fref, | ||
| const cpl_vector * | fref_errs, | ||
| const int * | fref_qual | ||
| ) |
Linear interpolation of a 1d-function.
| fout | Preallocated with X-vector set, to hold interpolation in Y |
| fout_errs | Preallocated to hold interpolation in Y errs |
| fout_qual | Preallocated to hold interpolation in Y qual |
| fref | Reference 1d-function |
| fref_errs | Reference 1d-function errs |
| fref_qual | Reference 1d-function qual |
fref must have both its abscissa and ordinate defined. fout must have its abscissa defined and its ordinate allocated.
The linear interpolation will be done from the values in fref to the abscissa points in fout.
For each abscissa point in fout, fref must either have two neigboring abscissa points such that xref_i < xout_j < xref{i+1}, or a single identical abscissa point, such that xref_i == xout_j.
This is ensured by monotonely growing abscissa points in both fout and fref (and by min(xref) <= min(xout) and max(xout) < max(xref)).
However, for efficiency reasons (since fref can be very long) the monotonicity is only verified to the extent necessary to actually perform the interpolation.
This input requirement implies that extrapolation is not allowed.
Possible cpl_error_code set in this function:
Definition at line 1160 of file moo_utils.c.
| cpl_mask * moo_kappa_sigma_clipping | ( | cpl_image * | sigma_img, |
| int | niter, | ||
| double | kappa, | ||
| double | cdiff, | ||
| double | maxfrac | ||
| ) |
Compute mask of rejected pixels using kappa sigma algorithm.
| sigma_img | image on which we used kappa sigma |
| niter | maximum number of iteration |
| kappa | multiple of sigma |
| cdiff | minimum relative change in sigma |
| maxfrac | maximum fraction of bad pixels allowed |
Possible cpl_error_code set in this function:
Definition at line 163 of file moo_utils.c.
Referenced by moo_single_compute_noise_map().
| cpl_vector * moo_median_filter | ( | cpl_vector * | v, |
| int | winhsize | ||
| ) |
Apply a median filter to a vector.
| v | input vector |
| winhsize | window half size |
Definition at line 1730 of file moo_utils.c.
Referenced by moo_compute_resp().
| cpl_vector * moo_savgol_filter | ( | cpl_vector * | v, |
| int | window_length, | ||
| int | polyorder | ||
| ) |
Apply a Savitzky-Golay filter to a vector.
| v | input vector |
| window_length | The length of the filter window (i.e. the number of coefficients). window_length must be a positive odd integer. |
| polyorder | The order of the polynomial used to fit the samples. polyorder must be less than window_length. |
Definition at line 1656 of file moo_utils.c.
| double moo_sky_distance | ( | double | alpha1, |
| double | delta1, | ||
| double | alpha2, | ||
| double | delta2 | ||
| ) |
Compute sky distance (in rad)
| alpha1 | alpha corrdinates of position 1 in degree |
| delta1 | delta corrdinates of position 1 in degree |
| alpha2 | alpha corrdinates of position 2 in degree |
| delta2 | delta corrdinates of position 2 in degree |
Definition at line 1417 of file moo_utils.c.
Referenced by moo_select_sky().
| int moo_string_is_strictly_equal | ( | const char * | a, |
| const char * | b | ||
| ) |
This function compares to string to see if the two string are stricly equal.
| a | first string to compare |
| b | second string to compare |
Definition at line 2233 of file moo_utils.c.
Referenced by moo_table_or_selected_sequal_string().
| cpl_size moo_table_and_selected_sequal_string | ( | cpl_table * | table, |
| const char * | name, | ||
| const char * | string | ||
| ) |
Select from unselected table rows, by comparing column values with a constant.
| table | Pointer to table |
| name | Column name |
| string | Reference value |
Definition at line 2317 of file moo_utils.c.
Referenced by moo_rebin().
| cpl_size moo_table_or_selected_sequal_string | ( | cpl_table * | table, |
| const char * | name, | ||
| const char * | string | ||
| ) |
Select from unselected table rows, by comparing column values with a constant.
| table | Pointer to table |
| name | Column name |
| string | Reference value |
Definition at line 2285 of file moo_utils.c.
References moo_string_is_strictly_equal().
Referenced by moo_target_table_find_index(), moo_target_table_find_target(), and moo_target_table_merge().
| moo_tcheby2d_polynomial * moo_tcheby2d_polynomial_fit | ( | cpl_vector * | in_x, |
| int | xdegree, | ||
| double | xmin, | ||
| double | xmax, | ||
| cpl_vector * | in_y, | ||
| int | ydegree, | ||
| double | ymin, | ||
| double | ymax, | ||
| cpl_vector * | in_l, | ||
| double | lmin, | ||
| double | lmax | ||
| ) |
Computes Tchebitchev transformation of data.
| in_x | X data between 1 - 4096 |
| xdegree | degree of 2D polynomial for X |
| xmin | the minimum x value |
| xmax | the maximum x value |
| in_y | Y data |
| ydegree | degree of 2D polynomial for Y |
| ymin | the minimum y value |
| ymax | the maximum y value |
| in_l | L data |
| lmin | the minimum l value |
| lmax | the maximum l value |
This function fit the input data using tchebitchev transformation.
Definition at line 667 of file moo_utils.c.
| moo_tcheby_polynomial * moo_tcheby_polynomial_fit | ( | cpl_bivector * | data, |
| int | degree, | ||
| double | xmin, | ||
| double | xmax | ||
| ) |
Computes Tchebitchev transformation of data.
| data | bivector containing data to fit |
| degree | degree used for polynomial fit |
| xmin | Minimum range along X axis |
| xmax | Maximum range along X axis |
This function fit the input data using tchebitchev transformation. The result replace the original values.
Definition at line 573 of file moo_utils.c.
| cpl_error_code moo_tchebychev_fit | ( | cpl_bivector * | data, |
| int * | flag, | ||
| int | degree, | ||
| double | xmin, | ||
| double | xmax, | ||
| double | ymin, | ||
| double | ymax | ||
| ) |
Computes Tchebitchev transformation of data.
| data | bivector containing data to fit |
| flag | array of flag (same size of data) |
| degree | degree used for polynomial fit |
| xmin | minimum value used in x part of data |
| xmax | maximum value used in x part of data |
| ymin | minmum value used in y part of data |
| ymax | maximum value used in y part of data |
This function fit the input data using tchebitchev transformation. The result replace the original values.
Definition at line 880 of file moo_utils.c.
| cpl_vector * moo_vector_filter_nan | ( | cpl_vector * | v | ) |
Create new vector with nan values filter.
| v | input vector |
Definition at line 1309 of file moo_utils.c.
| double moo_vector_get_dersnr | ( | const cpl_vector * | ve | ) |
This function computes the signal to noise ratio DER_SNR following the definition set forth by the Spectral Container Working Group of ST-ECF, MAST and CADC.
| ve | input flux |
Definition at line 2189 of file moo_utils.c.
Referenced by moo_ext_single_compute_snr().
| double moo_vector_get_max | ( | const cpl_vector * | v, |
| int * | flags | ||
| ) |
Find maximum values in a vector using flags.
| v | the vector to use |
| flags | array of flags (same size of v) |
Definition at line 1003 of file moo_utils.c.
| double moo_vector_get_min | ( | const cpl_vector * | v, |
| int * | flags | ||
| ) |
Find minimum values in a vector using flags.
| v | the vector to use |
| flags | array of flag (same size of v) |
Definition at line 979 of file moo_utils.c.
| double moo_vector_get_percentile | ( | cpl_vector * | v, |
| double | f | ||
| ) |
Get percentile of input vector.
| v | input vector |
| f | Fraction between 0 and 1 |
Definition at line 1263 of file moo_utils.c.