14 #ifndef CLIPM_PRIV_IMAGE_SIGNAL_H
15 #define CLIPM_PRIV_IMAGE_SIGNAL_H
50 #define clipm_priv_image_LOOP_GOOD_DATA_CONST( \
58 XACTION_ONLY_WITH_BPM) \
64 if (BADP_WDW != NULL) \
66 const cpl_binary *badp; \
67 for ( y = 0, data = DATA_WDW, badp = BADP_WDW; \
69 y++, data += IMSIZE_XY[0], badp += IMSIZE_XY[0]) \
72 for (x = 0; x < WDWSIZE_XY[0]; x++) \
76 XACTION_ONLY_WITH_BPM \
82 for ( y = 0, data = DATA_WDW; \
84 y++, data += IMSIZE_XY[0]) \
87 for (x = 0; x < WDWSIZE_XY[0]; x++) \
113 const cpl_image *img,
114 const double *xy_peakpos,
117 double *out_xy_middle,
118 double *out_xy_edge_sigma);
121 const cpl_image *img,
122 const cpl_size window_xxyy[4],
124 double initial_limits[],
128 double *out_kappasigma,
130 int *out_niterations);
133 const cpl_image *image,
134 const cpl_size window_xxyy[4],
137 cpl_size *out_nused);
140 const cpl_image *img,
141 const cpl_size window_xxyy[4],
142 const double *centre_xy,
148 double *centre_err_xy);
151 const cpl_size window_xxyy[4],
152 cpl_array **horizontal,
153 cpl_array **vertical,
154 cpl_array **x_weight_map,
155 cpl_array **y_weight_map);
158 const cpl_image *img,
159 const cpl_size window_xxyy[4],
164 const int window_xxyy[4],
165 cpl_image **contrib_sat);
168 const cpl_image *input,
169 const cpl_matrix *kernel,
170 const cpl_size window_xxyy[4],
175 const cpl_image *image,
176 const cpl_size window_xxyy[4],
180 const cpl_image *img,
181 const cpl_size window_xxyy[4],
183 cpl_size *out_nused);
186 const cpl_image *img,
cpl_error_code clipm_priv_image_get_kappa_sigma(const cpl_image *img, const cpl_size window_xxyy[4], double kappa, double initial_limits[], int nmax_iterations, double *out_mean, double *out_sigma, double *out_kappasigma, cpl_size *out_nused, int *out_niterations)
Determine mean and sigma by iteratively ignoring outliers.
Definition: clipm_priv_image_signal.c:1162
cpl_size clipm_priv_image_pixel_count_below(const cpl_image *img, const cpl_size window_xxyy[4], double limit, cpl_size *out_nbad)
Count all the pixels (strictly) below a given limit.
Definition: clipm_priv_image_signal.c:1862
double clipm_priv_image_get_mean_perimeter(const void *data, cpl_type type, double xc, double yc, double r, cpl_size xsize, cpl_size ysize, const cpl_binary *badp, cpl_size *nrpix)
Average values in a buffer along a perimeter.
Definition: clipm_priv_image_signal.c:85
cpl_error_code clipm_priv_image_estimate_fwhm_xy(const cpl_image *img, const double *xy_peakpos, double bg_level, double *out_xy_fwhm, double *out_xy_middle, double *out_xy_edge_sigma)
Estimate the FWHM of an object separable in x and y.
Definition: clipm_priv_image_signal.c:904
cpl_error_code clipm_priv_image_collapse(const cpl_image *image, const cpl_size window_xxyy[4], cpl_array **horizontal, cpl_array **vertical, cpl_array **x_weight_map, cpl_array **y_weight_map)
Collapse an image (by averaging) in both dimensions.
Definition: clipm_priv_image_signal.c:1663
cpl_error_code clipm_priv_image_get_psf_sigma(const cpl_image *img, const cpl_size window_xxyy[4], const double *centre_xy, double bg_level, double cut_lower, double cut_upper, double *sigma_xy, double gain, double *centre_err_xy)
Compute the sigma (RMS) of an object (i.e. the PSF).
Definition: clipm_priv_image_signal.c:1461
cpl_image * clipm_priv_image_conv_matrix(const cpl_image *input, const cpl_matrix *kernel, const cpl_size window_xxyy[4], int extend_bpm, int int2double)
Convolve an image with a kernel stored in a matrix.
Definition: clipm_priv_image_signal.c:2091
double clipm_priv_image_estimate_fwhm_round(const cpl_image *img, double x_peakpos, double y_peakpos, double bg_level)
Estimate the FWHM of a round object.
Definition: clipm_priv_image_signal.c:703
double clipm_priv_image_estimate_bg_in_region(const cpl_image *img, const cpl_size window_xxyy[4], double *out_sigma, cpl_size *out_nused)
Estimate the background in a small image region.
Definition: clipm_priv_image_signal.c:529
cpl_image * clipm_priv_image_filter_lowpass(const cpl_image *image, const cpl_size window_xxyy[4], double sigma)
Convolve an image with a gaussian bell curve.
Definition: clipm_priv_image_signal.c:2471
cpl_image * clipm_priv_image_get_sat(const cpl_image *image, const int window_xxyy[4], cpl_image **contrib_sat)
double clipm_priv_image_estimate_low_kappa_sigma(const cpl_image *image, const cpl_size window_xxyy[4], double kappa, double *out_sigma, cpl_size *out_nused)
Force the iterative kappa-sigma clipping to converge against the dark.
Definition: clipm_priv_image_signal.c:243