8 int const number_of_scans,
182 #define N_ELEMENTS(foo) ((int) (sizeof(foo) / sizeof(foo[0])))
185 #define MAX_SC_DATA_NAME 30
186 #define LAST_VALID_SCAN_INDEX 2
203 static const char filefunc[] = __FILE__
", GEO_read_L1Apacket_data";
205 static char SAfieldnm[] =
219 (long)
sizeof(sc_ancillary_data[0].second_header) },
223 (long)
sizeof(sc_ancillary_data[0].posvel) },
227 (long)
sizeof(sc_ancillary_data[0].attit_angvel) }
229 char *ancil_data_name[2];
233 if (number_of_scans == 0)
234 return PGS_S_SUCCESS;
237 if(l1a_file ==
NULL || number_of_scans < 0 ||
241 sprintf(msgbuf,
"l1a_file = %p, number_of_scans = %d, "
242 "sc_ancillary_data = %p, SAside = %p, FRside = %p, ss_cp_mode = %p",
243 (
void*)l1a_file, number_of_scans, (
void*)sc_ancillary_data,
244 (
void*)SAside, (
void*)FRside, (
void*)ss_cp_mode);
258 packet_data[0].dims[0] = (
long int) number_of_scans;
259 packet_data[0].data = raw_mir_enc;
260 packet_data[1].dims[0] = (
long int) number_of_scans;
261 packet_data[1].data = view_sector_start;
264 for (obj = 0; obj <
N_ELEMENTS(packet_data); obj++)
269 start, packet_data[obj].dims, packet_data[obj].
data) != MAPIOK)
271 sprintf(msgbuf,
"getMODISarray(\"%s\", \"%s\", \""
273 packet_data[obj].name);
294 int32 i32 = (int32)raw_mir_enc[
scan][enc];
295 earth_encoder_times[
scan][enc] =
296 (uint16)(i32 <0 ? (int32)0x10000 + i32 : i32);
305 for (obj = 0; obj <
N_ELEMENTS(vdata_fields); obj++)
307 buffsize = vdata_fields[obj].size;
308 if (getMODIStable(l1a_file, ancil_data_name[
phase],
310 (
long)number_of_scans, &buffsize,
311 (
unsigned char *)&sc_ancillary_data[
phase] +
312 vdata_fields[obj].
offset) != MAPIOK)
314 sprintf(msgbuf,
"getMODIStable(\"%s\", \"%s\", \""
316 l1a_file->filename, ancil_data_name[
phase],
317 vdata_fields[obj].field_names, (
long)number_of_scans);
328 buffsize=(long)
sizeof(FRdata);
330 (
long)number_of_scans, &buffsize, (
unsigned char *) FRdata) != MAPIOK)
332 sprintf(msgbuf,
"getMODIStable(\"%s\", \"" MAJCYC3COF7 "\", \""
334 l1a_file->filename, FRfieldnm, (
long)number_of_scans);
341 buffsize=(long)
sizeof(SAdata);
343 (
long)number_of_scans, &buffsize, (
unsigned char *) SAdata) != MAPIOK)
345 sprintf(msgbuf,
"getMODIStable(\"%s\", \"" MAJCYC5BOF7 "\", \""
347 l1a_file->filename, SAfieldnm, (
long)number_of_scans);
353 buffsize = (long)(number_of_scans*
sizeof*ss_cp_mode);
355 M01SS_CP_MODE, 0
L, (
long)number_of_scans, &buffsize,
356 (
unsigned char *)ss_cp_mode) != MAPIOK)
358 sprintf(msgbuf,
"getMODIStable(\"%s\", \"" M01MAJCYCALL1
"\", \""
360 l1a_file->filename, (
long)number_of_scans);
370 for(obj=number_of_scans-1; obj>=0; obj--)
378 else for(obj=number_of_scans-1; obj>=0; obj--)
387 if (obj == number_of_scans-1)
406 if(obj == number_of_scans - 1)
418 return PGS_S_SUCCESS;