55 ERRMSG(
"Missing or invalid command-line arguments.\n\n"
56 "Usage: obs2spec <ctl> <obs> <spec.tab> [KEY VALUE ...]\n\n"
57 "Use -h for full help.");
66 read_obs(NULL, argv[2], &ctl, obs, 0);
69 LOG(1,
"Write spectra: %s", argv[3]);
72 if (!(out = fopen(argv[3],
"w")))
73 ERRMSG(
"Cannot create file!");
77 "# $1 = time (seconds since 2000-01-01T00:00Z)\n"
78 "# $2 = observer altitude [km]\n"
79 "# $3 = observer longitude [deg]\n"
80 "# $4 = observer latitude [deg]\n"
81 "# $5 = view point altitude [km]\n"
82 "# $6 = view point longitude [deg]\n"
83 "# $7 = view point latitude [deg]\n"
84 "# $8 = tangent point altitude [km]\n"
85 "# $9 = tangent point longitude [deg]\n"
86 "# $10 = tangent point latitude [deg]\n"
87 "# $11 = channel frequency [cm^-1]\n"
88 "# $12 = channel radiance [W/(m^2 sr cm^-1)]\n"
89 "# $13 = channel transmittance [1]\n");
92 for (
int ir = 0; ir < obs->
nr; ir++) {
94 for (
int id = 0;
id < ctl.
nd;
id++)
95 fprintf(out,
"%.2f %g %g %g %g %g %g %g %g %g %.4f %g %g\n",
115 printf(
"\nJURASSIC spectrum writer.\n\n");
116 printf(
"Write radiances and transmittances from an observation file to\n");
117 printf(
"a per-channel spectrum table.\n\n");
119 printf(
" obs2spec <ctl> <obs> <spec.tab> [KEY VALUE ...]\n\n");
120 printf(
"Arguments:\n");
121 printf(
" <ctl> Control file.\n");
122 printf(
" <obs> Observation input file.\n");
123 printf(
" <spec.tab> Output spectrum table.\n");
124 printf(
" [KEY VALUE] Optional control parameters.\n\n");
125 printf(
"Common control parameters:\n");
127 (
" OBSFMT Observation file format from the control file.\n");
129 (
" ND, NU[i] Spectral channels in observation files.\n");
130 printf(
" WRITE_BBT Brightness-temperature output flag.\n\n");
131 printf(
"Further information:\n");
132 printf(
" Manual: https://slcs-jsc.github.io/jurassic/\n");
void read_ctl(int argc, char *argv[], ctl_t *ctl)
Read model control parameters from command-line and configuration input.
void read_obs(const char *dirname, const char *filename, const ctl_t *ctl, obs_t *obs, int profile)
Read observation data from an input file.
JURASSIC library declarations.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define USAGE
Print usage information on -h or --help.
#define ALLOC(ptr, type, n)
Allocate memory for an array.
#define LOG(level,...)
Print a log message with a specified logging level.
int main(int argc, char *argv[])
double nu[ND]
Centroid wavenumber of each channel [cm^-1].
int nd
Number of radiance channels.
Observation geometry and radiance data.
double tau[ND][NR]
Transmittance of ray path.
double rad[ND][NR]
Radiance [W/(m^2 sr cm^-1)].
double tplon[NR]
Tangent point longitude [deg].
double vpz[NR]
View point altitude [km].
double vplat[NR]
View point latitude [deg].
double obslon[NR]
Observer longitude [deg].
double obslat[NR]
Observer latitude [deg].
double obsz[NR]
Observer altitude [km].
double tplat[NR]
Tangent point latitude [deg].
double vplon[NR]
View point longitude [deg].
double time[NR]
Time (seconds since 2000-01-01T00:00Z).
double tpz[NR]
Tangent point altitude [km].
int nr
Number of ray paths.