Go to the documentation of this file.
21 static int32 numScans;
22 static int32 numPixels;
23 static int32 numBands;
24 static int32 numBandsIR;
32 static float32 *fbuf2 =
NULL;
35 static int32
npix = 0;
40 if ((fbuf2 = calloc(
npix,
sizeof (float32))) ==
NULL) {
42 "-E- %s line %d: Unable to allocate buffer space.\n",
46 }
else if (
npix !=
p->dim[1]) {
51 if ((fbuf2 = (float32 *) calloc(
npix,
sizeof (float32)))
54 "-E- %s line %d: Unable to allocate buffer space.\n",
60 for (ip = 0; ip <
npix && ip < numPixels; ip++) {
64 return ((VOIDP) fbuf2);
81 out[
i] = in[
i] * multiplier;
90 static int firstCall = 1;
92 static float32 *fbuf =
NULL;
98 numPixels = l2rec->l1rec->npix;
99 numScans = l2rec->l1rec->l1file->nscan;
100 numBands = l2rec->l1rec->l1file->nbands;
101 numBandsIR = l2rec->l1rec->l1file->nbandsir;
102 if ((fbuf = (float32 *) calloc(numBands*numPixels,
sizeof(float32))) ==
NULL) {
104 "-E- %s line %d: Unable to allocate buffer space.\n",
108 }
else if (l2rec->l1rec->npix != numPixels) {
111 if (l2rec->l1rec->npix > numPixels) {
114 if ((fbuf = (float32 *) calloc(l2rec->l1rec->npix, sizeof (float32)))
117 "-E- %s line %d: Unable to allocate buffer space.\n",
123 numPixels = l2rec->l1rec->npix;
126 l1str*
l1rec = l2rec->l1rec;
215 if (
p->prod_ix < numBands) {
220 p->prod_ix -= numBands;
223 p->prod_ix += numBands;
233 p->prod_ix -= numBands;
235 p->prod_ix += numBands;
302 if ((
p->prod_ix >= 0) && (
l1rec->geom_per_band ==
NULL)) {
304 "-E- %s, %d: Geometry-dependent view angle information",
306 fprintf(
stderr,
" is unavailable for product catalog ID %d.\n",
308 fprintf(
stderr,
"or, geometry-dependent view angle information was specifically not requested\n");
313 if (
p->prod_ix < 0) {
320 if (
p->prod_ix < 0) {
327 if (
p->prod_ix < 0) {
334 if (
p->prod_ix < 0) {
341 if (
p->prod_ix < 0) {
348 if (
p->prod_ix < 0) {
361 pbuf = (VOIDP) l2rec->eps;
416 pbuf = (VOIDP)
l1rec->anc_add->prof_temp;
422 pbuf = (VOIDP)
l1rec->anc_add->prof_height;
433 "-I- %s %d: Single-level profile output not implemented yet\n",
434 __FILE__, __LINE__ );
486 pbuf = (VOIDP) l2rec->aerindex;
490 pbuf = (VOIDP) l2rec->aerratio;
492 pbuf = (VOIDP) l2rec->aerratio2;
499 pbuf = (VOIDP) l2rec->l1rec->flags;
502 pbuf = (VOIDP) l2rec->num_iter;
505 pbuf = (VOIDP) l2rec->l1rec->slot;
508 switch (
p->prod_ix) {
510 pbuf = l2rec->aermodmin;
513 pbuf = l2rec->aermodmax;
516 pbuf = l2rec->aermodmin2;
519 pbuf = l2rec->aermodmax2;
552 get_es(l2rec,
p->prod_ix, fbuf);
816 if (
input->band_shift_opt == 1)
896 vcal(l2rec,
p, fbuf);
903 vcal(l2rec,
p, fbuf);
1015 pbuf = (VOIDP) fbuf;
1058 pbuf = (VOIDP) fbuf;
1070 fprintf(
stderr,
"-E- %s Line %d: Unknown product catalogue ID %d.\n",
1071 __FILE__, __LINE__,
p->cat_ix);
int8_t * get_qual_sst_triple(l2str *l2rec)
#define CAT_chl_carder_emp
#define CAT_prochlorococcus_hirata
void get_fqy(l2str *l2rec, float fqy[])
#define CAT_Cld_Top_Refl_1600
#define CAT_picoplankton_abundanceksm
void get_habs_mph(l2str *l2rec, l2prodstr *p, float chl_mph[])
void get_bsi(l2str *l2rec, float *BSi)
#define CAT_prymnesiophytes_hirata
void get_rho_mumm(l2str *l2rec, int32_t ip, int32_t iw, float *rhom)
#define CAT_Cld_Top_Refl_1200
#define CAT_class_ward_owmc
#define CAT_CER_fail_1621
#define CAT_CER_fail_1600
void get_Kd(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_Surface_Albedo_650
int16 * get_flags_carder(l2str *l2rec)
#define CAT_bias_mean_sst3
unsigned char * get_flags_qaa(l2str *l2rec)
#define CAT_picoplankton_hirata
#define CAT_CER_fail_2100
#define CAT_nanoplankton_volumeksm
void get_smoke(l2str *l2rec, float smoke[])
#define CAT_Sg_300_600_mlrc
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in out
void get_lambda_max(l2str *l2rec, float lambda_max[])
void get_psd_ksm(l2str *l2rec, l2prodstr *p, float prod[])
void get_avw(l2str *l2rec, float avw[])
#define CAT_diatoms_hirata
#define CAT_nanoplankton_ratioksm
void get_photic_depth(l2str *l2rec, l2prodstr *p, float Z[])
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
#define CAT_CMP_fail_pct_1600
int16_t * get_flags_sst(l2str *l2rec)
void tindx_shi(l2str *l2rec, int32_t ip, float *tindx)
#define CAT_microplankton_volumeksm
unsigned char * get_cmp_byt(l2str *l2rec, int prodnum)
void get_Cphyt(l2str *l2rec, float cphyt[])
void get_cdom_morel(l2str *l2rec, l2prodstr *p, float prod[])
float * get_bias_mean_sst(l2str *l2rec)
void get_habs_ci(l2str *l2rec, l2prodstr *p, float ci[])
int8_t * get_qual_sst4(l2str *l2rec)
void get_gsm(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_no2_strat_unc
#define CAT_Surface_Albedo_1600
#define CAT_flags_habs_mph
float * get_sst_dust_correction(l2str *l2rec)
#define CAT_nanoplankton_abundanceksm
void get_pft_uitz(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_Cld_Phase_1600
void get_carder(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_nanoplankton_uitz
#define CAT_COT_fail_1600
#define CAT_anap_unc_giop
void get_bbws(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_poc_stramski_490
float * get_class_34k_w_owmc(l2str *l2rec)
void get_Rrs_brightness(l2str *l2rec, float Rrs_brightness[])
void get_bpar(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_Surface_Albedo_2100
#define CAT_Rrs_brightness
uint8_t * get_flags_habs(l2str *l2rec)
int16 * get_iter_gsm(l2str *l2rec)
#define CAT_windspeed_unc
#define CAT_Cld_Non_Abs_Band
#define CAT_refl_loc_1600
void get_fsat(l2str *l2rec, float flh[])
#define CAT_bias_mean_sst4
#define CAT_picoplankton_volumeksm
void get_poc(l2str *l2rec, int prodnum, float prod[])
#define CAT_Cld_Phase_1621
#define CAT_refl_loc_2100
void get_pml(l2str *l2rec, l2prodstr *p, float prod[])
void get_ndvi_evi(l1str *l1rec, int prodnum, float prod[])
#define CAT_chl_cdomcorr_morel
int get_cmp(l2str *l2rec, int prodnum, float prod[])
#define CAT_COT_fail_1621
int16_t * get_flags_sst_triple(l2str *l2rec)
#define CAT_class_34k_w_owmc
#define CAT_microplankton_uitz
void get_depth_classification(l2str *l2rec, float depth[])
#define CAT_calcite_ci869
#define CAT_picoplankton_ratioksm
#define CAT_microplankton_hirata
#define CAT_calcite_ci748
void chl_carder_empirical(l2str *l2rec, float prod[])
void get_ice_frac(l2str *l2rec, float ice[])
float * get_bias_sst_triple(l2str *l2rec)
int16_t * get_counts_sst4(l2str *l2rec)
void get_chl(l2str *l2rec, int prodnum, float prod[])
float * get_sst(l2str *l2rec)
VOIDP extract_band(float *fbuf, l2prodstr *p, int32 nbands)
float * get_sst4(l2str *l2rec)
void get_angstrom(l2str *l2rec, int band, float angst[])
float * get_sst_triple(l2str *l2rec)
void optical_water_type(l2str *l2rec, l2prodstr *p, void *vptr)
float * get_stdv_sst4(l2str *l2rec)
#define CAT_CMP_fail_pct_1621
#define CAT_Surface_Albedo_860
void get_nitrate(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_opt_siop_giop
int16 * get_iter_giop(l2str *l2rec)
#define CAT_Cld_Top_Refl_2100
float * get_bias_sst(l2str *l2rec)
void get_par(l2str *l2rec, float par[])
#define CAT_nanoplankton_hirata
#define CAT_prokaryotes_hirata
void bioOptBandShift(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_bias_mean_sst
#define CAT_Sg_275_295_mlrc
void get_es(l2str *l2rec, int band, float Es[])
float * get_bias_mean_sst_triple(l2str *l2rec)
#define CAT_CMP_fail_pct_2100
#define CAT_bbph_unc_giop
#define CAT_Cld_Phase_2100
#define CAT_poc_stramski_443
#define CAT_greenalgae_hirata
#define CAT_bbnap_unc_giop
float * get_bias_mean_sst4(l2str *l2rec)
int8_t * get_qual_sst(l2str *l2rec)
void vcal(l2str *l2rec, l2prodstr *p, float vcal[])
float * get_stdv_sst(l2str *l2rec)
#define CAT_microplankton_abundanceksm
int16 * get_flags_giop(l2str *l2rec)
#define CAT_picoplankton_uitz
This should be set to the NetCDF standard name if exists for this product Create a function that computes your product edit get_myprod c add prototype to l12_proto h add get_myprod c to add_executable for l2gen and l3gen in CMakeLists txt Add an entry to the output routine to call your function edit prodgen c edit function prodgen() case CAT_myprod pbuf
#define CAT_water_vapor_unc
void get_ipar(l2str *l2rec, float ipar[])
int16_t * get_counts_sst(l2str *l2rec)
#define CAT_microplankton_ratioksm
void get_flh(l2str *l2rec, float flh[])
void get_toa_refl(l2str *l2rec, int band, float rhot[])
VOIDP prodgen(l2prodstr *p, l2str *l2rec)
void get_pft_hirata(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_COT_fail_2100
int16_t * get_counts_sst_triple(l2str *l2rec)
#define CAT_dinoflagellates_hirata
void get_mgiop(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_no2_tropo_unc
void applyMultiplier(float *in, float *out, int count, float multiplier)
void get_swim(l2str *l2rec, l2prodstr *p, float prod[])
float * get_stdv_sst_triple(l2str *l2rec)
float * get_bias_sst4(l2str *l2rec)
void cdom_mannino(l2str *l2rec, int prodnum, float prod[])
void virtual_constellation(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_acdom_unc_giop
void get_niwa(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_Cld_Top_Refl_650
int16_t * get_flags_sst4(l2str *l2rec)
void get_npp(l2str *l2rec, int prodnum, float prod[])
int16 * get_flags_niwa(l2str *l2rec)
uint8_t * get_flags_habs_mph(l2str *l2rec)
void get_las(l2str *l2rec, l2prodstr *p, float prod[])
void get_ms_epsilon(l2str *l2rec, float eps[])
#define CAT_refl_loc_1621
#define CAT_Cld_Top_Refl_860
#define CAT_Surface_Albedo_1200
float * get_class_k_owmc(l2str *l2rec)
void get_giop(l2str *l2rec, l2prodstr *p, float prod[])
void calcite(l2str *l2rec, l2prodstr *p, float prod[])
void get_qaa(l2str *l2rec, l2prodstr *p, float prod[])
#define CAT_windangle_unc
void tindx_morel(l2str *l2rec, int32_t ip, float *tindx)
#define CAT_picoeukaryotes_hirata
float * get_class_ward_owmc(l2str *l2rec)