9 MODFILE *
const geo_file,
10 int const l1a_version,
11 PGSt_integer
const param_version,
127 typedef char ephem_inputs_t[
MAX_EA_INPUTS*PGSd_UR_FIELD_SIZE];
128 static ephem_inputs_t *ephem_inputs;
129 typedef char attit_inputs_t[
MAX_EA_INPUTS*PGSd_UR_FIELD_SIZE];
130 static attit_inputs_t *attit_inputs;
132 ephem_inputs = (ephem_inputs_t*) calloc(
MAX_EA_FILES,
sizeof(ephem_inputs_t));
133 attit_inputs = (attit_inputs_t*) calloc(
MAX_EA_FILES,
sizeof(attit_inputs_t));
135 static PGSt_integer num_ephem, num_attit, num_ptrs;
140 PGSt_SMF_status retval = PGS_S_SUCCESS;
145 PGSt_integer temp_ver;
149 char msgbuf[PGSd_UR_FIELD_SIZE*2];
150 char filefunc[] = __FILE__
", GEO_write_input_metadata";
152 if (geo_file ==
NULL || pointer_metadata ==
NULL)
154 sprintf(msgbuf,
"geo_file: %p, pointer_metadata: %p", (
void*)geo_file,
155 (
void*)pointer_metadata);
160 temp_ver = (PGSt_integer)l1a_version;
161 if(PGS_PC_GetUniversalRef(
l1aID, &temp_ver,
164 sprintf(msgbuf,
"PGS_PC_GetUniversalRef(%ld,%d)",
165 (
long)
l1aID, l1a_version);
174 temp_ver = param_version;
175 if(PGS_PC_GetUniversalRef(
PARAM, &temp_ver,
178 sprintf(msgbuf,
"PGS_PC_GetUniversalRef(%ld,%d)",
179 (
long)
PARAM, param_version);
189 if(PGS_PC_GetNumberOfFiles(PGSd_SC_EPHEM_DATA, &num_ephem)
192 sprintf(msgbuf,
"PGS_PC_GetNumberOfFiles(%ld)",
193 (
long)PGSd_SC_EPHEM_DATA);
210 for(ver=0; ver<num_ephem; ver++)
213 if(PGS_PC_GetUniversalRef(PGSd_SC_EPHEM_DATA, &temp_ver,
214 pointer_metadata->
inputpointer[num_ptrs]) != PGS_S_SUCCESS)
216 sprintf(msgbuf,
"PGS_PC_GetUniversalRef(%ld,%d)",
217 (
long)PGSd_SC_EPHEM_DATA, ver+1);
227 input_strings) != PGS_S_SUCCESS)
229 sprintf(msgbuf,
"GEO_get_ephatt_inputs(%ld, %d)",
230 (
long)PGSd_SC_EPHEM_DATA, ver+1);
237 p = ephem_inputs[ver];
241 q = input_strings[
str];
243 while(
q < (
char*)(input_strings +
str + 1) &&
249 ephem_length[ver] =
p - ephem_inputs[ver];
253 if(PGS_PC_GetNumberOfFiles(PGSd_SC_ATTIT_DATA, &num_attit)
254 != PGS_S_SUCCESS && sc_tag!=PGSd_EOS_AM)
259 sprintf(msgbuf,
"PGS_PC_GetNumberOfFiles(%ld)",
260 (
long)PGSd_SC_ATTIT_DATA);
277 for(ver=0; ver<num_attit; ver++)
280 if(PGS_PC_GetUniversalRef(PGSd_SC_ATTIT_DATA, &temp_ver,
281 pointer_metadata->
inputpointer[num_ptrs]) != PGS_S_SUCCESS)
283 sprintf(msgbuf,
"PGS_PC_GetUniversalRef(%ld,%d)",
284 (
long)PGSd_SC_ATTIT_DATA, ver+1);
293 input_strings) != PGS_S_SUCCESS)
295 sprintf(msgbuf,
"GEO_get_ephatt_inputs(%ld, %d)",
296 (
long)PGSd_SC_EPHEM_DATA, ver+1);
303 p = attit_inputs[ver];
307 q = input_strings[
str];
309 while(
q < (
char*)(input_strings +
str + 1) &&
315 attit_length[ver] =
p - attit_inputs[ver];
320 for(ver=0; ver<num_ephem; ver++)
324 if(putMODISfileinfo(geo_file, attribname, TXT, ephem_length[ver],
325 ephem_inputs[ver]) != MAPIOK)
327 sprintf(msgbuf,
"putMODISfileinfo(\"%s\", \"%s\")",
328 geo_file->filename, attribname);
335 for(ver=0; ver<num_attit; ver++)
339 if(putMODISfileinfo(geo_file, attribname, TXT, attit_length[ver],
340 attit_inputs[ver]) != MAPIOK)
342 sprintf(msgbuf,
"putMODISfileinfo(\"%s\", \"%s\")",
343 geo_file->filename, attribname);