3 void cz_ll_upd(l1_data_struc *l1_data, gattr_struc *gattr)
26 int i,
j, nctlpix,
nlin, ctr_ctl_pt;
28 float maxlat, minlat, low_neg, low_pos, hi_neg, hi_pos;
33 nctlpix = gattr->n_ctl_pt;
34 nlin = gattr->scan_lines;
52 if ((l1_data->cal_sum[
i * 5 + 3 ] == 0) &&
53 (l1_data->cal_sum[
i * 5 + 4 ] == 0) &&
54 (l1_data->cal_scan[
i * 6 ] == 0) &&
55 (l1_data->cal_scan[
i * 6 + 1 ] == 0) &&
56 (l1_data->cal_scan[
i * 6 + 2 ] == 0) &&
57 (l1_data->cal_scan[
i * 6 + 3 ] == 0) &&
58 (l1_data->cal_scan[
i * 6 + 4 ] == 0)) {
60 for (
j = 0;
j < nctlpix;
j++) {
61 if (l1_data->ctl_pt_lat[
loc ] > maxlat)
62 maxlat = l1_data->ctl_pt_lat[
loc ];
63 if (l1_data->ctl_pt_lat[
loc ] < minlat)
64 minlat = l1_data->ctl_pt_lat[
loc ];
65 if (l1_data->ctl_pt_lon[
loc ] >= 0.) {
66 if (l1_data->ctl_pt_lon[
loc ] > hi_pos)
67 hi_pos = l1_data->ctl_pt_lon[
loc ];
68 if (l1_data->ctl_pt_lon[
loc ] < low_pos)
69 low_pos = l1_data->ctl_pt_lon[
loc ];
71 if (l1_data->ctl_pt_lon[
loc ] > hi_neg)
72 hi_neg = l1_data->ctl_pt_lon[
loc ];
73 if (l1_data->ctl_pt_lon[
loc ] < low_neg)
74 low_neg = l1_data->ctl_pt_lon[
loc ];
84 gattr->limits[0] = maxlat;
85 gattr->limits[1] = minlat;
86 if ((low_neg == 999.) && (low_pos != 999.)) {
87 gattr->limits[2] = low_pos;
88 gattr->limits[3] = hi_pos;
89 }
else if ((low_neg != 999.) && (low_pos == 999.)) {
90 gattr->limits[2] = low_neg;
91 gattr->limits[3] = hi_neg;
92 }
else if ((hi_neg > -90.) && (low_pos < 90)) {
93 gattr->limits[2] = low_neg;
94 gattr->limits[3] = hi_pos;
95 }
else if ((low_neg <= -90.) && (hi_pos >= 90)) {
96 gattr->limits[2] = low_pos;
97 gattr->limits[3] = hi_neg;
99 gattr->limits[2] = -180.;
100 gattr->limits[3] = 180.;
107 gattr->up_lft_lat = l1_data->ctl_pt_lat[ 0 ];
108 gattr->up_lft_lon = l1_data->ctl_pt_lon[ 0 ];
109 gattr->lo_lft_lat = l1_data->ctl_pt_lat[ (
nlin - 1) * nctlpix ];
110 gattr->lo_lft_lon = l1_data->ctl_pt_lon[ (
nlin - 1) * nctlpix ];
111 gattr->up_rgt_lat = l1_data->ctl_pt_lat[ nctlpix - 1 ];
112 gattr->up_rgt_lon = l1_data->ctl_pt_lon[ nctlpix - 1 ];
114 l1_data->ctl_pt_lat[ (
nlin - 1) * nctlpix + (nctlpix - 1) ];
116 l1_data->ctl_pt_lon[ (
nlin - 1) * nctlpix + (nctlpix - 1) ];
118 ctr_ctl_pt = (nctlpix - 1) / 2;
119 gattr->start_cntr_lat = l1_data->ctl_pt_lat[ ctr_ctl_pt ];
120 gattr->start_cntr_lon = l1_data->ctl_pt_lon[ ctr_ctl_pt ];
121 gattr->end_cntr_lat =
122 l1_data->ctl_pt_lat[ (
nlin - 1) * nctlpix + ctr_ctl_pt ];
123 gattr->end_cntr_lon =
124 l1_data->ctl_pt_lon[ (
nlin - 1) * nctlpix + ctr_ctl_pt ];
126 l1_data->ctl_pt_lat[ (
nlin - 1) / 2 * nctlpix + ctr_ctl_pt ];
128 l1_data->ctl_pt_lon[ (
nlin - 1) / 2 * nctlpix + ctr_ctl_pt ];