Go to the documentation of this file.
13 static int last_recnum = -1;
18 static float *niwa_bb;
19 static int16 *niwa_iopf;
24 static int niwa_ran(
int recnum) {
25 return recnum == last_recnum;
31 static void alloc_niwa(int32_t
npix, int32_t
nbands) {
33 fprintf(
stderr,
"-E- %s line %d : error allocating memory for NIWA IOP.\n",
38 fprintf(
stderr,
"-E- %s line %d : error allocating memory for NIWA IOP.\n",
43 fprintf(
stderr,
"-E- %s line %d : error allocating memory for NIWA IOP.\n",
49 static void run_niwa(l2str *l2rec) {
50 static int first_time = 1;
54 alloc_niwa(l2rec->l1rec->npix, l2rec->l1rec->l1file->nbands);
59 niwa_iop(l2rec, niwa_a, niwa_bb, niwa_iopf);
61 last_recnum = l2rec->l1rec->iscan;
67 void get_niwa(l2str *l2rec, l2prodstr *
p,
float prod[]) {
68 int prod_id =
p->cat_ix;
72 if (!niwa_ran(l2rec->l1rec->iscan))
75 for (ip = 0; ip < l2rec->l1rec->npix; ip++) {
77 ipb = ip * l2rec->l1rec->l1file->nbands + ib;
81 prod[ip] = niwa_a[ipb];
85 prod[ip] = niwa_bb[ipb];
89 printf(
"-E- %s line %d : erroneous product ID %d passed to NIWA IOP\n",
90 __FILE__, __LINE__, prod_id);
100 if (!niwa_ran(l2rec->l1rec->iscan))
112 l1str *
l1rec = l2rec->l1rec;
115 if (!niwa_ran(
l1rec->iscan))
118 for (ip = 0; ip <
l1rec->npix; ip++) {
119 for (ib = 0; ib <
nbands; ib++) {
121 l2rec->a[ipb] = niwa_a[ipb];
122 l2rec->bb[ipb] = niwa_bb[ipb];
void niwa_iop(l2str *l2rec, float niwa_a[], float niwa_bb[], int16 niwa_iopf[])
void iops_niwa(l2str *l2rec)
void get_niwa(l2str *l2rec, l2prodstr *p, float prod[])
int16 * get_flags_niwa(l2str *l2rec)