OGS
|
Definition in file NetCdfConverter.cpp.
#include <tclap/CmdLine.h>
#include <mpi.h>
#include <cctype>
#include <iostream>
#include <limits>
#include <memory>
#include <netcdf>
#include <numeric>
#include <sstream>
#include <string>
#include <utility>
#include "BaseLib/FileTools.h"
#include "BaseLib/Logging.h"
#include "GeoLib/IO/AsciiRasterInterface.h"
#include "GeoLib/Raster.h"
#include "InfoLib/GitInfo.h"
#include "MeshLib/IO/VtkIO/VtuInterface.h"
#include "MeshLib/Mesh.h"
#include "MeshLib/Utils/addPropertyToMesh.h"
#include "MeshToolsLib/MeshGenerators/RasterToMesh.h"
Go to the source code of this file.
Enumerations | |
enum class | OutputType { INVALID , IMAGES , SINGLEMESH , MULTIMESH } |
Functions | |
static void | checkExit (std::string const &str) |
static void | showErrorMessage (std::size_t const error_id, std::size_t const max=0) |
static std::size_t | parseInput (std::string const &request_str, std::size_t const max_val, bool const has_info=false) |
static NcVar | getDimVar (NcFile const &dataset, NcVar const &var, std::size_t const dim) |
static std::pair< double, double > | getDimLength (NcVar const &var, std::size_t const dim) |
static std::vector< std::string > | getArrays (NcFile const &dataset) |
static void | showArrays (NcFile const &dataset) |
static void | showArraysDims (NcVar const &var) |
static std::pair< double, double > | getBoundaries (NcVar const &var) |
static MathLib::Point3d | getOrigin (NcFile const &dataset, NcVar const &var, std::vector< std::size_t > const &dim_idx_map, std::size_t const time_offset) |
static void | flipRaster (std::vector< double > &data, std::size_t const layers, std::size_t const width, std::size_t const height) |
static bool | canConvert (NcVar const &var) |
static std::string | arraySelectionLoop (NcFile const &dataset) |
static bool | dimensionSelectionLoop (NcVar const &var, std::vector< std::size_t > &dim_idx_map) |
static std::pair< std::size_t, std::size_t > | timestepSelectionLoop (NcVar const &var, std::size_t const dim_idx) |
static MeshLib::MeshElemType | elemSelectionLoop (std::size_t const dim) |
static OutputType | multFilesSelectionLoop (std::pair< std::size_t, std::size_t > const &time_bounds) |
static std::string | getIterationString (std::size_t i, std::size_t max) |
static double | getResolution (NcFile const &dataset, NcVar const &var) |
static GeoLib::RasterHeader | createRasterHeader (NcFile const &dataset, NcVar const &var, std::vector< std::size_t > const &dim_idx_map, std::vector< std::size_t > const &length, std::size_t const time_offset) |
static std::vector< std::size_t > | getLength (NcVar const &var, std::size_t const time_offset) |
static std::vector< double > | getData (NcVar const &var, std::size_t const total_length, std::size_t const time_step, std::vector< std::size_t > const &length) |
static bool | assignDimParams (NcVar const &var, std::vector< std::size_t > &dim_idx_map, TCLAP::ValueArg< std::size_t > &arg_dim_time, TCLAP::ValueArg< std::size_t > &arg_dim1, TCLAP::ValueArg< std::size_t > &arg_dim2, TCLAP::ValueArg< std::size_t > &arg_dim3) |
static std::pair< std::size_t, std::size_t > | assignTimeBounds (NcVar const &var, TCLAP::ValueArg< std::size_t > &arg_time_start, TCLAP::ValueArg< std::size_t > &arg_time_end) |
static MeshLib::MeshElemType | assignElemType (TCLAP::ValueArg< std::string > &arg_elem_type) |
static bool | convert (NcFile const &dataset, NcVar const &var, std::string const &output_name, std::vector< std::size_t > const &dim_idx_map, std::size_t const time_offset, std::pair< std::size_t, std::size_t > const &time_bounds, OutputType const output, MeshLib::MeshElemType const elem_type) |
int | main (int argc, char *argv[]) |
Variables | |
static const double | no_data_output = -9999 |
static double | no_data_input = -9999 |
|
strong |
Enumerator | |
---|---|
INVALID | |
IMAGES | |
SINGLEMESH | |
MULTIMESH |
Definition at line 42 of file NetCdfConverter.cpp.
|
static |
Definition at line 218 of file NetCdfConverter.cpp.
References arraySelectionLoop(), canConvert(), getArrays(), parseInput(), and showArrays().
Referenced by arraySelectionLoop(), and main().
|
static |
Definition at line 460 of file NetCdfConverter.cpp.
References ERR().
Referenced by main().
|
static |
Definition at line 536 of file NetCdfConverter.cpp.
References MeshLib::HEXAHEDRON, MeshLib::INVALID, MeshLib::PRISM, MeshLib::QUAD, and MeshLib::TRIANGLE.
Referenced by main().
|
static |
Definition at line 504 of file NetCdfConverter.cpp.
References ERR(), and getBoundaries().
Referenced by main().
|
static |
Definition at line 209 of file NetCdfConverter.cpp.
References ERR().
Referenced by arraySelectionLoop().
|
static |
Definition at line 50 of file NetCdfConverter.cpp.
Referenced by elemSelectionLoop(), and parseInput().
|
static |
Definition at line 551 of file NetCdfConverter.cpp.
References MeshLib::Cell, MeshToolsLib::RasterToMesh::convert(), createRasterHeader(), MeshLib::DATAVECTOR, BaseLib::dropFileExtension(), flipRaster(), getBoundaries(), getData(), getDimLength(), getDimVar(), BaseLib::getFileExtension(), getIterationString(), getLength(), MULTIMESH, GeoLib::RasterHeader::n_cols, GeoLib::RasterHeader::n_depth, GeoLib::RasterHeader::n_rows, SINGLEMESH, FileIO::AsciiRasterInterface::writeRasterAsASC(), and MeshLib::IO::VtuInterface::writeToFile().
Referenced by main().
|
static |
Definition at line 411 of file NetCdfConverter.cpp.
References getOrigin(), getResolution(), and no_data_output.
Referenced by convert().
|
static |
Definition at line 232 of file NetCdfConverter.cpp.
References parseInput(), showArraysDims(), and showErrorMessage().
Referenced by main().
|
static |
Definition at line 319 of file NetCdfConverter.cpp.
References checkExit(), MeshLib::HEXAHEDRON, MeshLib::INVALID, MeshLib::LINE, MeshLib::PRISM, MeshLib::QUAD, and MeshLib::TRIANGLE.
Referenced by main().
|
static |
Definition at line 188 of file NetCdfConverter.cpp.
Referenced by convert().
|
static |
Definition at line 118 of file NetCdfConverter.cpp.
Referenced by arraySelectionLoop().
|
static |
Definition at line 158 of file NetCdfConverter.cpp.
Referenced by assignTimeBounds(), convert(), getOrigin(), and getResolution().
|
static |
Definition at line 442 of file NetCdfConverter.cpp.
References no_data_output.
Referenced by convert().
|
static |
Definition at line 112 of file NetCdfConverter.cpp.
Referenced by convert(), getOrigin(), and getResolution().
|
static |
Definition at line 105 of file NetCdfConverter.cpp.
Referenced by convert(), getOrigin(), getResolution(), and main().
|
static |
Definition at line 388 of file NetCdfConverter.cpp.
Referenced by convert().
|
static |
Definition at line 430 of file NetCdfConverter.cpp.
Referenced by convert().
|
static |
Definition at line 171 of file NetCdfConverter.cpp.
References getBoundaries(), getDimLength(), getDimVar(), and MathLib::ORIGIN.
Referenced by createRasterHeader().
|
static |
Definition at line 395 of file NetCdfConverter.cpp.
References getBoundaries(), getDimLength(), getDimVar(), and OGS_FATAL.
Referenced by createRasterHeader().
int main | ( | int | argc, |
char * | argv[] ) |
Definition at line 649 of file NetCdfConverter.cpp.
References arraySelectionLoop(), assignDimParams(), assignElemType(), assignTimeBounds(), convert(), dimensionSelectionLoop(), elemSelectionLoop(), ERR(), getDimVar(), IMAGES, INVALID, MeshLib::INVALID, multFilesSelectionLoop(), MULTIMESH, no_data_input, GitInfoLib::GitInfo::ogs_version, SINGLEMESH, and timestepSelectionLoop().
|
static |
Definition at line 359 of file NetCdfConverter.cpp.
References IMAGES, INVALID, MULTIMESH, parseInput(), and SINGLEMESH.
Referenced by main().
|
static |
Definition at line 75 of file NetCdfConverter.cpp.
References checkExit(), and showErrorMessage().
Referenced by arraySelectionLoop(), dimensionSelectionLoop(), multFilesSelectionLoop(), and timestepSelectionLoop().
|
static |
Definition at line 130 of file NetCdfConverter.cpp.
Referenced by arraySelectionLoop().
|
static |
Definition at line 147 of file NetCdfConverter.cpp.
Referenced by dimensionSelectionLoop().
|
static |
Definition at line 56 of file NetCdfConverter.cpp.
References ERR().
Referenced by dimensionSelectionLoop(), and parseInput().
|
static |
Definition at line 299 of file NetCdfConverter.cpp.
References parseInput().
Referenced by main().
|
static |
Definition at line 40 of file NetCdfConverter.cpp.
Referenced by main().
|
static |
Definition at line 39 of file NetCdfConverter.cpp.
Referenced by createRasterHeader(), and getData().