Data Structures | |
struct | _hawki_distortion_obj_function_args_ |
Functions | |
int | hawki_distortion_apply_maps (cpl_imagelist *ilist, cpl_image **dist_x, cpl_image **dist_y) |
Apply the distortion correction. | |
double | hawki_distortion_compute_rms (const cpl_table **ref_catalogues, const cpl_bivector *cat_offsets, const cpl_table *matching_sets, int ncats, hawki_distortion *distortion) |
This private function computes the rms, which is the objective function of the minimization algorithm. | |
int | hawki_distortion_correct_alldetectors (cpl_image **ilist, const cpl_frame *frame_dist_x, const cpl_frame *frame_dist_y) |
Apply the distortion correction. | |
int | hawki_distortion_correct_coords (const hawki_distortion *distortion, double x_pos, double y_pos, double *x_pos_distcorr, double *y_pos_distcorr) |
Apply the distortion correction to one detector position. | |
cpl_image * | hawki_distortion_correct_detector (cpl_image *image, cpl_image *dist_x, cpl_image *dist_y) |
Apply the distortion correction to one chip. | |
void | hawki_distortion_delete (hawki_distortion *distortion) |
Deallocates a hawki_distortion structure. | |
double | hawki_distortion_get_deque_stddev (cx_deque *deque) |
Compute the standard deviation of a deque. | |
int | hawki_distortion_get_size_x (const hawki_distortion *distortion) |
Gives the dimension in X of the distortion solution. | |
int | hawki_distortion_get_size_y (const hawki_distortion *distortion) |
Gives the dimension in Y of the distortion solution. | |
hawki_distortion * | hawki_distortion_grid_new (int detector_nx, int detector_ny, int grid_size) |
Allocate a new distortion solution. | |
int | hawki_distortion_interpolate_distortion (const hawki_distortion *distortion, double x_pos, double y_pos, double *x_dist, double *y_dist) |
Interpolates the distortion solution at a given position. | |
int | hawki_distortion_inverse_correct_coords (const hawki_distortion *distortion, double x_pos, double y_pos, double *x_pos_distinvcorr, double *y_pos_distinvcorr) |
Apply the inverse distortion correction to one detector position. | |
hawki_distortion * | hawki_distortion_load (const cpl_frame *dist_x, const cpl_frame *dist_y, int idet) |
Loads the distortion solution for one detector. |
int hawki_distortion_apply_maps | ( | cpl_imagelist * | ilist, | |
cpl_image ** | dist_x, | |||
cpl_image ** | dist_y | |||
) |
Apply the distortion correction.
ilist | the input image list (chips 1 2 3 4) | |
dist | the distortion file |
Definition at line 616 of file hawki_distortion.c.
References hawki_distortion_correct_detector().
double hawki_distortion_compute_rms | ( | const cpl_table ** | ref_catalogues, | |
const cpl_bivector * | cat_offsets, | |||
const cpl_table * | matching_sets, | |||
int | ncats, | |||
hawki_distortion * | distortion | |||
) |
This private function computes the rms, which is the objective function of the minimization algorithm.
Definition at line 929 of file hawki_distortion.c.
References _hawki_distortion_obj_function_args_::distortion, and hawki_distortion_interpolate_distortion().
int hawki_distortion_correct_alldetectors | ( | cpl_image ** | ilist, | |
const cpl_frame * | frame_dist_x, | |||
const cpl_frame * | frame_dist_y | |||
) |
Apply the distortion correction.
ilist | the input image list (chips 1 2 3 4) | |
dist | the distortion file |
Definition at line 286 of file hawki_distortion.c.
References hawki_distortion_correct_detector(), hawki_distortion_delete(), and hawki_distortion_load().
int hawki_distortion_correct_coords | ( | const hawki_distortion * | distortion, | |
double | x_pos, | |||
double | y_pos, | |||
double * | x_pos_distcorr, | |||
double * | y_pos_distcorr | |||
) |
Apply the distortion correction to one detector position.
distortion | the distortion solution | |
x_pos | the X position in detector that we want to correct. | |
y_pos | the Y position in detector that we want to correct. | |
x_pos_distcorr | the X position in detector corrected from distortion | |
y_pos_distcorr | the Y position in detector corrected from distortion |
Definition at line 422 of file hawki_distortion.c.
References hawki_distortion_interpolate_distortion().
cpl_image* hawki_distortion_correct_detector | ( | cpl_image * | image, | |
cpl_image * | dist_x, | |||
cpl_image * | dist_y | |||
) |
Apply the distortion correction to one chip.
image | the input image | |
dist | the distortion table |
Definition at line 370 of file hawki_distortion.c.
Referenced by hawki_distortion_apply_maps(), and hawki_distortion_correct_alldetectors().
void hawki_distortion_delete | ( | hawki_distortion * | distortion | ) |
Deallocates a hawki_distortion structure.
distortion | The distortion to allocate |
Definition at line 162 of file hawki_distortion.c.
References _hawki_distortion_::dist_x, and _hawki_distortion_::dist_y.
Referenced by hawki_distortion_correct_alldetectors().
double hawki_distortion_get_deque_stddev | ( | cx_deque * | deque | ) |
Compute the standard deviation of a deque.
Definition at line 1176 of file hawki_distortion.c.
int hawki_distortion_get_size_x | ( | const hawki_distortion * | distortion | ) |
Gives the dimension in X of the distortion solution.
dist | the distortion solution |
Definition at line 251 of file hawki_distortion.c.
References _hawki_distortion_::dist_x.
int hawki_distortion_get_size_y | ( | const hawki_distortion * | distortion | ) |
Gives the dimension in Y of the distortion solution.
dist | the distortion solution |
Definition at line 268 of file hawki_distortion.c.
References _hawki_distortion_::dist_x.
hawki_distortion* hawki_distortion_grid_new | ( | int | detector_nx, | |
int | detector_ny, | |||
int | grid_size | |||
) |
Allocate a new distortion solution.
detector_nx | The dimensions in X of a HAWK-I detector | |
detector_nx | The dimensions in Y of a HAWK-I detector | |
grid_size | The number of points in the distortion grid |
Definition at line 131 of file hawki_distortion.c.
References _hawki_distortion_::dist_x, _hawki_distortion_::dist_y, _hawki_distortion_::x_cdelt, _hawki_distortion_::x_crval, _hawki_distortion_::y_cdelt, and _hawki_distortion_::y_crval.
int hawki_distortion_interpolate_distortion | ( | const hawki_distortion * | distortion, | |
double | x_pos, | |||
double | y_pos, | |||
double * | x_dist, | |||
double * | y_dist | |||
) |
Interpolates the distortion solution at a given position.
distortion | the distortion solution | |
x_pos | the X position in detector that we want to correct. | |
y_pos | the Y position in detector that we want to correct. | |
x_dist | the distortion in X at position x_pos, y_pos | |
y_dist | the distortion in Y at position x_pos, y_pos |
If this function is used in a multithread environment with a CPL version not thread-safe, there is no risk as long as these two premises are hold: -The caller must check if distortion->dist_x and distortion->dist_y are not null before calling this function, because this is check by cpl_image_get_size_x and cpl_image_get. -The caller must check in advance that the mask has all the points valid, because cpl_image_get checks for the validity of the pixel in the mask, if it is not valid, enters the error handling of CPL, which is not thread-safe, at least before CPL 5.2. The rest of the calls are read-only, so it should be safe.
Definition at line 525 of file hawki_distortion.c.
References _hawki_distortion_::dist_x, _hawki_distortion_::dist_y, _hawki_distortion_::x_cdelt, _hawki_distortion_::x_crval, _hawki_distortion_::y_cdelt, and _hawki_distortion_::y_crval.
Referenced by hawki_distortion_compute_rms(), hawki_distortion_correct_coords(), and hawki_distortion_inverse_correct_coords().
int hawki_distortion_inverse_correct_coords | ( | const hawki_distortion * | distortion, | |
double | x_pos, | |||
double | y_pos, | |||
double * | x_pos_distinvcorr, | |||
double * | y_pos_distinvcorr | |||
) |
Apply the inverse distortion correction to one detector position.
distortion | the distortion solution | |
x_pos | the X position in detector that we want to decorrect. | |
y_pos | the Y position in detector that we want to decorrect. | |
x_pos_distcorr | the X position in detector decorrected from distortion | |
y_pos_distcorr | the Y position in detector decorrected from distortion |
Definition at line 466 of file hawki_distortion.c.
References hawki_distortion_interpolate_distortion().
hawki_distortion* hawki_distortion_load | ( | const cpl_frame * | dist_x, | |
const cpl_frame * | dist_y, | |||
int | idet | |||
) |
Loads the distortion solution for one detector.
dist_x | the image with distortion in X | |
dist_y | the image with distortion in Y | |
idet | the detector to read. |
Definition at line 181 of file hawki_distortion.c.
References _hawki_distortion_::dist_x, _hawki_distortion_::dist_y, hawki_get_ext_from_detector(), hawki_load_frame_detector(), _hawki_distortion_::x_cdelt, _hawki_distortion_::x_crval, _hawki_distortion_::y_cdelt, and _hawki_distortion_::y_crval.
Referenced by hawki_distortion_correct_alldetectors().