diff --git a/include/layereddataz.h b/include/layereddataz.h index 3a2fa7b..f0000bd 100644 --- a/include/layereddataz.h +++ b/include/layereddataz.h @@ -180,7 +180,7 @@ class LayeredDataZ: public NCFuncs } private: - template Data ReadVarRaw(const NC& f, const MString& name, size_t i, bool nodepth, const struct Parameters* p) const; + Data ReadVarRaw(const NC& f, const MString& name, size_t i, bool nodepth, const struct Parameters* p) const; bool HaveVar(const MString& vname) const { diff --git a/src/layereddataz.cpp b/src/layereddataz.cpp index 135bf08..7ce45fa 100644 --- a/src/layereddataz.cpp +++ b/src/layereddataz.cpp @@ -233,10 +233,7 @@ bool LayeredDataZ::Read(const MString& vname, std::map(nc[id], name, tid, nodepth, p); - if(v.Type() == NcZarrTypes::VarType::INT4) data = ReadVarRaw(nc[id], name, tid, nodepth, p); - if(v.Type() == NcZarrTypes::VarType::FLOAT) data = ReadVarRaw(nc[id], name, tid, nodepth, p); - if(v.Type() == NcZarrTypes::VarType::DOUBLE) data = ReadVarRaw(nc[id], name, tid, nodepth, p); + data = ReadVarRaw(nc[id], name, tid, nodepth, p); if(data) { cache[vname] = std::move(data); @@ -247,10 +244,9 @@ bool LayeredDataZ::Read(const MString& vname, std::map LayeredDataZ::Data LayeredDataZ::ReadVarRaw(const NC& f, const MString& name, size_t i, bool nodepth, const struct LayeredDataZ::Parameters* p) const +LayeredDataZ::Data LayeredDataZ::ReadVarRaw(const NC& f, const MString& name, size_t i, bool nodepth, const struct LayeredDataZ::Parameters* p) const { real unitmul = 1.0; - //DataType fill; real offset = 0.0, scale = 1.0; if(f.HasAtt(name, "add_offset")) offset = f.AttReal(name, "add_offset"); @@ -266,7 +262,7 @@ template LayeredDataZ::Data LayeredDataZ::ReadVarRaw(const NC& f Data data((p->xb < p->xe) ? (p->xe - p->xb + 1) : (dname.nx + p->xe - p->xb + 1), p->ye - p->yb + 1, Lon(p->xb), Lat(p->yb), lonstep, latstep, std::move(unit)); - auto trans = [scale, offset, unitmul](auto raw) -> DataType { return (raw * scale + offset) * unitmul; }; + auto trans = [scale, offset, unitmul](auto raw) -> real { return (raw * scale + offset) * unitmul; }; auto rlayer = depthinv ? depths.size() - p->layer - 1 : p->layer;