JURASSIC
obsfmt.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) 2013-2025 Forschungszentrum Juelich GmbH
18*/
19
25#include "jurassic.h"
26
27int main(
28 int argc,
29 char *argv[]) {
30
31 ctl_t ctl;
32
33 static obs_t obs;
34
35 /* Check arguments... */
36 if (argc < 6)
37 ERRMSG("Give parameters: <ctl> <obs_in> <obsfmt_in>"
38 " <obs_out> <obsfmt_out>");
39
40 /* Read control parameters... */
41 read_ctl(argc, argv, &ctl);
42
43 /* Read observation data... */
44 ctl.obsfmt = atoi(argv[3]);
45 read_obs(NULL, argv[2], &ctl, &obs);
46
47 /* Write observation data... */
48 ctl.obsfmt = atoi(argv[5]);
49 write_obs(NULL, argv[4], &ctl, &obs);
50
51 return EXIT_SUCCESS;
52}
void read_ctl(int argc, char *argv[], ctl_t *ctl)
Read model control parameters from command-line and configuration input.
Definition: jurassic.c:5322
void read_obs(const char *dirname, const char *filename, const ctl_t *ctl, obs_t *obs)
Read observation data from an input file.
Definition: jurassic.c:5480
void write_obs(const char *dirname, const char *filename, const ctl_t *ctl, const obs_t *obs)
Write observation data to an output file in ASCII or binary format.
Definition: jurassic.c:7033
JURASSIC library declarations.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
Definition: jurassic.h:948
int main(int argc, char *argv[])
Definition: obsfmt.c:27
Control parameters.
Definition: jurassic.h:1051
int obsfmt
Observation data file format (1=ASCII, 2=binary).
Definition: jurassic.h:1111
Observation geometry and radiance data.
Definition: jurassic.h:1277