Example demonstrating visualization of multi-level tags from climate data. More...
#include <iostream>#include <vector>#include <sstream>#include <string>#include "moab/Core.hpp"#include "MBTagConventions.hpp"#include "moab/FileOptions.hpp"
Include dependency graph for VisTags.cpp:Go to the source code of this file.
Functions | |
| int | main (int argc, char **argv) |
Example demonstrating visualization of multi-level tags from climate data.
This example shows how to:
This tool is particularly useful for climate data analysis where variables have multiple levels (e.g., atmospheric pressure levels).
tool for visualizing multi level tags
To run: VisTags inp_file outfile -O read_opts -t tags -l levels -d dim
In this example, it is shown how to create some simple tags for those tags that come from climate data, multiple levels. you can read directly nc data, or *.h5m file that will have the tag with multi levels output will be a vtk file with dense tags of form tag_name_<level> the tag name might contain a time index too, like T0 or U0 tag is a list of tags, separated by commas, no spaces levels is a list of levels, separated by commas, no spaces dimension of entities with the tags will be specified with -d (default 2)
an example of use
VisTags gcrm_r3.nc out.vtk -O VARIABLE=u -t u0,u1 -l 0,1,2 -d 2 (we knew that it had variable u in the file, that it had 256 levels, that there are 2 time steps, etc)
or VisTags gcrm_r3.nc out.vtk -t u0 -l 0,1,2 -d 2 (it will read all variables, but we need to know that u0 will be created as a tag)
the out.vtk file will contain u0_0, u0_1, as simple dense double tags
| argc | Number of command line arguments |
| argv | Command line arguments array |
Definition in file VisTags.cpp.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 64 of file VisTags.cpp.
References moab::Range::begin(), moab::Range::end(), ErrorCode, moab::Core::get_entities_by_dimension(), moab::FileOptions::get_ints_option(), moab::FileOptions::get_strs_option(), moab::index, moab::Core::load_file(), mb, MB_CHK_SET_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_DOUBLE, MESH_DIR, moab::Range::size(), moab::Core::tag_delete(), moab::Core::tag_get_data_type(), moab::Core::tag_get_handle(), moab::Core::tag_get_length(), moab::Core::tag_iterate(), and moab::Core::write_file().