Common Pipeline Library Reference Manual
5.3.1
|
Functions | |
void | cpl_stats_delete (cpl_stats *stats) |
Free memory associated to an cpl_stats object. | |
cpl_error_code | cpl_stats_dump (const cpl_stats *self, unsigned bitmask, FILE *stream) |
Dump a cpl_stats object. | |
double | cpl_stats_get_absflux (const cpl_stats *in) |
Get the absolute flux from a cpl_stats object. | |
double | cpl_stats_get_centroid_x (const cpl_stats *in) |
Get the x centroid position from a cpl_stats object. | |
double | cpl_stats_get_centroid_y (const cpl_stats *in) |
Get the y centroid position from a cpl_stats object. | |
double | cpl_stats_get_flux (const cpl_stats *in) |
Get the flux from a cpl_stats object. | |
double | cpl_stats_get_max (const cpl_stats *in) |
Get the maximum from a cpl_stats object. | |
int | cpl_stats_get_max_x (const cpl_stats *in) |
Get the maximum x position from a cpl_stats object. | |
int | cpl_stats_get_max_y (const cpl_stats *in) |
Get the maximum y position from a cpl_stats object. | |
double | cpl_stats_get_mean (const cpl_stats *in) |
Get the mean from a cpl_stats object. | |
double | cpl_stats_get_median (const cpl_stats *in) |
Get the median from a cpl_stats object. | |
double | cpl_stats_get_median_dev (const cpl_stats *in) |
Get the median deviation from a cpl_stats object. | |
double | cpl_stats_get_min (const cpl_stats *in) |
Get the minimum from a cpl_stats object. | |
int | cpl_stats_get_min_x (const cpl_stats *in) |
Get the minimum x position from a cpl_stats object. | |
int | cpl_stats_get_min_y (const cpl_stats *in) |
Get the minimum y position from a cpl_stats object. | |
int | cpl_stats_get_npix (const cpl_stats *in) |
Get the number of pixels from a cpl_stats object. | |
double | cpl_stats_get_sqflux (const cpl_stats *in) |
Get the sum of the squared values from a cpl_stats object. | |
double | cpl_stats_get_stdev (const cpl_stats *in) |
Get the std. dev. from a cpl_stats object. | |
cpl_stats * | cpl_stats_new_from_image (const cpl_image *image, unsigned bitmask) |
Compute various statistics of an image. | |
cpl_stats * | cpl_stats_new_from_image_window (const cpl_image *image, unsigned bitmask, int llx, int lly, int urx, int ury) |
Compute various statistics of an image sub-window. |
This module provides functions to handle the cpl_stats object. This object can contain the statistics that have been computed from different CPL objects. Currently, only the function that computes statistics on images (or images windows) is provided.
#include "cpl_stats.h"
void cpl_stats_delete | ( | cpl_stats * | stats | ) |
Free memory associated to an cpl_stats object.
stats | the object to delete |
Frees all memory associated to a cpl_stats object. If the object stats is NULL
, nothing is done and no error is set.
cpl_error_code cpl_stats_dump | ( | const cpl_stats * | self, |
unsigned | bitmask, | ||
FILE * | stream | ||
) |
Dump a cpl_stats object.
self | cpl_stats object to dump |
bitmask | Defines which parameters have to be dumped. |
stream | The output stream |
It is an error to request parameters that have not been set.
Possible _cpl_error_code_ set in this function:
double cpl_stats_get_absflux | ( | const cpl_stats * | in | ) |
Get the absolute flux from a cpl_stats object.
in | the cpl_stats object |
double cpl_stats_get_centroid_x | ( | const cpl_stats * | in | ) |
Get the x centroid position from a cpl_stats object.
in | the cpl_stats object |
double cpl_stats_get_centroid_y | ( | const cpl_stats * | in | ) |
Get the y centroid position from a cpl_stats object.
in | the cpl_stats object |
double cpl_stats_get_flux | ( | const cpl_stats * | in | ) |
Get the flux from a cpl_stats object.
in | the cpl_stats object |
double cpl_stats_get_max | ( | const cpl_stats * | in | ) |
Get the maximum from a cpl_stats object.
in | the cpl_stats object |
int cpl_stats_get_max_x | ( | const cpl_stats * | in | ) |
Get the maximum x position from a cpl_stats object.
in | the cpl_stats object |
Possible _cpl_error_code_ set in this function:
int cpl_stats_get_max_y | ( | const cpl_stats * | in | ) |
Get the maximum y position from a cpl_stats object.
in | the cpl_stats object |
Possible _cpl_error_code_ set in this function:
double cpl_stats_get_mean | ( | const cpl_stats * | in | ) |
Get the mean from a cpl_stats object.
in | the cpl_stats object |
double cpl_stats_get_median | ( | const cpl_stats * | in | ) |
Get the median from a cpl_stats object.
in | the cpl_stats object |
double cpl_stats_get_median_dev | ( | const cpl_stats * | in | ) |
Get the median deviation from a cpl_stats object.
in | the cpl_stats object |
double cpl_stats_get_min | ( | const cpl_stats * | in | ) |
Get the minimum from a cpl_stats object.
in | the cpl_stats object |
The call that created the cpl_stats object must have determined the minimum value.
In case of error, the _cpl_error_code_ code is set, and the returned double is undefined.
Possible _cpl_error_code_ set in this function:
int cpl_stats_get_min_x | ( | const cpl_stats * | in | ) |
Get the minimum x position from a cpl_stats object.
in | the cpl_stats object |
Possible _cpl_error_code_ set in this function:
int cpl_stats_get_min_y | ( | const cpl_stats * | in | ) |
Get the minimum y position from a cpl_stats object.
in | the cpl_stats object |
Possible _cpl_error_code_ set in this function:
int cpl_stats_get_npix | ( | const cpl_stats * | in | ) |
Get the number of pixels from a cpl_stats object.
in | the cpl_stats object |
The creation of a cpl_stats object always causes the number of pixels to be determined.
Possible _cpl_error_code_ set in this function:
double cpl_stats_get_sqflux | ( | const cpl_stats * | in | ) |
Get the sum of the squared values from a cpl_stats object.
in | the cpl_stats object |
double cpl_stats_get_stdev | ( | const cpl_stats * | in | ) |
Get the std. dev. from a cpl_stats object.
in | the cpl_stats object |
cpl_stats* cpl_stats_new_from_image | ( | const cpl_image * | image, |
unsigned | bitmask | ||
) |
Compute various statistics of an image.
image | input image. |
bitmask | Defines which parameters have to be computed |
cpl_stats* cpl_stats_new_from_image_window | ( | const cpl_image * | image, |
unsigned | bitmask, | ||
int | llx, | ||
int | lly, | ||
int | urx, | ||
int | ury | ||
) |
Compute various statistics of an image sub-window.
image | Input image. |
bitmask | Defines which parameters have to be computed |
llx | Lower left x position (FITS convention) |
lly | Lower left y position (FITS convention) |
urx | Upper right x position (FITS convention) |
ury | Upper right y position (FITS convention) |
Compute various images statistics.
The specified bounds are included in the specified region. The user specifies the statistics he wants to get with a bitmask. Possible requested values are:
E.g. the bitmask would be CPL_STATS_MIN | CPL_STATS_MEDIAN in order to get the minimum and the median of the image.
In the case of CPL_STATS_MIN and CPL_STATS_MAX where more than one set of coordinates share the extremum it is undefined which of those coordinates will be returned.
Images can be CPL_TYPE_DOUBLE, CPL_TYPE_FLOAT, CPL_TYPE_INT.
For the CPL_STATS_CENTROID computation, if there are negative pixels, the minimum value is added to all the pixels in order to have all pixels with positive values for computation.
The returned object must be deallocated using cpl_stats_delete().
Possible _cpl_error_code_ set in this function: