-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scaling working metadata mapping missing
- Loading branch information
1 parent
425e024
commit 7b0b96a
Showing
4 changed files
with
29 additions
and
64 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,26 @@ | ||
/* | ||
* (C) Copyright 1996- ECMWF. | ||
* | ||
* This software is licensed under the terms of the Apache Licence Version 2.0 | ||
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* In applying this licence, ECMWF does not waive the privileges and immunities | ||
* granted to it by virtue of its status as an intergovernmental organisation nor | ||
* does it submit to any jurisdiction. | ||
*/ | ||
|
||
|
||
#pragma once | ||
|
||
#include "multio/action/ChainedAction.h" | ||
#include "multio/config/ComponentConfiguration.h" // Ensure this include is present | ||
|
||
namespace multio::action { | ||
|
||
namespace multio::action::scale { | ||
|
||
|
||
/** | ||
* \class MultIO Action to scale fields | ||
*/ | ||
class Scale final : public ChainedAction { | ||
public: | ||
using ChainedAction::ChainedAction; | ||
explicit Scale(const ComponentConfiguration& compConf); // Constructor declaration | ||
void executeImpl(message::Message) override; | ||
|
||
private: | ||
template <typename T> | ||
message::Message ScaleMessage(message::Message&&) const; | ||
// Template function to scale messages based on the Precision type | ||
template <typename T> | ||
message::Message ScaleMessage(message::Message&& msg) const; | ||
|
||
// Methods to scale data with and without missing values | ||
template <typename T> | ||
void scaleWithMissing(T* data, std::size_t size, double scalingFactor); | ||
const double scalingFactor_; | ||
|
||
template <typename Precision> | ||
message::Message ScaleMessage(message::Message&& msg) const; | ||
|
||
template <typename T> | ||
void scaleWithoutMissing(T* data, std::size_t size, double scalingFactor); | ||
template <typename Precision> | ||
void scaling(Precision* data, std::size_t size, double scalingFactor) const; | ||
|
||
void print(std::ostream&) const override; | ||
void executeImpl(message::Message) override; | ||
}; | ||
|
||
|
||
} // namespace multio::action::scale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters