radolan  1.2.0
netcdf_converter.h
1 /* The MIT License (MIT)
2  *
3  * (c) Jürgen Simon 2014 (juergen.simon@uni-bonn.de)
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy
6  * of this software and associated documentation files (the "Software"), to deal
7  * in the Software without restriction, including without limitation the rights
8  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9  * copies of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21  * SOFTWARE.
22  */
23 
24 #ifndef RADOLAN_NETCDF_CONVERTER_H
25 #define RADOLAN_NETCDF_CONVERTER_H
26 
27 #include <string>
28 #include <netcdf>
29 #include <radolan/radolan.h>
30 
31 namespace Radolan {
32 
38  {
39 
40  public:
41 
57  static
58  netCDF::NcFile *convertFile(const char *radolanPath,
59  const char *netcdfPath,
60  bool write_one_bytes_as_byte = false,
61  const RDDataType *threshold = NULL,
62  netCDF::NcFile::FileMode mode = netCDF::NcFile::replace,
63  bool omitOutside = true) throw(RDConversionException);
64 
79  static
80  netCDF::NcFile *convertScan(RDScan *scan,
81  const char *netcdfPath,
82  bool write_one_bytes_as_byte,
83  const RDDataType *threshold = NULL,
84  netCDF::NcFile::FileMode mode = netCDF::NcFile::write) throw(RDConversionException);
85 
94  static
95  void printConvertedFile(netCDF::NcFile *file, int latVertices = 20, int lonVertices = 20);
96 
101  static
102  const char *getStandardName(RDScanType scanType);
103  };
104 }
105 
106 #endif
Exception for conversion errors from RADOLAN into other formats.
Data type for reading and handling radolan products.
Definition: types.h:171
This class bundles functions for converting RADOLAN files into CF-Metadata compliant NetCDF files...
static netCDF::NcFile * convertScan(RDScan *scan, const char *netcdfPath, bool write_one_bytes_as_byte, const RDDataType *threshold=NULL, netCDF::NcFile::FileMode mode=netCDF::NcFile::write)
Converts a radolan scan.
static const char * getStandardName(RDScanType scanType)
CF-Metadata &#39;standard_name&#39; for the given scan type.
static void printConvertedFile(netCDF::NcFile *file, int latVertices=20, int lonVertices=20)
Simple function to get a visual rep of the file with ascii characters on terminal.
static netCDF::NcFile * convertFile(const char *radolanPath, const char *netcdfPath, bool write_one_bytes_as_byte=false, const RDDataType *threshold=NULL, netCDF::NcFile::FileMode mode=netCDF::NcFile::replace, bool omitOutside=true)
Converts a radolan file.