22#include "../hdrl_cat_apio.h"
23#include "../hdrl_cat_phopt.h"
28 cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING);
31 double apertures[] = {2.5, 3.53553, 5.0, 7.07107, 10, 14, 20, 25, 30, 35, 40, 50, 60};
39 ap.inframe = cpl_image_new(2048, 2048, CPL_TYPE_DOUBLE);
40 ap.conframe = cpl_image_new(2048, 2048, CPL_TYPE_DOUBLE);
46 ap.indata = cpl_image_get_data_double(ap.inframe);
47 ap.confdata = cpl_image_get_data_double(ap.conframe);
48 ap.mflag = cpl_calloc(2048 * 2048,
sizeof(*ap.mflag));
51 cpl_image_fill_noise_uniform(ap.inframe, -10., 10.);
52 cpl_image_add_scalar( ap.inframe, 5000.);
53 cpl_image_fill_noise_uniform(ap.conframe, 99, 101);
56 double parm[IMNUM][NPAR];
57 for (cpl_size i = 0; i < IMNUM; i++) {
58 for (cpl_size j = 0; j < NPAR; j++) {
64 double cflux[NRADS * IMNUM];
78 for (cpl_size i = 0; i < nbit; i++) {
82 e =
hdrl_phopt(&ap, parm, nbit, NRADS, apertures, cflux, badpix, nrcore, avconf);
83 cpl_test_eq(e, CPL_ERROR_NONE);
87 for (cpl_size i = 0; i < nbit; i++) {
91 e =
hdrl_phopt(&ap, parm, nbit, NRADS, apertures, cflux, badpix, nrcore, avconf);
92 cpl_test_eq(e, CPL_ERROR_NONE);
98 cpl_image_delete(ap.inframe);
99 cpl_image_delete(ap.conframe);
102 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.