You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

49 lines
1.0 KiB

#include "DataAdapters/gridfile.h"
#include "mdatetime.h"
#include "simple2ddata.h"
using michlib::MDateTime;
class GRIDVELData
{
michlib::GridFile u,v;
MString unit;
real fill;
using IType=decltype(u.Nx());
public:
static constexpr const char* name = "GRIDVEL";
static constexpr const char* disabledactions = "genintfile";
using Data = Simple2DData;
GRIDVELData() = default;
MString Info() const;
// TODO: RetVal
MString Open(const CLArgs& args);
bool isOk() const { return u.Opened() &&v.Opened(); }
size_t NTimes() const { return 1; }
MDateTime Time(size_t i) const
{
return MDateTime();
}
//time_t Timestep() const { return isOk() ? (times[1] - times[0]) : 0; }
explicit operator bool() const { return u.Opened() &&v.Opened(); }
VarPresence CheckVar(const MString& vname) const
{
if(vname == "u" || vname == "v") return VarPresence::INTERNAL;
if(vname == "U" || vname == "U2") return VarPresence::DERIVED;
return VarPresence::NONE;
}
bool Read(const MString& vname, std::map<MString, Data>& cache, size_t i) const;
};