|
TECA
The Toolkit for Extreme Climate Analysis
|
An algorithm that generates a teca_cartesian_mesh of the requested spatial and temporal dimensions with optional user defined fields. More...
#include <teca_cartesian_mesh_source.h>
Public Member Functions | |
| std::shared_ptr< teca_cartesian_mesh_source > | shared_from_this () |
| std::shared_ptr< teca_cartesian_mesh_source const > | shared_from_this () const |
| teca_cartesian_mesh_source (const teca_cartesian_mesh_source &src)=delete | |
| teca_cartesian_mesh_source (teca_cartesian_mesh_source &&src)=delete | |
| teca_cartesian_mesh_source & | operator= (const teca_cartesian_mesh_source &src)=delete |
| teca_cartesian_mesh_source & | operator= (teca_cartesian_mesh_source &&src)=delete |
| const char * | get_class_name () const override |
| void | set_periodic_in_x (int periodic) |
| void | set_periodic_in_y (int periodic) |
| void | set_periodic_in_z (int periodic) |
coordinate_type_code | |
set/get the type code for generated coordinates. The default is a 64 bit floating point type. Use teca_variant_array_code<NT>::get() to get specific type codes for C++ POD types NT. | |
| void | set_coordinate_type_code (const unsigned int &v) |
| const unsigned int & | get_coordinate_type_code () const |
field_type_code | |
set/get the type code for generated fields. The default is a 64 bit floating point type. Use teca_variant_array_code<NT>::get() to get specific type codes for C++ POD types NT. | |
| void | set_field_type_code (const unsigned int &v) |
| const unsigned int & | get_field_type_code () const |
whole_extent | |
set/get the global index space extent of the data. the extents are given by 8 values, 6 spatial plus 2 temporal, in the following order [i0 i1 j0 j1 k0 k1 q0 q1] This should be the same on all ranks | |
| size_t | get_number_of_whole_extents () |
| void | append_whole_extent (const unsigned long &v) |
| void | set_whole_extent (const unsigned long &v) |
| void | set_whole_extent (size_t i, const unsigned long &v) |
| void | set_whole_extents (const std::vector< unsigned long > &v) |
| void | set_whole_extents (const std::initializer_list< unsigned long > &&l) |
| const unsigned long & | get_whole_extent (size_t i) const |
| const std::vector< unsigned long > & | get_whole_extents () const |
| void | clear_whole_extents () |
| int | set_spatial_extents (const teca_metadata &md, bool three_d=true) |
bounds | |
set/get the global bounds of the data. the bounds are 8 values 6 spatial plus 2 temporal in the following order. [x0 x1 y0 y1 z0 z1 t0 t1] this should be the same on all ranks. | |
| size_t | get_number_of_bounds () |
| void | append_bound (const double &v) |
| void | set_bound (const double &v) |
| void | set_bound (size_t i, const double &v) |
| void | set_bounds (const std::vector< double > &v) |
| void | set_bounds (const std::initializer_list< double > &&l) |
| const double & | get_bound (size_t i) const |
| const std::vector< double > & | get_bounds () const |
| void | clear_bounds () |
| int | set_spatial_bounds (const teca_metadata &md, bool three_d=true) |
x_axis_variable | |
set the name of the variable to use for the coordinate axes and optionally associated attributes. | |
| void | set_x_axis_variable (const std::string &name) |
| void | set_x_axis_variable (const std::string &name, const teca_metadata &atts) |
| int | set_x_axis_variable (const teca_metadata &md) |
y_axis_variable | |
set the name of the variable to use for the coordinate axes and optionally associated attributes. | |
| void | set_y_axis_variable (const std::string &name) |
| void | set_y_axis_variable (const std::string &name, const teca_metadata &atts) |
| int | set_y_axis_variable (const teca_metadata &md) |
z_axis_variable | |
set the name of the variable to use for the coordinate axes and optionally associated attributes. | |
| void | set_z_axis_variable (const std::string &name) |
| void | set_z_axis_variable (const std::string &name, const teca_metadata &atts) |
| int | set_z_axis_variable (const teca_metadata &md) |
t_axis_variable | |
set the name of the variable to use for the coordinate axes and optionally associated attributes. | |
| void | set_t_axis_variable (const std::string &name) |
| void | set_calendar (const std::string &calendar, const std::string &units) |
| void | set_t_axis_variable (const std::string &name, const teca_metadata &atts) |
| int | set_t_axis_variable (const teca_metadata &md) |
| int | set_t_axis (const teca_metadata &md) |
| void | set_t_axis (const p_teca_variant_array &t) |
output_metadata | |
Set the output metadata directly. The provided metadata must contain "coordinates" as defined by the teca_cf_reader because these are required for mesh generation. Pipeline execution control keys as defined by teca_index_executive are also required. Calendaring metadata is recommended. A copy of the passed object is made but "variables" are replaced with those generated by this class, if any. As a result be sure to specifiy field generators before calling this method. Returns 0 if successful, and non-zero if the supplied metadata doesn't contain the expected information. No error messages are sent to the terminal. | |
| int | set_output_metadata (const teca_metadata &md) |
append_field_generator | |
set a callback function f(x,y,z,t) that generates a field named name x,y,z are coordinate axes in variant arrays, t is the double precision time value. | |
| void | append_field_generator (const std::string &name, const teca_metadata &atts, field_generator_callback &callback) |
field_generator | |
Set/get the named callbacks that generate fields on the mesh. These should be packaged in the field_generator struct so that field name and attributes for I/O are provided together with the callback. | |
| size_t | get_number_of_field_generators () |
| void | append_field_generator (const field_generator_t &v) |
| void | set_field_generator (const field_generator_t &v) |
| void | set_field_generator (size_t i, const field_generator_t &v) |
| void | set_field_generators (const std::vector< field_generator_t > &v) |
| void | set_field_generators (const std::initializer_list< field_generator_t > &&l) |
| const field_generator_t & | get_field_generator (size_t i) const |
| const std::vector< field_generator_t > & | get_field_generators () const |
| void | clear_field_generators () |
Public Member Functions inherited from teca_algorithm | |
| teca_algorithm (const teca_algorithm &src)=delete | |
| teca_algorithm (teca_algorithm &&src)=delete | |
| teca_algorithm & | operator= (const teca_algorithm &src)=delete |
| teca_algorithm & | operator= (teca_algorithm &&src)=delete |
| void | set_communicator (MPI_Comm comm) |
| MPI_Comm | get_communicator () |
| get the active communicator More... | |
| virtual teca_algorithm_output_port | get_output_port (unsigned int port=0) |
| void | set_input_connection (const teca_algorithm_output_port &port) |
| set an input to this algorithm More... | |
| virtual void | set_input_connection (unsigned int id, const teca_algorithm_output_port &port) |
| set an input to this algorithm More... | |
| virtual void | remove_input_connection (unsigned int id) |
| remove input connections More... | |
| void | clear_input_connections () |
| remove all input connections More... | |
| const_p_teca_dataset | get_output_data (unsigned int port=0) |
| void | pop_cache (unsigned int port=0, int top=0) |
| void | set_cache_size (unsigned int n) |
| set the cache size. the default is 1. (threadsafe) More... | |
| virtual int | update () |
| execute the pipeline from this instance up. More... | |
| virtual int | update (unsigned int port) |
| execute the pipeline from this instance up. More... | |
| virtual teca_metadata | update_metadata (unsigned int port=0) |
| get meta data considering this instance up. More... | |
| void | set_executive (p_teca_algorithm_executive exe) |
| set the executive More... | |
| p_teca_algorithm_executive | get_executive () |
| get the executive More... | |
| virtual void | to_stream (std::ostream &s) const |
| virtual void | from_stream (std::istream &s) |
| deserialize from the stream. More... | |
| void | set_verbose (const int &v) |
| const int & | get_verbose () const |
Static Public Member Functions | |
| static p_teca_cartesian_mesh_source | New () |
Additional Inherited Members | |
Protected Member Functions inherited from teca_algorithm | |
| void | set_number_of_input_connections (unsigned int n) |
| void | set_number_of_output_ports (unsigned int n) |
| void | set_modified (unsigned int port) |
| an overload to set_modified by port More... | |
| virtual std::vector< teca_metadata > | get_upstream_request (unsigned int port, const std::vector< teca_metadata > &input_md, const teca_metadata &request) |
| virtual teca_metadata | get_cache_key (unsigned int port, const teca_metadata &request) const |
| virtual teca_metadata | get_output_metadata (teca_algorithm_output_port ¤t) |
| virtual const_p_teca_dataset | request_data (teca_algorithm_output_port &port, const teca_metadata &request) |
| virtual int | validate_cache (teca_algorithm_output_port ¤t) |
| virtual void | clear_modified (teca_algorithm_output_port current) |
| const_p_teca_dataset | get_output_data (unsigned int port, const teca_metadata &request) |
| int | cache_output_data (unsigned int port, const teca_metadata &request, const_p_teca_dataset &data) |
| void | clear_cache (unsigned int port) |
| clear the cache on the given output port More... | |
| unsigned int | get_number_of_input_connections () |
| get the number of input connections More... | |
| teca_algorithm_output_port & | get_input_connection (unsigned int i) |
| void | clear_modified (unsigned int port) |
| clear the modified flag on the i'th output More... | |
| int | get_modified (unsigned int port) const |
| return the output port's modified flag value More... | |
Protected Attributes inherited from teca_algorithm | |
| int | verbose |
An algorithm that generates a teca_cartesian_mesh of the requested spatial and temporal dimensions with optional user defined fields.
User defined fields are specified by passing callbacks and metadata via field_generator and append_field_generator
The spatial and temporal dimensions are set by the combination of whole_extent and bounds.
The names of coordinate axes are set by the combination of x_axis_variable, y_axis_variable, z_axis_variable, and t_axis_variable
The units of the coordinate axes are set by the combination of x_axis_units, y_axis_units, z_axis_units, calendar, and time_units.
|
inline |
append to the bound algorithm vector property
|
inline |
append to the field_generator algorithm vector property
|
inline |
append to the whole_extent algorithm vector property
|
inline |
clear the bound algorithm vector property
|
inline |
clear the field_generator algorithm vector property
|
inline |
clear the whole_extent algorithm vector property
|
inline |
get the i-th element of the bound algorithm vector property
|
inline |
get the bound algorithm vector property
|
inlineoverridevirtual |
returns the name of the class
Implements teca_algorithm.
|
inline |
Get the value of the coordinate_type_code algorithm property
|
inline |
get the i-th element of the field_generator algorithm vector property
|
inline |
get the field_generator algorithm vector property
|
inline |
Get the value of the field_type_code algorithm property
|
inline |
get the size of the bound algorithm vector property
|
inline |
get the size of the field_generator algorithm vector property
|
inline |
get the size of the whole_extent algorithm vector property
|
inline |
get the i-th element of the whole_extent algorithm vector property
|
inline |
get the whole_extent algorithm vector property
|
inlinestatic |
Returns an instance of teca_cartesian_mesh_source
|
inline |
set the bound algorithm vector property to a single value
|
inline |
set the i-th element of the bound algorithm vector property
|
inline |
set the bound algorithm vector property
|
inline |
set the bound algorithm vector property
| void teca_cartesian_mesh_source::set_calendar | ( | const std::string & | calendar, |
| const std::string & | units | ||
| ) |
Set the calendar, and time units of the t_axis_variable
|
inline |
Set the value of the coordinate_type_code algorithm property
|
inline |
set the field_generator algorithm vector property to a single value
|
inline |
set the i-th element of the field_generator algorithm vector property
|
inline |
set the field_generator algorithm vector property
|
inline |
set the field_generator algorithm vector property
|
inline |
Set the value of the field_type_code algorithm property
| void teca_cartesian_mesh_source::set_periodic_in_x | ( | int | periodic | ) |
Set flag whether mesh is periodic in x.
| void teca_cartesian_mesh_source::set_periodic_in_y | ( | int | periodic | ) |
Set flag whether mesh is periodic in y.
| void teca_cartesian_mesh_source::set_periodic_in_z | ( | int | periodic | ) |
Set flag whether mesh is periodic in z.
| int teca_cartesian_mesh_source::set_spatial_bounds | ( | const teca_metadata & | md, |
| bool | three_d = true |
||
| ) |
Set the spatial bounds from a metadata object following the conventions defined by the teca_cf_reader. Returns zero if successful and non-zero if the supplied metadata is missing any of the requisite information.
| int teca_cartesian_mesh_source::set_spatial_extents | ( | const teca_metadata & | md, |
| bool | three_d = true |
||
| ) |
Set the spatial extents from a metadata object following the conventions defined by the teca_cf_reader. If three_d is true the extents in the z-direction are copied, otherwise they are set to 0. Returns zero if successful and non-zero if the supplied metadata is missing any of the requisite information.
| void teca_cartesian_mesh_source::set_t_axis | ( | const p_teca_variant_array & | t | ) |
Set the time axis directly. When a time axis is provided values are served up from the array rather than being generated. Execution control keys are also made use of if present.
| int teca_cartesian_mesh_source::set_t_axis | ( | const teca_metadata & | md | ) |
Set the time axis using coordinate conventions defined by the teca_cf_reader. When a time axis is provided values are served up from the array rather than being generated. Execution control keys are also made use of if present. Returns zero if successful and non-zero if the supplied metadata is missing any of the requisite information.
| void teca_cartesian_mesh_source::set_t_axis_variable | ( | const std::string & | name | ) |
set the name of the t_axis_variable
| void teca_cartesian_mesh_source::set_t_axis_variable | ( | const std::string & | name, |
| const teca_metadata & | atts | ||
| ) |
Set the name of the variable and its attributes. See teca_array_attributes for more information.
| int teca_cartesian_mesh_source::set_t_axis_variable | ( | const teca_metadata & | md | ) |
Set the name of the variable and its attributes using conventions defined by the teca_cf_reader. Returns zero if successful and non-zero if the supplied metadata is missing any of the requisite information.
|
inline |
set the whole_extent algorithm vector property to a single value
|
inline |
set the i-th element of the whole_extent algorithm vector property
|
inline |
set the whole_extent algorithm vector property
|
inline |
set the whole_extent algorithm vector property
| void teca_cartesian_mesh_source::set_x_axis_variable | ( | const std::string & | name | ) |
set the name of the t_axis_variable
| void teca_cartesian_mesh_source::set_x_axis_variable | ( | const std::string & | name, |
| const teca_metadata & | atts | ||
| ) |
Set the name of the variable and its attributes. See teca_array_attributes for more information.
| int teca_cartesian_mesh_source::set_x_axis_variable | ( | const teca_metadata & | md | ) |
Set the name of the variable and its attributes using conventions defined by the teca_cf_reader. Returns zero if successful and non-zero if the supplied metadata is missing any of the requisite information.
| void teca_cartesian_mesh_source::set_y_axis_variable | ( | const std::string & | name | ) |
set the name of the y_axis_variable
| void teca_cartesian_mesh_source::set_y_axis_variable | ( | const std::string & | name, |
| const teca_metadata & | atts | ||
| ) |
Set the name of the variable and its attributes. See teca_array_attributes for more information.
| int teca_cartesian_mesh_source::set_y_axis_variable | ( | const teca_metadata & | md | ) |
Set the name of the variable and its attributes using conventions defined by the teca_cf_reader. Returns zero if successful and non-zero if the supplied metadata is missing any of the requisite information.
| void teca_cartesian_mesh_source::set_z_axis_variable | ( | const std::string & | name | ) |
set the name of the z_axis_variable
| void teca_cartesian_mesh_source::set_z_axis_variable | ( | const std::string & | name, |
| const teca_metadata & | atts | ||
| ) |
Set the name of the variable and its attributes. See teca_array_attributes for more information.
| int teca_cartesian_mesh_source::set_z_axis_variable | ( | const teca_metadata & | md | ) |
Set the name of the variable and its attributes using conventions defined by the teca_cf_reader. Returns zero if successful and non-zero if the supplied metadata is missing any of the requisite information.
|
inline |
Enables the static constructor
|
inline |
Enables the static constructor