Skip to content

Commit

Permalink
MIR- eckit::geo ProxyWeightedMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel committed Nov 19, 2024
1 parent e6308a5 commit 9d1b249
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions src/mir/method/ProxyWeightedMethod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "mir/param/MIRParametrisation.h"
#include "mir/repres/Representation.h"
#include "mir/util/Exceptions.h"
#include "mir/util/Log.h"
#include "mir/util/allocator/InPlaceAllocator.h"


Expand All @@ -30,20 +29,43 @@ namespace mir::method {
namespace {


struct StructuredBicubic final : public ProxyWeightedMethod {
explicit StructuredBicubic(const param::MIRParametrisation& param) :
ProxyWeightedMethod(param, "structured-bicubic") {}
};
#define ATLAS_METHOD(Type, Name) \
struct Type final : ProxyWeightedMethod { \
explicit Type(const param::MIRParametrisation& param) : ProxyWeightedMethod(param, Name) {} \
};

ATLAS_METHOD(StructuredBilinear, "structured-bilinear");
ATLAS_METHOD(StructuredBiquasicubic, "structured-biquasicubic");
ATLAS_METHOD(StructuredBicubic, "structured-bicubic");
ATLAS_METHOD(FiniteElement, "finite-element");
ATLAS_METHOD(ConservativeSphericalPolygon, "conservative-spherical-polygon");
ATLAS_METHOD(GridBoxAverage, "grid-box-average");
ATLAS_METHOD(GridBoxMaximum, "grid-box-maximum");

// "nearest-neighbour" (knn)
// "k-nearest-neighbours" (knn)
// "cubedsphere-bilinear"
// "regional-linear-2d" (structured)
// "spherical-vector"

} // namespace

#undef ATLAS_INTERPOL

static const MethodFactory* METHODS[]{
new MethodBuilder<StructuredBicubic>("structured-bicubic"),

const MethodFactory* MIR_METHODS[]{
new MethodBuilder<StructuredBicubic>("atlas-structured-bicubic"),
new MethodBuilder<StructuredBilinear>("atlas-structured-bilinear"),
new MethodBuilder<StructuredBiquasicubic>("atlas-structured-biquasicubic"),
new MethodBuilder<FiniteElement>("atlas-finite-element"),
new MethodBuilder<ConservativeSphericalPolygon>("atlas-conservative-spherical-polygon"),
new MethodBuilder<GridBoxAverage>("atlas-grid-box-average"),
new MethodBuilder<GridBoxMaximum>("atlas-grid-box-maximum"),
};


} // namespace


ProxyWeightedMethod::ProxyWeightedMethod(const param::MIRParametrisation& param,
const std::string& interpolation_type) :
MethodWeighted(param), type_(interpolation_type) {
Expand Down

0 comments on commit 9d1b249

Please sign in to comment.