Go to the documentation of this file.
15 using namespace netCDF;
16 using namespace netCDF::exceptions;
19 static bool firstRun =
true;
25 int numBands =
l1rec->l1file->nbands;
30 int numPixels =
l1rec->npix;
33 NcVar ncVar =
ncFile.getVar(
"m12");
34 int lutNumBands = ncVar.getDim(0).getSize();
35 if(lutNumBands != numBands) {
36 printf(
"-E- %s:%d - Problem reading polfile %s\n", __FILE__, __LINE__,
input->polfile);
37 printf(
" L1 file #bands=%d, LUT m12 #bands=%d\n", numBands, lutNumBands);
40 int lutNumPixels = ncVar.getDim(1).getSize();
41 if(lutNumPixels != numPixels) {
42 printf(
"-E- %s:%d - Problem reading polfile %s\n", __FILE__, __LINE__,
input->polfile);
43 printf(
" L1 file #pix=%d, LUT m12 #pix=%d\n", numPixels, lutNumPixels);
49 ncVar =
ncFile.getVar(
"m13");
50 lutNumBands = ncVar.getDim(0).getSize();
51 if(lutNumBands != numBands) {
52 printf(
"-E- %s:%d - Problem reading polfile %s\n", __FILE__, __LINE__,
input->polfile);
53 printf(
" L1 file #bands=%d, LUT m13 #bands=%d\n", numBands, lutNumBands);
56 lutNumPixels = ncVar.getDim(1).getSize();
57 if(lutNumPixels != numPixels) {
58 printf(
"-E- %s:%d - Problem reading polfile %s\n", __FILE__, __LINE__,
input->polfile);
59 printf(
" L1 file #pix=%d, LUT m13 #pix=%d\n", numPixels, lutNumPixels);
65 }
catch (NcException& e) {
66 printf(
"-E- %s:%d - Problem reading polfile %s\n", __FILE__, __LINE__,
input->polfile);
67 printf(
" %s\n", e.what());
73 int ipb = ip * numBands +
band;
80 l1rec->polcor[ipb] = 1.0 / (1.0 - m12[
band][ip] * L_qp / L_x - m13[
band][ip] * L_up / L_x);
81 l1rec->dpol[ipb] = sqrt(pow(
l1rec->L_q[ipb], 2.0) + pow(
l1rec->L_u[ipb], 2.0)) / L_x;
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second band
void polcor_hawkeye(l1str *l1rec, int32_t ip)
Utility functions for allocating and freeing two-dimensional arrays of various types.
float ** allocate2d_float(size_t h, size_t w)
Allocate a two-dimensional array of type float of a given size.