JURASSIC
limb.c
Go to the documentation of this file.
1/*
2 This file is part of JURASSIC.
3
4 JURASSIC is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 JURASSIC is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with JURASSIC. If not, see <http://www.gnu.org/licenses/>.
16
17 Copyright (C) 2003-2021 Forschungszentrum Juelich GmbH
18*/
19
25#include "jurassic.h"
26
27int main(
28 int argc,
29 char *argv[]) {
30
31 static ctl_t ctl;
32 static obs_t obs;
33
34 /* Check arguments... */
35 if (argc < 3)
36 ERRMSG("Give parameters: <ctl> <obs>");
37
38 /* Read control parameters... */
39 read_ctl(argc, argv, &ctl);
40 double obsz = scan_ctl(argc, argv, "OBSZ", -1, "780", NULL);
41 double t0 = scan_ctl(argc, argv, "T0", -1, "0", NULL);
42 double t1 = scan_ctl(argc, argv, "T1", -1, "0", NULL);
43 double dt = scan_ctl(argc, argv, "DT", -1, "1", NULL);
44 double z0 = scan_ctl(argc, argv, "Z0", -1, "3", NULL);
45 double z1 = scan_ctl(argc, argv, "Z1", -1, "68", NULL);
46 double dz = scan_ctl(argc, argv, "DZ", -1, "1", NULL);
47
48 /* Create measurement geometry... */
49 for (double t = t0; t <= t1; t += dt)
50 for (double z = z0; z <= z1; z += dz) {
51 obs.time[obs.nr] = t;
52 obs.obsz[obs.nr] = obsz;
53 obs.vpz[obs.nr] = z;
54 obs.vplat[obs.nr] = 180 / M_PI * acos((RE + z) / (RE + obsz));
55 if ((++obs.nr) >= NR)
56 ERRMSG("Too many rays!");
57 }
58
59 /* Write observation data... */
60 write_obs(NULL, argv[2], &ctl, &obs);
61
62 return EXIT_SUCCESS;
63}
void read_ctl(int argc, char *argv[], ctl_t *ctl)
Read forward model control parameters.
Definition: jurassic.c:4561
void write_obs(const char *dirname, const char *filename, ctl_t *ctl, obs_t *obs)
Write observation data.
Definition: jurassic.c:5697
double scan_ctl(int argc, char *argv[], const char *varname, int arridx, const char *defvalue, char *value)
Search control parameter file for variable entry.
Definition: jurassic.c:5138
JURASSIC library declarations.
#define RE
Mean radius of Earth [km].
Definition: jurassic.h:279
#define ERRMSG(...)
Print error message and quit program.
Definition: jurassic.h:217
#define NR
Maximum number of ray paths.
Definition: jurassic.h:348
int main(int argc, char *argv[])
Definition: limb.c:27
Forward model control parameters.
Definition: jurassic.h:521
Observation geometry and radiance data.
Definition: jurassic.h:714
double vpz[NR]
View point altitude [km].
Definition: jurassic.h:732
double vplat[NR]
View point latitude [deg].
Definition: jurassic.h:738
double obsz[NR]
Observer altitude [km].
Definition: jurassic.h:723
double time[NR]
Time (seconds since 2000-01-01T00:00Z).
Definition: jurassic.h:720
int nr
Number of ray paths.
Definition: jurassic.h:717