5 int mstr_last,
int nscan_out, gattr_struc *gattr, l1_data_struc *l1_data)
42 int i,
j, n_ctl,
nscan, time_reset;
51 n_ctl = gattr->n_ctl_pt;
52 nscan = gattr->scan_lines;
56 memcpy(l1_data->ctl_pt_cols, in_dat.ctl_pt_cols,
57 (n_ctl * sizeof (
int)));
60 n_ctl = in_attr.n_ctl_pt;
61 nscan = in_attr.scan_lines;
69 if (in_attr.end_year > gattr->end_year)
71 else if (in_attr.end_day > gattr->end_day)
73 else if (in_attr.end_msec > gattr->end_msec)
76 if (time_reset == 1) {
77 gattr->end_year = in_attr.end_year;
78 gattr->end_day = in_attr.end_day;
79 gattr->end_msec = in_attr.end_msec;
80 strcpy(gattr->end_time, in_attr.end_time);
89 gattr->ilt_flags = gattr->ilt_flags | in_attr.ilt_flags;
90 gattr->parm_presence = gattr->parm_presence | in_attr.parm_presence;
94 sum = (int32_t) gattr->n_miss_scans + (int32_t) in_attr.n_miss_scans;
95 gattr->n_miss_scans = (sum > SHRT_MAX) ? SHRT_MAX : (
short) sum;
97 for (
i = 0;
i < 6;
i++) {
98 sum = (int32_t) gattr->n_scan_mis_chan[
i] + (int32_t) in_attr.n_scan_mis_chan[
i];
99 gattr->n_scan_mis_chan[
i] = (sum > SHRT_MAX) ? SHRT_MAX : (
short) sum;
102 sum = (int32_t) gattr->n_hdt_sync_loss + (int32_t) in_attr.n_hdt_sync_loss;
103 gattr->n_hdt_sync_loss = (sum > SHRT_MAX) ? SHRT_MAX : (
short) sum;
105 sum = (int32_t) gattr->n_hdt_parity_err + (int32_t) in_attr.n_hdt_parity_err;
106 gattr->n_hdt_parity_err = (sum > SHRT_MAX) ? SHRT_MAX : (
short) sum;
108 sum = (int32_t) gattr->n_wbvt_sync_loss + (int32_t) in_attr.n_wbvt_sync_loss;
109 gattr->n_wbvt_sync_loss = (sum > SHRT_MAX) ? SHRT_MAX : (
short) sum;
111 sum = (int32_t) gattr->n_wbvt_slips + (int32_t) in_attr.n_wbvt_slips;
112 gattr->n_wbvt_slips = (sum > SHRT_MAX) ? SHRT_MAX : (
short) sum;
115 printf(
"cz_mov_scn: dataset # (ds_num) = %d, # scans: %d\n",
117 printf(
"cz_mov_scn: file: %s\n",
file);
122 for (
i = 0;
i <= mstr_last;
i++) {
123 if ((mstr->ds_num[
i] == ds_num) && (mstr->exist[
i] == 1)) {
124 in_scn = mstr->scan[
i];
125 out_scn = mstr->out_scan[
i];
131 for (
j = 0;
j < 6;
j++)
132 memcpy(l1_data->counts[
j] + (
NCZCS_PIX * out_scn),
136 l1_data->msec[out_scn] = in_dat.msec[in_scn];
137 l1_data->tilt[out_scn] = in_dat.tilt[in_scn];
138 l1_data->slat[out_scn] = in_dat.slat[in_scn];
139 l1_data->slon[out_scn] = in_dat.slon[in_scn];
140 l1_data->clat[out_scn] = in_dat.clat[in_scn];
141 l1_data->clon[out_scn] = in_dat.clon[in_scn];
142 l1_data->elat[out_scn] = in_dat.elat[in_scn];
143 l1_data->elon[out_scn] = in_dat.elon[in_scn];
144 memcpy(l1_data->cal_sum + (5 * out_scn),
145 in_dat.cal_sum + (5 * in_scn), (5 * sizeof (
unsigned char)));
146 memcpy(l1_data->cal_scan + (6 * out_scn),
147 in_dat.cal_scan + (6 * in_scn), (6 * sizeof (
unsigned char)));
148 memcpy(l1_data->orb_vec + (3 * out_scn),
149 in_dat.orb_vec + (3 * in_scn), (3 * sizeof (
float)));
150 memcpy(l1_data->att_ang + (3 * out_scn),
151 in_dat.att_ang + (3 * in_scn), (3 * sizeof (
float)));
152 l1_data->pos_err[out_scn] = in_dat.pos_err[in_scn];
153 memcpy(l1_data->slope + (6 * out_scn), in_dat.slope + (6 * in_scn),
154 (6 * sizeof (
float)));
155 memcpy(l1_data->intercept + (6 * out_scn),
156 in_dat.intercept + (6 * in_scn), (6 * sizeof (
float)));
157 l1_data->gain[out_scn] = in_dat.gain[in_scn];
158 memcpy(l1_data->ctl_pt_lat + (out_scn * n_ctl),
159 in_dat.ctl_pt_lat + (in_scn * n_ctl), (n_ctl * sizeof (
float)));
160 memcpy(l1_data->ctl_pt_lon + (out_scn * n_ctl),
161 in_dat.ctl_pt_lon + (in_scn * n_ctl), (n_ctl * sizeof (
float)));
162 l1_data->ctl_pt_rows[out_scn] = out_scn + 1;