Go to the documentation of this file.
31 #include <sys/param.h>
37 int mkmeta(
const char *metaFile,
const char *
l1aFile, swl0scene *scene, swl0ctl *l0ctl) {
44 char fullname[MAXPATHLEN];
48 if ((fp = fopen(metaFile,
"w")) ==
NULL) {
50 "-E- %s line %d: error opening %s for writing.\n",
51 __FILE__, __LINE__, metaFile);
57 fprintf(fp,
"%s_version=%s\n", l0ctl->progname,
L01VERSION);
60 fprintf(fp,
"l1_filename=%s\n",
basename(tmppath));
64 fprintf(fp,
"l1_pathname=%s\n", realpath(dirname(tmppath), fullname));
69 if (scene->type ==
HRPT)
72 dataType = scene->mnftype;
73 fprintf(fp,
"datatype=%s\n",
DTypeString(dataType));
75 if (scene->lower_left_lat < -90.0)
78 fprintf(fp,
"format=LEVEL_1\n");
79 fprintf(fp,
"scan_line_count=%d\n", scene->nscan);
80 fprintf(fp,
"filled_scan_count=%d\n", 0);
81 fprintf(fp,
"start_time=%s\n",
unix2timeStr(scene->stime));
82 fprintf(fp,
"stop_time=%s\n",
unix2timeStr(scene->etime));
83 fprintf(fp,
"orbit_number=%d\n", scene->orbnum);
85 fprintf(fp,
"navstat=%d\n", navstat);
86 fprintf(fp,
"lower_left_lat=%.2f\n", scene->lower_left_lat);
87 fprintf(fp,
"lower_left_lon=%.2f\n", scene->lower_left_lon);
88 fprintf(fp,
"lower_right_lat=%.2f\n", scene->lower_right_lat);
89 fprintf(fp,
"lower_right_lon=%.2f\n", scene->lower_right_lon);
90 fprintf(fp,
"upper_left_lat=%.2f\n", scene->upper_left_lat);
91 fprintf(fp,
"upper_left_lon=%.2f\n", scene->upper_left_lon);
92 fprintf(fp,
"upper_right_lat=%.2f\n", scene->upper_right_lat);
93 fprintf(fp,
"upper_right_lon=%.2f\n", scene->upper_right_lon);
95 tmppath =
strdup(scene->l0file);
96 fprintf(fp,
"raw_filename=%s\n",
basename(scene->l0file));
99 tmppath =
strdup(scene->l0file);
100 fprintf(fp,
"raw_pathname=%s\n", realpath(dirname(tmppath), fullname));
103 fprintf(fp,
"dataday1=%4d%03d\n",
year,
day);
104 fprintf(fp,
"dataday2=%d\n", 0);
105 fprintf(fp,
"day_night_scene=D\n");
char * strdup(const char *)
void unix2yds(double usec, short *year, short *day, double *secs)
char * DTypeString(unsigned char dataType)
INT32 filesize(const char *filename)
char * unix2timeStr(FLOAT64 usec)