IODA Bundle
ArrayDataObject.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2020 NOAA/NWS/NCEP/EMC
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #pragma once
9 
10 #include "DataObject.h"
11 #include "IngesterTypes.h"
12 
13 
14 namespace Ingester
15 {
16  /// \brief Container for Parser data that is expressed as a Eigen Array of doubles.
17  class ArrayDataObject : public DataObject
18  {
19  public:
20  explicit ArrayDataObject(const IngesterArray& eigArray);
21  ~ArrayDataObject() = default;
22 
23  /// \brief Makes an ioda::Variable and ads it to the given ioda::ObsGroup
24  /// \param obsGroup Obsgroup were to add the variable
25  /// \param name The name to associate with the variable (ex "latitude@MetaData")
26  /// \param dimensions List of Variables to use as the dimensions for this new variable
27  /// \param chunks List of integers specifying the chunking dimensions
28  /// \param compressionLevel The GZip compression level to use, must be 0-9
30  const std::string& name,
31  const std::vector<ioda::Variable>& dimensions,
32  const std::vector<ioda::Dimensions_t>& chunks,
33  int compressionLevel) final;
34 
35  /// \brief Print data to stdout for debug purposes.
36  void print() const final;
37 
38  /// \brief Get number of rows represented in the data
39  size_t nrows() const final;
40 
41  /// \brief Get number of columns represented in the data
42  size_t ncols() const final;
43 
44  // Getters
45  inline IngesterArray get() const { return eigArray_; }
46 
47  private:
48  /// \brief Eigen Array that holds the data
50 
51  /// \brief Create an ioda::VariableCreationParameters for the data.
52  /// \param chunks List of integers specifying the chunking dimensions
53  /// \param compressionLevel The GZip compression level to use, must be 0-9
55  const std::vector<ioda::Dimensions_t>& chunks,
56  int compressionLevel);
57  };
58 } // namespace Ingester
59 
60 
Container for Parser data that is expressed as a Eigen Array of doubles.
static ioda::VariableCreationParameters makeCreationParams(const std::vector< ioda::Dimensions_t > &chunks, int compressionLevel)
Create an ioda::VariableCreationParameters for the data.
ArrayDataObject(const IngesterArray &eigArray)
IngesterArray get() const
size_t nrows() const final
Get number of rows represented in the data.
ioda::Variable createVariable(ioda::ObsGroup &obsGroup, const std::string &name, const std::vector< ioda::Variable > &dimensions, const std::vector< ioda::Dimensions_t > &chunks, int compressionLevel) final
Makes an ioda::Variable and ads it to the given ioda::ObsGroup.
void print() const final
Print data to stdout for debug purposes.
size_t ncols() const final
Get number of columns represented in the data.
const IngesterArray eigArray_
Eigen Array that holds the data.
Abstract base class for intermediate data object that bridges the Parsers with the IodaEncoder.
Definition: DataObject.h:21
An ObsGroup is a specialization of a ioda::Group. It provides convenience functions and guarantees th...
Definition: ObsGroup.h:32
Eigen::Array< FloatType, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > IngesterArray
Definition: IngesterTypes.h:19
Used to specify Variable creation-time properties.
Definition: Has_Variables.h:57