IODA Bundle
odb2netcdf_main.cc
Go to the documentation of this file.
1
#include <unistd.h>
2
3
#include <iostream>
4
#include <string>
5
6
#include <netcdfcpp.h>
7
8
#include "odb_api/odbcapi.h"
9
#include "odb_api/CommandLineParser.h"
10
#include "odb_api/ODBModule.h"
11
12
#include "
Odb2NetCDF.h
"
13
#include "Odb2NetcdfModule.h"
14
15
/// @author Anne Fouilloux
16
17
using namespace
std
;
18
using namespace
eckit
;
19
using namespace
odc
;
20
using namespace
odc::tool
;
21
22
static
const
string
usage
=
"Usage: odb2netcdf -i [odb_filename|odb_filename_prefix] [-2d] -o netcdf_filename"
;
23
24
int
main
(
int
argc,
char
*argv[])
25
{
26
odb_start_with_args
(argc, argv);
27
28
CommandLineParser
args
(argc, argv);
29
args
.registerOptionWithArgument(
"-i"
);
30
args
.registerOptionWithArgument(
"-o"
);
31
32
bool
twoD (
args
.optionIsSet(
"-2d"
));
33
string
input (
args
.optionArgument<
string
>(
"-i"
,
""
)),
34
output (
args
.optionArgument<
string
>(
"-o"
,
""
));
35
36
if
(input.size() && output.size())
37
{
38
if
(twoD)
39
{
40
Odb2NetCDF_2D
converter (input, output);
41
converter.
convert
();
42
}
43
else
44
{
45
Odb2NetCDF_1D
converter (input, output);
46
converter.
convert
();
47
}
48
return
0;
49
}
50
51
cerr <<
usage
<< endl;
52
53
return
1;
54
}
55
Odb2NetCDF.h
Odb2NetCDF_1D
Definition:
Odb2NetCDF.h:24
Odb2NetCDF_1D::convert
virtual void convert()
Definition:
Odb2NetCDF.cc:77
Odb2NetCDF_2D
Definition:
Odb2NetCDF.h:33
Odb2NetCDF_2D::convert
virtual void convert()
Definition:
Odb2NetCDF.cc:133
odc::tool::CommandLineParser
Definition:
CommandLineParser.h:27
airnow2ioda-nc.args
args
Definition:
airnow2ioda-nc.py:109
eckit
Definition:
DistributionUtils.h:15
odc::tool
Definition:
CommandLineParser.cc:20
odc
Definition:
ColumnInfo.h:23
std
Definition:
encode.cc:30
main
int main(int argc, char *argv[])
Definition:
odb2netcdf_main.cc:24
usage
static const string usage
Definition:
odb2netcdf_main.cc:22
odb_start_with_args
void odb_start_with_args(int argc, char *argv[])
Definition:
odccapi.cc:85
odc
src
odc
odb2netcdf
odb2netcdf_main.cc
Generated on Fri Aug 20 2021 11:49:09 for IODA Bundle by
1.9.1