IODA Bundle
MnemonicVariable.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 <string>
11 #include <memory>
12 
13 #include "eckit/config/LocalConfiguration.h"
14 
15 #include "Variable.h"
16 #include "IngesterTypes.h"
18 #include "Transforms/Transform.h"
19 
20 
21 namespace Ingester
22 {
23  /// \brief Exports parsed data associated with a mnemonic (ex: "CLAT")
24  class MnemonicVariable final : public Variable
25  {
26  public:
27  explicit MnemonicVariable(const std::string& mnemonicStr, const Transforms& transforms);
29 
30  /// \brief Gets the requested data, applies transforms, and returns the requested data
31  /// \param map BufrDataMap that contains the parsed data for each mnemonic
32  std::shared_ptr<DataObject> exportData(const BufrDataMap& map) final;
33 
34  private:
35  /// \brief The BUFR mnemonic of interest
36  std::string mnemonic_;
37 
38  /// \brief Collection of transforms to apply to the data during export
40 
41  /// \brief Apply the transforms
42  /// \param data Eigen Array data to apply the transform to.
43  void applyTransforms(IngesterArray& data);
44  };
45 } // namespace Ingester
Abstract base class for intermediate data object that bridges the Parsers with the IodaEncoder.
Definition: DataObject.h:21
Exports parsed data associated with a mnemonic (ex: "CLAT")
MnemonicVariable(const std::string &mnemonicStr, const Transforms &transforms)
~MnemonicVariable() final=default
std::string mnemonic_
The BUFR mnemonic of interest.
Transforms transforms_
Collection of transforms to apply to the data during export.
std::shared_ptr< DataObject > exportData(const BufrDataMap &map) final
Gets the requested data, applies transforms, and returns the requested data.
void applyTransforms(IngesterArray &data)
Apply the transforms.
Eigen::Array< FloatType, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > IngesterArray
Definition: IngesterTypes.h:19
IngesterArrayMap BufrDataMap
Definition: BufrTypes.h:21
std::vector< std::shared_ptr< Transform > > Transforms
Definition: encode.cc:30