Skip to content

Commit

Permalink
Return masks on gribjump interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisspyB committed Oct 9, 2023
1 parent 3238661 commit a8308e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/metkit/gribjump/GribJump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ GribJump::GribJump() {}

GribJump::~GribJump() {}

std::vector<std::vector<double>> GribJump::directJump(eckit::DataHandle* handle,
PolyOutput GribJump::directJump(eckit::DataHandle* handle,
std::vector<std::tuple<size_t, size_t>> ranges,
JumpInfo info) const {
JumpHandle dataSource(handle);
info.setStartOffset(0); // Message starts at the beginning of the handle
ASSERT(info.ready());
auto [values, mask] = info.extractRanges(dataSource, ranges);
// todo return mask
return values;
return info.extractRanges(dataSource, ranges);
}

JumpInfo GribJump::extractInfo(eckit::DataHandle* handle) const {
Expand Down
9 changes: 3 additions & 6 deletions src/metkit/gribjump/GribJump.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,21 @@
namespace metkit {
namespace gribjump {

using PolyOutput = std::tuple<std::vector<std::vector<double>>, std::vector<std::vector<std::bitset<64>>>>;

// Gribjump API
class GribJump : public eckit::NonCopyable {

public:

GribJump();
~GribJump();

std::vector<std::vector<double>> directJump(eckit::DataHandle* handle,
std::vector<std::tuple<size_t, size_t>> allRanges,
JumpInfo info) const;
PolyOutput directJump(eckit::DataHandle* handle, std::vector<std::tuple<size_t, size_t>> allRanges, JumpInfo info) const;

JumpInfo extractInfo(eckit::DataHandle* handle) const;

bool isCached(std::string) const {return false;} // todo implement caching

private:

// std::map<Key, std::tuple<FieldLocation*, JumpInfo> > cache_; // not imp
};

Expand Down

0 comments on commit a8308e8

Please sign in to comment.