36 double dmin = 1e100, x0[3], x1[3];
38 int ichan, track = -1, track2, xtrack = -1, xtrack2, format;
42 ERRMSG(
"Give parameters: <ctl> <iasi_l1b_file> "
43 "[index <track> <xtrack> | geo <lon> <lat>] <spec.tab>");
46 format = (int) scan_ctl(argc, argv,
"FORMAT", -1,
"1", NULL);
52 printf(
"Read IASI Level-1C data file: %s\n", argv[2]);
56 if (argv[3][0] ==
'i') {
57 track = atoi(argv[4]);
58 xtrack = atoi(argv[5]);
63 geo2cart(0, atof(argv[4]), atof(argv[5]), x0);
64 for (track2 = 0; track2 < iasi_rad->
ntrack; track2++)
65 for (xtrack2 = 0; xtrack2 <
L1_NXTRACK; xtrack2++) {
66 geo2cart(0, iasi_rad->
Longitude[track2][xtrack2],
67 iasi_rad->
Latitude[track2][xtrack2], x1);
68 if (DIST2(x0, x1) < dmin) {
75 ERRMSG(
"Geolocation not covered by granule!");
79 if (track < 0 || track >= iasi_rad->
ntrack)
80 ERRMSG(
"Along-track index out of range!");
82 ERRMSG(
"Across-track index out of range!");
85 printf(
"Write spectrum: %s\n", argv[6]);
86 if (!(out = fopen(argv[6],
"w")))
87 ERRMSG(
"Cannot create file!");
91 "# $1 = time (seconds since 01-JAN-2000, 00:00 UTC)\n"
92 "# $2 = satellite longitude [deg]\n"
93 "# $3 = satellite latitude [deg]\n"
94 "# $4 = footprint longitude [deg]\n"
95 "# $5 = footprint latitude [deg]\n"
96 "# $6 = wavenumber [cm^-1]\n"
97 "# $7 = brightness temperature [K]\n"
98 "# $8 = radiance [W/(m^2 sr cm^-1)]\n\n");
102 fprintf(out,
"%.2f %g %g %g %g %g %g %g\n",
103 iasi_rad->
Time[track][xtrack],
108 iasi_rad->
freq[ichan],
109 BRIGHT(iasi_rad->
Rad[track][xtrack][ichan],
110 iasi_rad->
freq[ichan]),
111 iasi_rad->
Rad[track][xtrack][ichan]);
void iasi_read(int format, char *filename, iasi_rad_t *iasi_rad)
Read IASI Level-1 data.
IASI Code Collection library declarations.
#define L1_NXTRACK
Across-track size of IASI radiance granule (don't change).
#define IASI_L1_NCHAN
Number of channels of IASI radiance granule.
int main(int argc, char *argv[])
IASI converted Level-1 radiation data.
double Longitude[L1_NTRACK][L1_NXTRACK]
Longitude of the sounder pixel.
double Latitude[L1_NTRACK][L1_NXTRACK]
Latitude of the sounder pixel.
double Time[L1_NTRACK][L1_NXTRACK]
Seconds since 2000-01-01 for each sounder pixel.
double freq[IASI_L1_NCHAN]
channel wavenumber [cm^-1]
int ntrack
Number of along-track samples.
double Sat_lon[L1_NTRACK]
Estimated longitude of the satellite.
float Rad[L1_NTRACK][L1_NXTRACK][IASI_L1_NCHAN]
Radiance [W/(m^2 sr cm^-1)].
double Sat_lat[L1_NTRACK]
Estimated latitude of the satellite.