UVES Pipeline Reference Manual
5.4.6
|
Functions | |
static cpl_image * | filter_median (const cpl_image *image, int radx, int rady, bool extrapolate_border) |
Median filter. More... | |
const cpl_property * | uves_find_property_const (const uves_propertylist *plist, const char *name, int number) |
Find named property. More... | |
cpl_property * | uves_find_property (uves_propertylist *plist, const char *name, int number) |
cpl_error_code | uves_filter_image_average (cpl_image *image, int radius_x, int radius_y) |
Average filter. More... | |
cpl_error_code | uves_filter_image_median (cpl_image **image, int xwindow, int ywindow, bool extrapolate_border) |
Median filter. More... | |
double | uves_utils_get_kth_double (double *a, int n, int k) |
returns the kth value of an array More... | |
double | uves_tools_get_median (double *a, int n) |
returns median (not CPL median) of an array More... | |
cpl_error_code | uves_fit_gaussian_2d_image (const cpl_image *image, const cpl_image *noise, int x1, int y_1, int x2, int y2, double *x0, double *y_0, double *sigmax, double *sigmay, double *amplitude, double *dx0, double *dy0) |
Fit a 2d gaussian to an image sub-window. More... | |
This module contains low level library functions that can be removed if/when the corresponding functionality is in the CPL.
|
static |
Median filter.
image | Image to filter |
radx | x-radius of median window |
rady | y-radius of median window |
extrapolate_border | If false (which should be considered the default value), a smaller window is used at the image borders (where the full window would be partially outside of the image). If true, the median is calculated only for points where the full window is inside the image, and the border region is obtained by constant extrapolation. |
Apply a radx by rady median filter to the input image. Each pixel is replaced by the median of a local window of size (2* radx + 1)* (2 * rady + 1) centered on the pixel.
Definition at line 516 of file uves_utils_cpl.c.
References assure_mem, uves_tostring_cpl_type(), and uves_utils_get_kth_double().
Referenced by uves_filter_image_median().
const cpl_property* uves_find_property_const | ( | const uves_propertylist * | plist, |
const char * | name, | ||
int | number | ||
) |
Find named property.
plist | propertylist to search |
name | property name |
number | number of property to find (counting from zero). E.g. setting number=1 would return the 2nd property with matching name |
No error is set if the property is not found
Definition at line 199 of file uves_utils_cpl.c.
References uves_propertylist_get_const(), and uves_propertylist_get_size().
cpl_error_code uves_filter_image_average | ( | cpl_image * | image, |
int | radius_x, | ||
int | radius_y | ||
) |
Average filter.
image | Image to filter |
radius_x | width of filter window is 2*radius_x + 1 |
radius_y | height of filter window is 2*radius_y + 1 |
The image must be of type CPL_TYPE_DOUBLE.
There is currently no handling of bad pixels.
Definition at line 250 of file uves_utils_cpl.c.
References uves_msg_debug, and uves_tostring_cpl_type().
cpl_error_code uves_filter_image_median | ( | cpl_image ** | image, |
int | xwindow, | ||
int | ywindow, | ||
bool | extrapolate_border | ||
) |
Median filter.
image | Image to filter |
xwindow | x-radius of filter window |
ywindow | y-radius of filter window |
extrapolate_border | See filter_median() |
If the median window is large, this function is rather inefficient, because cpl_image_get_median_window()
is called for each pixel. A more clever implementation would keep track of the running window.
Definition at line 375 of file uves_utils_cpl.c.
References check, and filter_median().
Referenced by uves_get_blaze_ratio(), uves_rcosmic(), and uves_response_efficiency().
double uves_utils_get_kth_double | ( | double * | a, |
int | n, | ||
int | k | ||
) |
returns the kth value of an array
a | array |
n | array size |
k | component to evaluate |
The array is modified
Definition at line 439 of file uves_utils_cpl.c.
Referenced by filter_median(), and uves_tools_get_median().
double uves_tools_get_median | ( | double * | a, |
int | n | ||
) |
returns median (not CPL median) of an array
a | array |
n | array size |
The array is modified
Definition at line 475 of file uves_utils_cpl.c.
References uves_utils_get_kth_double().
Referenced by opt_get_noise_median(), and opt_get_sky().
cpl_error_code uves_fit_gaussian_2d_image | ( | const cpl_image * | image, |
const cpl_image * | noise, | ||
int | x1, | ||
int | y_1, | ||
int | x2, | ||
int | y2, | ||
double * | x0, | ||
double * | y_0, | ||
double * | sigmax, | ||
double * | sigmay, | ||
double * | amplitude, | ||
double * | dx0, | ||
double * | dy0 | ||
) |
Fit a 2d gaussian to an image sub-window.
image | The image to fit. |
noise | The uncertainty (one sigma, gaussian errors assumed) associated with the image. If NULL, constant uncertainties are assumed, and then dx0 and dy0 cannot be determined. |
x1 | Lower left corner (inclusive, FITS convention). |
y_1 | Lower left corner (inclusive, FITS convention). |
x2 | Upper right corner (inclusive, FITS convention). |
y2 | Upper right corner (inclusive, FITS convention). |
x0 | (output) x-center of best fit gaussian. |
y_0 | (output) y-center of best fit gaussian. |
sigmax | (output) x-width of best fit gaussian. Positive on success. |
sigmay | (output) y-width of best fit gaussian. Positive on success. |
amplitude | (output) Height of the best fit gaussian, relative to the background level. May be NULL. |
dx0 | (output) Uncertainty of x0. May be NULL. |
dy0 | (output) Uncertainty of y_0. May be NULL. |
The function does not make a 2d gaussian fit, but fits a one-dimensional gaussian to the marginal distributions in x and y. See also uves_fit_gaussian_1d_image()
.
Definition at line 644 of file uves_utils_cpl.c.
References check, uves_gauss(), and uves_gauss_derivative().
Referenced by test_gaussian_fitting().