JURASSIC
Functions
obsfmt.c File Reference

Convert observation data files. More...

#include "jurassic.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Convert observation data files.

Definition in file obsfmt.c.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 39 of file obsfmt.c.

41 {
42
43 ctl_t ctl;
44
45 static obs_t obs;
46
47 /* Print usage information... */
48 USAGE;
49
50 /* Check arguments... */
51 if (argc < 6)
52 ERRMSG("Missing or invalid command-line arguments.\n\n"
53 "Usage: obsfmt <ctl> <obs_in> <obsfmt_in> <obs_out> <obsfmt_out> [KEY VALUE ...]\n\n"
54 "Use -h for full help.");
55
56 /* Read control parameters... */
57 read_ctl(argc, argv, &ctl);
58
59 /* Read profile indices... */
60 const int prof_in = (int) scan_ctl(argc, argv, "PROF_IN", -1, "0", NULL);
61 const int prof_out = (int) scan_ctl(argc, argv, "PROF_OUT", -1, "0", NULL);
62
63 /* Read observation data... */
64 ctl.obsfmt = atoi(argv[3]);
65 read_obs(NULL, argv[2], &ctl, &obs, prof_in);
66
67 /* Write observation data... */
68 ctl.obsfmt = atoi(argv[5]);
69 write_obs(NULL, argv[4], &ctl, &obs, prof_out);
70
71 return EXIT_SUCCESS;
72}
void read_ctl(int argc, char *argv[], ctl_t *ctl)
Read model control parameters from command-line and configuration input.
Definition: jurassic.c:5516
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.
Definition: jurassic.c:5810
void write_obs(const char *dirname, const char *filename, const ctl_t *ctl, const obs_t *obs, int profile)
Write observation data to an output file in ASCII or binary format.
Definition: jurassic.c:8275
double scan_ctl(int argc, char *argv[], const char *varname, const int arridx, const char *defvalue, char *value)
Scan control file or command-line arguments for a configuration variable.
Definition: jurassic.c:6612
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
Definition: jurassic.h:1325
#define USAGE
Print usage information on -h or --help.
Definition: jurassic.h:1206
Control parameters.
Definition: jurassic.h:1428
int obsfmt
Observation data file format (1=ASCII, 2=binary, 3=netCDF).
Definition: jurassic.h:1488
Observation geometry and radiance data.
Definition: jurassic.h:1657
Here is the call graph for this function: