26#include "../hdrl_cat_apio.h"
27#include "../hdrl_cat_phopt.h"
32 cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING);
35 double apertures[] = {2.5, 3.53553, 5.0, 7.07107, 10, 14, 20, 25, 30, 35, 40, 50, 60};
43 ap.inframe = cpl_image_new(2048, 2048, CPL_TYPE_DOUBLE);
44 ap.conframe = cpl_image_new(2048, 2048, CPL_TYPE_DOUBLE);
50 ap.indata = cpl_image_get_data_double(ap.inframe);
51 ap.confdata = cpl_image_get_data_double(ap.conframe);
52 ap.mflag = cpl_calloc(2048 * 2048,
sizeof(*ap.mflag));
55 cpl_image_fill_noise_uniform(ap.inframe, -10., 10.);
56 cpl_image_add_scalar( ap.inframe, 5000.);
57 cpl_image_fill_noise_uniform(ap.conframe, 99, 101);
60 double parm[IMNUM][NPAR];
61 for (cpl_size i = 0; i < IMNUM; i++) {
62 for (cpl_size j = 0; j < NPAR; j++) {
68 double cflux[NRADS * IMNUM];
82 for (cpl_size i = 0; i < nbit; i++) {
86 e =
hdrl_phopt(&ap, parm, nbit, NRADS, apertures, cflux, badpix, nrcore, avconf);
87 cpl_test_eq(e, CPL_ERROR_NONE);
91 for (cpl_size i = 0; i < nbit; i++) {
95 e =
hdrl_phopt(&ap, parm, nbit, NRADS, apertures, cflux, badpix, nrcore, avconf);
96 cpl_test_eq(e, CPL_ERROR_NONE);
102 cpl_image_delete(ap.inframe);
103 cpl_image_delete(ap.conframe);
106 return cpl_test_end(0);
void hdrl_apinit(ap_t *ap)
Initialize the ap structure.
void hdrl_apclose(ap_t *ap)
Close ap structure.
cpl_error_code hdrl_phopt(ap_t *ap, double parm[IMNUM][NPAR], cpl_size nbit, cpl_size naper, double apertures[], double cflux[], double badpix[], cpl_size nrcore, double avconf[])
Does multiple profile fitting to determine intensities.