Go to the documentation of this file.
174 int16_t
eday, int32_t
msec,
char *
dtype, int32_t nsta, int32_t ninc,
176 int16_t *scan_temp,
float *inst_temp, int16_t
side,
177 int16_t *
l1a_data,
float *l1b_data, cal_mod_struc *cal_mod) {
179 static int32 called_get_call = 0, first_call = 1;
180 static int16 pr_syear = 0, pr_sday = 0;
181 static int32 pr_smsec = 0;
182 static int16 pr_gain[
NBANDS] = {-1, -1, -1, -1, -1, -1, -1, -1};
183 static int16 pr_tdi[
NBANDS] = {-1, -1, -1, -1, -1, -1, -1, -1};
186 int16 cal_year, cal_day;
191 int16 count1, count2, tdi_flag, gain_flag;
193 static int32 ref_jday;
196 static float32 g_f[
NBANDS][1024];
203 float32 itemp_corr[
NBANDS];
204 float32 fptemp_corr[
NBANDS];
206 float64 delta_day, delta_t;
207 static float64 tfactor_const[
NBANDS];
208 static float64 tfactor_linear_1[
NBANDS];
209 static float64 tfactor_exponential_1[
NBANDS];
210 static float64 tfactor_linear_2[
NBANDS];
211 static float64 tfactor_exponential_2[
NBANDS];
212 static float64 cal_offset[
NBANDS];
217 static float64 mside1_const[
NBANDS];
218 static float64 mside1_linear_1[
NBANDS];
219 static float64 mside1_exponential_1[
NBANDS];
220 static float64 mside1_linear_2[
NBANDS];
221 static float64 mside1_exponential_2[
NBANDS];
222 static float64 mside2_const[
NBANDS];
223 static float64 mside2_linear_1[
NBANDS];
224 static float64 mside2_exponential_1[
NBANDS];
225 static float64 mside2_linear_2[
NBANDS];
226 static float64 mside2_exponential_2[
NBANDS];
233 if (scan_temp[
band] < 0)
235 if (scan_temp[
band] > 255)
236 scan_temp[
band] = 255;
262 if (first_call ||
syear != pr_syear ||
sday != pr_sday ||
smsec != pr_smsec
274 tfactor_linear_1, tfactor_exponential_1, tfactor_linear_2,
277 mside1_exponential_1, mside1_linear_2,
278 mside1_exponential_2, mside2_const, mside2_linear_1,
279 mside2_exponential_1, mside2_linear_2,
294 if (called_get_call || gain_flag) {
299 for (knee = 1; knee <= 4; knee++) {
324 delta_day = (float64) (data_jday - ref_jday) - (float64) ref_min / 1440.0;
325 delta_t = delta_day + (float64)
msec / 86400000.0;
330 cal_gain[
band] = 1.0 / (tfactor_const[
band] -
331 tfactor_linear_1[
band]*(1.0 - exp(-tfactor_exponential_1[
band] * delta_t)) -
332 tfactor_linear_2[
band]*(1.0 - exp(-tfactor_exponential_2[
band] * delta_t)));
336 if (cal_mod->flag == 1) {
338 }
else if (cal_mod->flag == 2) {
339 cal_offset[
band] = cal_mod->offset[
band];
340 }
else if (cal_mod->flag == 3) {
342 cal_offset[
band] = cal_mod->offset[
band];
345 cal_mod->gain[
band] = cal_gain[
band];
346 cal_mod->offset[
band] = cal_offset[
band];
351 (float32) (1.0 / (mside1_const[
band] -
352 mside1_linear_1[
band]*(1.0 - exp(-mside1_exponential_1[
band] * delta_t)) -
353 mside1_linear_2[
band]*(1.0 - exp(-mside1_exponential_2[
band] * delta_t))));
355 (float32) (mside2_const[
band] -
356 mside2_linear_1[
band]*(1.0 - exp(-mside2_exponential_1[
band] * delta_t)) -
357 mside2_linear_2[
band]*(1.0 - exp(-mside2_exponential_2[
band] * delta_t)));
360 fptemp_corr[
band] = (float32) (1.0 +
366 itemp_corr[
band] = (float32) (1.0 +
383 if ((strcmp(
dtype,
"SOL") != 0) && (strcmp(
dtype,
"TDI") != 0) && (strcmp(
dtype,
"IGC") != 0))
387 (float32) ((float64) l1b_data[
band * nsamp +
pixel] * cal_gain[
band]
463 - 7 * (
year + (month + 9) / 12) / 4
double fp_tcorr[BANDS_DIMS_1A]
int cal2jday(int year, int month, int mday)
int jul2jday(int year, int yday)
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
double fp_tref[BANDS_DIMS_1A]
int32_t jday(int16_t i, int16_t j, int16_t k)
float32 cal_counts[NBANDS][4][5]
int32 get_cal(char *cal_path, int16 syear, int16 sday, int16 eday, int32 msec, char *dtype, int16 *tdi, int16 *cal_year, int16 *cal_day, int16 *ref_year, int16 *ref_day, int16 *ref_min, float32 temps[256][BANDS], float32 scan_mod[2][1285], float32 mirror[2][BANDS], float64 *t_const, float64 *t_linear, float64 *t_quadratic, float32 *cal_offs, float32 counts[BANDS][4][5], float32 rads[BANDS][4][5])
double inst_tcorr[BANDS_DIMS_1A]
int16_t tdi[BANDS_DIMS_1A]
float32 cal_rads[NBANDS][4][5]
this program makes no use of any feature of the SDP Toolkit that could generate such a then geolocation is calculated at that and then aggregated up to Resolved feature request Bug by adding three new int8 SDSs for each high resolution pixel
float fp_temps[256][BANDS_DIMS_1A]
double inst_tref[BANDS_DIMS_1A]
int32_t calibrate_l1a(char *cal_path, int16_t syear, int16_t sday, int32_t smsec, int16_t eday, int32_t msec, char *dtype, int32_t nsta, int32_t ninc, int32_t nsamp, float *dark_mean, int16_t *gain, int16_t *tdi, int16_t *scan_temp, float *inst_temp, int16_t side, int16_t *l1a_data, float *l1b_data, cal_mod_struc *cal_mod)