OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
getcal_proto.h
Go to the documentation of this file.
1 #ifndef CALPROTOI_H /* avoid re-inclusion */
2 #define CALPROTOI_H
3 
4 #include "l1a.h"
5 #include <stdint.h>
6 
7 void read_caltable(char *cal_path);
8 
9 int32_t l1b_rad(int syear, int sday, int32_t smsec, int32_t msec,
10  char *dtype, int32_t nsta, int32_t ninc, int32_t npix,
11  float *dark_mean, short *gain, short *tdi,
12  short *scan_temp, float *inst_temp, int mside,
13  short *l1a_data, float *l1b_data, cal_mod_struc *cal_mod);
14 
15 int32_t get_cal(char *cal_path, int16_t syear, int16_t sday, int16_t eday,
16  int32_t msec, int32_t npix, int32_t nsta, int32_t ninc,
17  char *dtype, int16_t *tdi, int16_t *cal_year, int16_t *cal_day,
18  int16_t *ref_year, int16_t *ref_day, int16_t *ref_min,
19  float fp_temps[256][8], float scan_mod[2][1285],
20  double *tfactor_const, double *tfactor_linear_1,
21  double *tfactor_exponential_1, double *tfactor_linear_2,
22  double *tfactor_exponential_2, double *cal_offset,
23  double *inst_tcorr, double *inst_tref, double *fp_tcorr,
24  double *fp_terf, double *mside1_const,
25  double *mside1_linear_1, double *mside1_exponential_1,
26  double *mside1_linear_2, double *mside1_exponential_2,
27  double *mside2_const, double *mside2_linear_1,
28  double *mside2_exponential_1, double *mside2_linear_2,
29  double *mside2_exponential_2, float counts[8][4][5],
30  float rads[8][4][5]);
31 
32 int32_t read_parm_data(int32_t fid, int32_t sdfid, int32_t index, int32_t idoffs[8][16],
33  float gains[8][16], float fp_temps[256][8],
34  float scan_mod[2][1285], double *tfactor_const,
35  double *tfactor_linear_1, double *tfactor_exponential_1,
36  double *tfactor_linear_2, double *tfactor_exponential_2,
37  double *cal_offset, double *inst_tcorr,
38  double *inst_tref, double *fp_tcorr, double *fp_tref,
39  double *mside1_const, double *mside1_linear_1,
40  double *mside1_exponential_1, double *mside1_linear_2,
41  double *mside1_exponential_2, double *mside2_const,
42  double *mside2_linear_1, double *mside2_exponential_1,
43  double *mside2_linear_2, double *mside2_exponential_2,
44  int16_t tdi_list[256][4]);
45 
46 void calc_knees(int16_t *tdi, int16_t tdi_list[256][4], int32_t idoffs[8][16],
47  float gains[8][16], float counts[8][4][5],
48  float rads[8][4][5]);
49 
50 //int32_t read_time_data(int32_t fid, int16_t *year, int16_t *day, int32_t *msec,
51 // int32_t *elts);
52 
53 int32_t get_index(int32_t fid, int16_t syear, int16_t sday, int16_t eday, int32_t msec,
54  int16_t *cal_year, int16_t *cal_day);
55 
56 void setup_scanmod(int32_t npix, int32_t nsta, int32_t ninc,
57  float scan_mod[2][1285]);
58 
59 void sort_srads(float *srads, int32_t *oindex);
60 
61 int32_t get_ref_time(int32_t sdfid,
62  int16_t *ref_year, int16_t *ref_day, int16_t *ref_min);
63 
64 
65 int32_t get_tindex(int32_t fid, int16_t syear, int16_t sday, int16_t eday, int32_t msec,
66  int16_t *cal_year, int16_t *cal_day);
67 
68 
69 #endif /* CALPROTOI_H */
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
float rads[BANDS_DIMS_1A][GAINS_DIMS_1A][KNEES_DIMS_1A]
Definition: l1a_seawifs.c:47
int32_t get_index(int32_t fid, int16_t syear, int16_t sday, int16_t eday, int32_t msec, int16_t *cal_year, int16_t *cal_day)
double fp_tcorr[BANDS_DIMS_1A]
Definition: l1a_seawifs.c:57
int16 eday
Definition: l1_czcs_hdf.c:17
float dark_mean[8]
Definition: l1a_seawifs.c:34
int16 * gain
Definition: l1_czcs_hdf.c:33
int32_t get_cal(char *cal_path, int16_t syear, int16_t sday, int16_t eday, int32_t msec, int32_t npix, int32_t nsta, int32_t ninc, char *dtype, int16_t *tdi, int16_t *cal_year, int16_t *cal_day, int16_t *ref_year, int16_t *ref_day, int16_t *ref_min, float fp_temps[256][8], float scan_mod[2][1285], double *tfactor_const, double *tfactor_linear_1, double *tfactor_exponential_1, double *tfactor_linear_2, double *tfactor_exponential_2, double *cal_offset, double *inst_tcorr, double *inst_tref, double *fp_tcorr, double *fp_terf, double *mside1_const, double *mside1_linear_1, double *mside1_exponential_1, double *mside1_linear_2, double *mside1_exponential_2, double *mside2_const, double *mside2_linear_1, double *mside2_exponential_1, double *mside2_linear_2, double *mside2_exponential_2, float counts[8][4][5], float rads[8][4][5])
void read_caltable(char *cal_path)
Definition: get_cal_swf.c:153
int16_t * l1a_data
Definition: l1a_seawifs.c:84
void setup_scanmod(int32_t npix, int32_t nsta, int32_t ninc, float scan_mod[2][1285])
Definition: get_cal_misc.c:478
int32 * msec
Definition: l1_czcs_hdf.c:31
uint8 * counts
Definition: l1_czcs_hdf.c:30
double fp_tref[BANDS_DIMS_1A]
Definition: l1a_seawifs.c:58
int syear
Definition: l1_czcs_hdf.c:15
void sort_srads(float *srads, int32_t *oindex)
Definition: get_cal_misc.c:517
int32 smsec
Definition: l1_czcs_hdf.c:16
int sday
Definition: l1_czcs_hdf.c:15
int32_t mside
int32_t get_ref_time(int32_t sdfid, int16_t *ref_year, int16_t *ref_day, int16_t *ref_min)
Definition: get_cal_misc.c:73
double inst_tcorr[BANDS_DIMS_1A]
Definition: l1a_seawifs.c:55
void calc_knees(int16_t *tdi, int16_t tdi_list[256][4], int32_t idoffs[8][16], float gains[8][16], float counts[8][4][5], float rads[8][4][5])
Definition: get_cal_misc.c:389
int16_t tdi[BANDS_DIMS_1A]
Definition: l1a_seawifs.c:37
int16_t ref_day
Definition: l1a_seawifs.c:42
float fp_temps[256][BANDS_DIMS_1A]
Definition: l1a_seawifs.c:44
double inst_tref[BANDS_DIMS_1A]
Definition: l1a_seawifs.c:56
int32_t l1b_rad(int syear, int sday, int32_t smsec, int32_t msec, char *dtype, int32_t nsta, int32_t ninc, int32_t npix, float *dark_mean, short *gain, short *tdi, short *scan_temp, float *inst_temp, int mside, short *l1a_data, float *l1b_data, cal_mod_struc *cal_mod)
Definition: get_cal_swf.c:701
dtype
Definition: DDataset.hpp:31
int16_t ref_year
Definition: l1a_seawifs.c:41
float scan_mod[2][1285]
Definition: l1a_seawifs.c:45
int32_t read_parm_data(int32_t fid, int32_t sdfid, int32_t index, int32_t idoffs[8][16], float gains[8][16], float fp_temps[256][8], float scan_mod[2][1285], double *tfactor_const, double *tfactor_linear_1, double *tfactor_exponential_1, double *tfactor_linear_2, double *tfactor_exponential_2, double *cal_offset, double *inst_tcorr, double *inst_tref, double *fp_tcorr, double *fp_tref, double *mside1_const, double *mside1_linear_1, double *mside1_exponential_1, double *mside1_linear_2, double *mside1_exponential_2, double *mside2_const, double *mside2_linear_1, double *mside2_exponential_1, double *mside2_linear_2, double *mside2_exponential_2, int16_t tdi_list[256][4])
Definition: get_cal_misc.c:285
int32_t get_tindex(int32_t fid, int16_t syear, int16_t sday, int16_t eday, int32_t msec, int16_t *cal_year, int16_t *cal_day)
Definition: get_cal_misc.c:130
int npix
Definition: get_cmp.c:27