22#include "../hdrl_cat_apio.h"
23#include "../hdrl_cat_areals.h"
24#include "../hdrl_cat_moments.h"
25#include "../hdrl_cat_terminate.h"
33 cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING);
35 cpl_size x[] = {398,399,400,397,398,399,400,401,402,403,396,397,398,399,400,
36 401,402,403,404,395,396,397,398,399,400,401,402,403,404,405,
37 395,396,397,398,399,400,401,402,403,404,405,395,396,397,398,
38 399,400,401,402,403,404,405,395,396,397,398,399,400,401,402,
39 403,404,405,406,395,396,397,398,399,400,401,402,403,404,405,
40 395,396,397,398,399,400,401,402,403,404,405,395,396,397,398,
41 399,400,401,402,403,404,405,396,397,398,399,400,401,402,403,
42 404,397,398,399,400,401,402,403,398,399,400,401};
44 cpl_size y[] = {394,394,394,395,395,395,395,395,395,395,396,396,396,396,396,
45 396,396,396,396,397,397,397,397,397,397,397,397,397,397,397,
46 398,398,398,398,398,398,398,398,398,398,398,399,399,399,399,
47 399,399,399,399,399,399,399,400,400,400,400,400,400,400,400,
48 400,400,400,400,401,401,401,401,401,401,401,401,401,401,401,
49 402,402,402,402,402,402,402,402,402,402,402,403,403,403,403,
50 403,403,403,403,403,403,403,404,404,404,404,404,404,404,404,
51 404,405,405,405,405,405,405,405,406,406,406,406};
53 double z[] = {8.87152,12.515,7.69699,10.8527,22.2509,21.7368,13.0388,
54 12.1853,17.1976,7.43948,15.2245,29.1964,37.9117,57.9371,
55 71.5542,57.1288,34.7726,15.5934,11.5374,15.995,21.3606,
56 60.4006,103.46,147.55,168.274,147.476,98.9157,51.7186,20.188,
57 3.04248,5.77832,49.3103,98.2057,187.557,268.353,310.638,
58 274.295,183.969,94.6933,47.9889,20.245,26.3758,59.1781,
59 152.389,275.916,395.107,450.251,397.53,272.322,147.053,54.767,
60 11.8971,13.3888,73.3689,165.899,298.455,449.707,493.25,441.585,
61 299.31,157.474,70.1224,15.5313,8.76074,20.7188,54.5798,141.249,
62 264.87,382.736,435.452,393.871,268.175,138.485,65.9307,28.7812,
63 19.379,36.6449,93.5458,186.823,270.95,305.093,260.879,183.683,
64 100.676,32.6281,16.6497,5.94965,17.8105,57.256,106.32,145.264,
65 164.271,137.093,88.9384,60.7841,31.8582,10.0435,4.69162,
66 15.2187,32.5385,61.0381,74.5399,67.3727,43.3964,25.0956,
67 16.7595,-0.37323,21.3832,19.2497,18.5883,9.37448,19.6048,
68 11.5006,13.0159,14.5852,13.66,-1.04889};
75 ap.inframe = cpl_image_new(2048, 2048, CPL_TYPE_DOUBLE);
76 ap.conframe = cpl_image_new(2048, 2048, CPL_TYPE_DOUBLE);
82 ap.areal_offset = 1.5;
86 ap.plarray = cpl_realloc(ap.plarray, NT *
sizeof(*ap.plarray));
87 for (cpl_size i = 0; i < NT; i++) {
88 ap.plarray[i].x = x[i];
89 ap.plarray[i].y = y[i];
90 ap.plarray[i].z = z[i];
91 ap.plarray[i].zsm = z[i];
95 ap.areal_offset = 3.56;
100 cpl_size iareal[NAREAL];
103 ap.indata = cpl_image_get_data_double(ap.inframe);
104 ap.confdata = cpl_image_get_data_double(ap.conframe);
105 ap.mflag = cpl_calloc(2048 * 2048,
sizeof(*ap.mflag));
109 cpl_image_fill_gaussian(ap.inframe, 2048, 2048, tmax, 10., 10.);
110 cpl_image_fill_gaussian(ap.conframe, 2048, 2048, tmax, 100., 100.);
113 double momresults[8];
117 ap.parent[1].pnop = 0;
118 ap.parent[1].first = 0;
119 ap.parent[1].last = 0;
120 ap.parent[1].growing = 0;
121 ap.parent[1].touch = 0;
122 ap.parent[1].pnbp = 0;
128 cpl_image_delete(ap.inframe);
129 cpl_image_delete(ap.conframe);
131 return cpl_test_end(0);
void hdrl_apinit(ap_t *ap)
Initialize the ap structure.
void hdrl_apclose(ap_t *ap)
Close ap structure.
void hdrl_areals(ap_t *ap, cpl_size iareal[NAREAL])
Work out the areal profiles for an object.
void hdrl_moments(ap_t *ap, double results[])
Do moments analysis on an object in a Plessey array.
void hdrl_apfu(ap_t *ap)
Get rid of the largest contributor in an ap structure.