Go to the documentation of this file.
31 navblk_sType navblk[],
32 tilt_states_sType *tiltblk,
37 INT32 first_plus_1 = -1;
43 char node[2][11] = {
"Ascending",
"Descending"};
70 if (scene->mnftype ==
GACTYPE) {
90 scene->node_lon = xnodel;
92 scene->ntilts = tiltblk->ntilts;
93 memcpy(scene->tilt_flags, tiltblk->tilt_flags,
94 sizeof (scene->tilt_flags));
95 memcpy(scene->tilt_ranges, tiltblk->tilt_ranges,
96 sizeof (scene->tilt_ranges));
101 for (
i = 0;
i < scene->nscan;
i++) {
107 if ((scene->mnftype !=
LUNTYPE) && (scene->mnftype !=
SOLTYPE) && nbad < 10)
108 printf(
"-W- %s: bad navigation at scan %d\n", __FILE__,
i);
113 if ((navblk[
i].nflag[0] == 0) && (navFlag[
i] == 0)) {
114 navblk[
i].nflag[0] = 1;
115 navblk[
i].nflag[1] = 1;
123 if ((nbad > scene->nscan - 3) || (scene->mnftype ==
LUNTYPE)
124 || (scene->mnftype ==
SOLTYPE)) {
125 scene->upper_left_lon = -999.0;
126 scene->upper_left_lat = -99.0;
127 scene->upper_right_lon = -999.0;
128 scene->upper_right_lat = -99.0;
129 scene->lower_left_lon = -999.0;
130 scene->lower_left_lat = -99.0;
131 scene->lower_right_lon = -999.0;
132 scene->lower_right_lat = -99.0;
133 scene->center_lon = -999.0;
134 scene->center_lat = -99.0;
135 scene->center_solz = -999.0;
136 scene->start_center_lon = -999.0;
137 scene->start_center_lat = -99.0;
138 scene->end_center_lon = -999.0;
139 scene->end_center_lat = -99.0;
140 scene->start_center_lon = -999.0;
141 scene->northern_lat = -99.0;
142 scene->southern_lat = -99.0;
143 scene->eastern_lon = -999.0;
144 scene->western_lon = -999.0;
149 if (scene->type !=
HRPT)
158 for (
i = 0;
i < scene->nscan;
i++) {
162 else if (first_plus_1 < 0)
171 center = (last + first) / 2;
174 scene->center_scan_line =
center + 1;
182 scene->northern_lat = -90.0;
183 scene->southern_lat = 90.0;
184 scene->eastern_lon = 0.0;
185 scene->western_lon = 0.0;
188 for (
i = 0;
i < scene->nscan;
i++) {
202 if (
lat[cpix] > lastLat)
211 scene->upper_left_lon =
lon[0];
212 scene->upper_left_lat =
lat[0];
213 scene->upper_right_lon =
lon[
npix - 1];
214 scene->upper_right_lat =
lat[
npix - 1];
215 scene->start_center_lon =
lon[cpix];
216 scene->start_center_lat =
lat[cpix];
218 }
else if (
i == first_plus_1) {
232 scene->center_lon =
lon[cpix];
233 scene->center_lat =
lat[cpix];
234 scene->center_solz =
solz[cpix];
236 }
else if (
i == last) {
237 scene->lower_left_lon =
lon[0];
238 scene->lower_left_lat =
lat[0];
239 scene->lower_right_lon =
lon[
npix - 1];
240 scene->lower_right_lat =
lat[
npix - 1];
241 scene->end_center_lon =
lon[cpix];
242 scene->end_center_lat =
lat[cpix];
250 scene->northern_lat =
MAX(scene->northern_lat,
lat[
j]);
251 scene->southern_lat =
MIN(scene->southern_lat,
lat[
j]);
256 scene->western_lon =
westernmost(scene->western_lon,
258 scene->eastern_lon =
easternmost(scene->eastern_lon,
262 scene->western_lon =
westernmost(scene->western_lon,
264 scene->eastern_lon =
easternmost(scene->eastern_lon,
279 for (
i = 0;
i < tiltblk->ntilts;
i++) {
281 srec = tiltblk->tilt_ranges[
i][0] - 1;
282 erec = tiltblk->tilt_ranges[
i][1] - 1;
284 while (!navFlag[srec]) {
285 if (srec == erec)
break;
289 while (!navFlag[erec]) {
290 if (erec == srec)
break;
297 navblk[srec].sen_mat,
299 navblk[srec].sun_ref,
303 scene->tilt_lons[
i][0][0] =
lon[0];
304 scene->tilt_lons[
i][0][1] =
lon[
npix - 1];
305 scene->tilt_lats[
i][0][0] =
lat[0];
306 scene->tilt_lats[
i][0][1] =
lat[
npix - 1];
309 scene->tilt_lons[
i][0][0] = 0.0;
310 scene->tilt_lons[
i][0][1] = 0.0;
311 scene->tilt_lats[
i][0][0] = 0.0;
312 scene->tilt_lats[
i][0][1] = 0.0;
317 navblk[erec].sen_mat,
319 navblk[erec].sun_ref,
323 scene->tilt_lons[
i][1][0] =
lon[0];
324 scene->tilt_lons[
i][1][1] =
lon[
npix - 1];
325 scene->tilt_lats[
i][1][0] =
lat[0];
326 scene->tilt_lats[
i][1][1] =
lat[
npix - 1];
329 scene->tilt_lons[
i][1][0] = 0.0;
330 scene->tilt_lons[
i][1][1] = 0.0;
331 scene->tilt_lats[
i][1][0] = 0.0;
332 scene->tilt_lats[
i][1][1] = 0.0;
355 if (navblk->nflag[0] != 0)
367 if (isnan(
lat[0]) ||
lat[0] == 999.0)
381 if (
fabs(lon1 - lon2) < 190.0)
382 return (
MIN(lon1, lon2));
384 return (
MAX(lon1, lon2));
388 if (
fabs(lon1 - lon2) < 190.0)
389 return (
MAX(lon1, lon2));
391 return (
MIN(lon1, lon2));
double yds2unix(int16_t year, int16_t day, double secs)
int geonav_(FLOAT32 pos[3], FLOAT32 rm[3][3], FLOAT32 coef[6], FLOAT32 sunref[3], INT32 *spix, INT32 *ipix, INT32 *npix, FLOAT32 lat[], FLOAT32 lon[], FLOAT32 solz[], FLOAT32 sola[], FLOAT32 senz[], FLOAT32 sena[])
FLOAT32 easternmost(FLOAT32 lon1, FLOAT32 lon2)
int getGeoNav(navblk_sType *navblk, INT32 spix, INT32 ipix, INT32 npix, FLOAT32 lat[], FLOAT32 lon[], FLOAT32 solz[], FLOAT32 sola[], FLOAT32 senz[], FLOAT32 sena[])
FLOAT32 westernmost(FLOAT32 lon1, FLOAT32 lon2)
void unix2yds(double usec, short *year, short *day, double *secs)
int getl0scene_nav(FLOAT32 xnodel, INT32 tnode, navblk_sType navblk[], tilt_states_sType *tiltblk, swl0scene *scene)
int scan_ell(float p[3], double sm[3][3], double coef[10])
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 and prod_ix set to PARAM_TYPE_INT name_prefix is compared with the beginning of the product name If name_suffix is not empty the it must match the end of the product name The characters right after the prefix are read as an integer and prod_ix is set to that number strncpy(l2prod->name_prefix, "myprod", UNITLEN)