|
|
@ -70,6 +70,8 @@ class UVMethods |
|
|
|
std::vector<real> x, y; |
|
|
|
std::vector<real> x, y; |
|
|
|
std::vector<michlib::uint1> t; |
|
|
|
std::vector<michlib::uint1> t; |
|
|
|
bool lonlat; |
|
|
|
bool lonlat; |
|
|
|
|
|
|
|
NCFileWBase nc; |
|
|
|
|
|
|
|
bool tdep; |
|
|
|
|
|
|
|
|
|
|
|
size_t N() const { return t.size(); } |
|
|
|
size_t N() const { return t.size(); } |
|
|
|
|
|
|
|
|
|
|
@ -86,9 +88,19 @@ class UVMethods |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Reset() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
x.clear(); |
|
|
|
|
|
|
|
y.clear(); |
|
|
|
|
|
|
|
t.clear(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WriteBinBile(const MString& name, const michlib_internal::ParameterListEx& pars) const; |
|
|
|
void WriteBinBile(const MString& name, const michlib_internal::ParameterListEx& pars) const; |
|
|
|
|
|
|
|
|
|
|
|
MString WriteNcFile(const MString& name, const michlib_internal::ParameterListEx& pars, const MString& history, int comp) const; |
|
|
|
MString CreateNcFile(const MString& name, const michlib_internal::ParameterListEx& pars, const MString& history, int comp, const TimeData& tdata, bool timedep); |
|
|
|
|
|
|
|
MString WriteNcFile(size_t it); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CloseNcFile() { nc.Close(); } |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -112,6 +124,11 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
auto [tindexes, err] = GetTIndexes(ds, args, pars); |
|
|
|
auto [tindexes, err] = GetTIndexes(ds, args, pars); |
|
|
|
if(err.Exist()) return err; |
|
|
|
if(err.Exist()) return err; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool average = args.contains("average"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int compress = 3; |
|
|
|
|
|
|
|
if(args.contains("compress")) compress = args.at("compress").ToInt(); |
|
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<const BaseParameters> sourcepars; |
|
|
|
std::unique_ptr<const BaseParameters> sourcepars; |
|
|
|
if constexpr(ParametersSupported<D>) |
|
|
|
if constexpr(ParametersSupported<D>) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -130,15 +147,40 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
} |
|
|
|
} |
|
|
|
auto p = sourcepars.get(); |
|
|
|
auto p = sourcepars.get(); |
|
|
|
|
|
|
|
|
|
|
|
auto data = ReadUV(ds, p, tindexes, mode); |
|
|
|
TimeData tdata(ds, tindexes); |
|
|
|
if(!data) return "Can't read data"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Main file
|
|
|
|
|
|
|
|
MString name = args.contains("out") ? args.at("out") : ""; |
|
|
|
MString name = args.contains("out") ? args.at("out") : ""; |
|
|
|
MString outfmt = args.contains("outformat") ? args.at("outformat") : (GetExt(name) == "nc" ? "nc" : "bin"); |
|
|
|
MString outfmt = args.contains("outformat") ? args.at("outformat") : (GetExt(name) == "nc" ? "nc" : "bin"); |
|
|
|
|
|
|
|
MString namevel = args.contains("velout") ? args.at("velout") : ""; |
|
|
|
|
|
|
|
MString outfmtvel = args.contains("veloutformat") ? args.at("veloutformat") : (GetExt(name) == "nc" ? "nc" : "bin"); |
|
|
|
|
|
|
|
MString namestp = args.contains("stpout") ? args.at("stpout") : ""; |
|
|
|
|
|
|
|
MString outfmtstp = args.contains("stpoutformat") ? args.at("stpoutformat") : (GetExt(name) == "nc" ? "nc" : "bin"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_t shiftx = args.contains("shiftx") ? args.at("shiftx").ToInteger<size_t>() : 0; |
|
|
|
|
|
|
|
size_t shifty = args.contains("shifty") ? args.at("shifty").ToInteger<size_t>() : 0; |
|
|
|
|
|
|
|
size_t skipx = args.contains("skipx") ? args.at("skipx").ToInteger<size_t>() : 1; |
|
|
|
|
|
|
|
size_t skipy = args.contains("skipy") ? args.at("skipy").ToInteger<size_t>() : 1; |
|
|
|
|
|
|
|
|
|
|
|
MString u = data.Unit().Exist() ? data.Unit() : "unknown", d = data.DUnit().Exist() ? data.DUnit() : "unknown"; |
|
|
|
if(!average && tindexes.size() > 1 && ((name.Exist() && outfmt == "bin") || (namevel.Exist() && outfmtvel == "bin") || (namestp.Exist() && outfmtstp == "bin"))) |
|
|
|
|
|
|
|
return "Multiple time moments does'nt supported by the bin format"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool headwrited = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MString velunit, distunit; |
|
|
|
|
|
|
|
NCFileW fw, fwfilt; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StPoints stp(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(size_t it = 0; it < tindexes.size(); it++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
auto data = average ? ReadUV(ds, p, tindexes, mode) : ReadUV(ds, p, tindexes[it], mode); |
|
|
|
|
|
|
|
if(!headwrited) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
velunit = data.Unit().Exist() ? data.Unit() : "unknown"; |
|
|
|
|
|
|
|
distunit = data.DUnit().Exist() ? data.DUnit() : "unknown"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Main file
|
|
|
|
if(name.Exist()) |
|
|
|
if(name.Exist()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(outfmt == "bin") |
|
|
|
if(outfmt == "bin") |
|
|
@ -147,13 +189,13 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
fw.Create(name, 9); |
|
|
|
fw.Create(name, 9); |
|
|
|
fw.SetColumnName(1, "Longitude"); |
|
|
|
fw.SetColumnName(1, "Longitude"); |
|
|
|
fw.SetColumnName(2, "Latitude"); |
|
|
|
fw.SetColumnName(2, "Latitude"); |
|
|
|
fw.SetColumnName(3, "u, " + u); |
|
|
|
fw.SetColumnName(3, "u, " + velunit); |
|
|
|
fw.SetColumnName(4, "v, " + u); |
|
|
|
fw.SetColumnName(4, "v, " + velunit); |
|
|
|
fw.SetColumnName(5, "Div, (" + u + ")/" + d); |
|
|
|
fw.SetColumnName(5, "Div, (" + velunit + ")/" + distunit); |
|
|
|
fw.SetColumnName(6, "Rot, (" + u + ")/" + d); |
|
|
|
fw.SetColumnName(6, "Rot, (" + velunit + ")/" + distunit); |
|
|
|
fw.SetColumnName(7, "Okubo-Weiss parameter, (" + u + ")2/" + d + "2"); |
|
|
|
fw.SetColumnName(7, "Okubo-Weiss parameter, (" + velunit + ")2/" + distunit + "2"); |
|
|
|
fw.SetColumnName(8, "Kinetic energy, (" + u + ")2"); |
|
|
|
fw.SetColumnName(8, "Kinetic energy, (" + velunit + ")2"); |
|
|
|
fw.SetColumnName(9, "Eddy kinetic energy, (" + u + ")2"); |
|
|
|
fw.SetColumnName(9, "Eddy kinetic energy, (" + velunit + ")2"); |
|
|
|
fw.SetParameters(pars); |
|
|
|
fw.SetParameters(pars); |
|
|
|
|
|
|
|
|
|
|
|
for(size_t i = 0; i < data.N(); i++) |
|
|
|
for(size_t i = 0; i < data.N(); i++) |
|
|
@ -173,59 +215,59 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
} |
|
|
|
} |
|
|
|
else if(outfmt == "nc" || outfmt == "netcdf") |
|
|
|
else if(outfmt == "nc" || outfmt == "netcdf") |
|
|
|
{ |
|
|
|
{ |
|
|
|
int compress = 3; |
|
|
|
|
|
|
|
NCFileW fw; |
|
|
|
|
|
|
|
MString err; |
|
|
|
MString err; |
|
|
|
|
|
|
|
|
|
|
|
if(args.contains("compress")) compress = args.at("compress").ToInt(); |
|
|
|
if(!err.Exist() && !headwrited) err = fw.Create(data, name, compress); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddTimeData(tdata, !average); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddAtts(pars); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("u", "", "Eastward velocity", velunit, ""); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("v", "", "Northward velocity", velunit, ""); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("div", "", "Velocity divergence", "(" + velunit + ")/" + distunit, ""); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("rot", "", "Velocity rotor", "(" + velunit + ")/" + distunit, ""); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("ow", "", "Okubo-Weiss parameter", "(" + velunit + ")2/" + distunit + "2", ""); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("ke", "", "Squared velocity module, u^2+v^2", "(" + velunit + ")2", ""); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("eke", "", "Squared velocity dispersion aka eddy kinetic energy, <u^2+v^2>-<u>^2-<v>^2", "(" + velunit + ")2", ""); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.WriteGrid(data); |
|
|
|
|
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.Create(data, name, compress); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.AddAtts(pars); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.AddVariable("u", "", "Eastward velocity", u, ""); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.AddVariable("v", "", "Northward velocity", u, ""); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.AddVariable("div", "", "Velocity divergence", "(" + u + ")/" + d, ""); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.AddVariable("rot", "", "Velocity rotor", "(" + u + ")/" + d, ""); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.AddVariable("ow", "", "Okubo-Weiss parameter", "(" + u + ")2/" + d + "2", ""); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.AddVariable("ke", "", "Squared velocity module, u^2+v^2", "(" + u + ")2", ""); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.AddVariable("eke", "", "Squared velocity dispersion aka eddy kinetic energy, <u^2+v^2>-<u>^2-<v>^2", "(" + u + ")2", ""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.WriteGrid(data); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "u", [&data = std::as_const(data)](size_t i, size_t j) { return data.U(i, j); }); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "v", [&data = std::as_const(data)](size_t i, size_t j) { return data.V(i, j); }); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "div", [&data = std::as_const(data)](size_t i, size_t j) { return data.Div(i, j); }); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "rot", [&data = std::as_const(data)](size_t i, size_t j) { return data.Rot(i, j); }); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "ow", [&data = std::as_const(data)](size_t i, size_t j) { return data.OW(i, j); }); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.WriteVariable(data, "ke", [&data = std::as_const(data)](size_t i, size_t j) { return data.U2(i, j); }); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
if(!err.Exist()) |
|
|
|
err = fw.WriteVariable(data, "eke", [&data = std::as_const(data)](size_t i, size_t j) { return data.U2(i, j) - (data.U(i, j) * data.U(i, j) + data.V(i, j) * data.V(i, j)); }); |
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "u", [&data = std::as_const(data)](size_t i, size_t j) { return data.U(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "v", [&data = std::as_const(data)](size_t i, size_t j) { return data.V(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "div", [&data = std::as_const(data)](size_t i, size_t j) { return data.Div(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "rot", [&data = std::as_const(data)](size_t i, size_t j) { return data.Rot(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "ow", [&data = std::as_const(data)](size_t i, size_t j) { return data.OW(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "ke", [&data = std::as_const(data)](size_t i, size_t j) { return data.U2(i, j); }, it); |
|
|
|
|
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fw.WriteVariable( |
|
|
|
|
|
|
|
data, "eke", [&data = std::as_const(data)](size_t i, size_t j) { return data.U2(i, j) - (data.U(i, j) * data.U(i, j) + data.V(i, j) * data.V(i, j)); }, it); |
|
|
|
if(err.Exist()) return err; |
|
|
|
if(err.Exist()) return err; |
|
|
|
|
|
|
|
|
|
|
|
fw.Close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
return "Unknown format: " + outfmt; |
|
|
|
return "Unknown format: " + outfmt; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Filtered vectors file
|
|
|
|
// Filtered file
|
|
|
|
name = args.contains("velout") ? args.at("velout") : ""; |
|
|
|
if(namevel.Exist()) |
|
|
|
outfmt = args.contains("veloutformat") ? args.at("veloutformat") : (GetExt(name) == "nc" ? "nc" : "bin"); |
|
|
|
|
|
|
|
if(name.Exist()) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
size_t shiftx = args.contains("shiftx") ? args.at("shiftx").ToInteger<size_t>() : 0; |
|
|
|
|
|
|
|
size_t shifty = args.contains("shifty") ? args.at("shifty").ToInteger<size_t>() : 0; |
|
|
|
|
|
|
|
size_t skipx = args.contains("skipx") ? args.at("skipx").ToInteger<size_t>() : 1; |
|
|
|
|
|
|
|
size_t skipy = args.contains("skipy") ? args.at("skipy").ToInteger<size_t>() : 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sparser<decltype(data)> sdata(data, shiftx, shifty, skipx, skipy); |
|
|
|
Sparser<decltype(data)> sdata(data, shiftx, shifty, skipx, skipy); |
|
|
|
if(outfmt == "bin") |
|
|
|
if(outfmtvel == "bin") |
|
|
|
{ |
|
|
|
{ |
|
|
|
BFileW vel; |
|
|
|
BFileW vel; |
|
|
|
vel.Create(name, 4); |
|
|
|
vel.Create(name, 4); |
|
|
|
vel.SetColumnName(1, "Longitude"); |
|
|
|
vel.SetColumnName(1, "Longitude"); |
|
|
|
vel.SetColumnName(2, "Latitude"); |
|
|
|
vel.SetColumnName(2, "Latitude"); |
|
|
|
vel.SetColumnName(3, "u, " + u); |
|
|
|
vel.SetColumnName(3, "u, " + velunit); |
|
|
|
vel.SetColumnName(4, "v, " + u); |
|
|
|
vel.SetColumnName(4, "v, " + velunit); |
|
|
|
vel.SetParameters(pars); |
|
|
|
vel.SetParameters(pars); |
|
|
|
|
|
|
|
|
|
|
|
for(size_t ix = 0; ix < sdata.Nx(); ix++) |
|
|
|
for(size_t ix = 0; ix < sdata.Nx(); ix++) |
|
|
@ -239,51 +281,54 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
vel.Finalize(); |
|
|
|
vel.Finalize(); |
|
|
|
vel.Close(); |
|
|
|
vel.Close(); |
|
|
|
} |
|
|
|
} |
|
|
|
else if(outfmt == "nc" || outfmt == "netcdf") |
|
|
|
else if(outfmtvel == "nc" || outfmtvel == "netcdf") |
|
|
|
{ |
|
|
|
{ |
|
|
|
int compress = 3; |
|
|
|
|
|
|
|
NCFileW fw; |
|
|
|
|
|
|
|
MString err; |
|
|
|
MString err; |
|
|
|
|
|
|
|
|
|
|
|
if(args.contains("compress")) compress = args.at("compress").ToInt(); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.Create(sdata, name, compress); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.AddTimeData(tdata, !average); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.AddAtts(pars); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.AddVariable("u", "", "Eastward velocity", velunit, ""); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.AddVariable("v", "", "Northward velocity", velunit, ""); |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.WriteGrid(sdata); |
|
|
|
|
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.Create(sdata, name, compress); |
|
|
|
if(!err.Exist()) |
|
|
|
if(!err.Exist()) err = fw.AddAtts(pars); |
|
|
|
err = fwfilt.WriteVariable( |
|
|
|
if(!err.Exist()) err = fw.AddVariable("u", "", "Eastward velocity", u, ""); |
|
|
|
sdata, "u", [&data = std::as_const(sdata)](size_t i, size_t j) { return data.U(i, j); }, it); |
|
|
|
if(!err.Exist()) err = fw.AddVariable("v", "", "Northward velocity", u, ""); |
|
|
|
if(!err.Exist()) |
|
|
|
|
|
|
|
err = fwfilt.WriteVariable( |
|
|
|
if(!err.Exist()) err = fw.WriteGrid(sdata); |
|
|
|
sdata, "v", [&data = std::as_const(sdata)](size_t i, size_t j) { return data.V(i, j); }, it); |
|
|
|
|
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.WriteVariable(sdata, "u", [&data = std::as_const(sdata)](size_t i, size_t j) { return data.U(i, j); }); |
|
|
|
|
|
|
|
if(!err.Exist()) err = fw.WriteVariable(sdata, "v", [&data = std::as_const(sdata)](size_t i, size_t j) { return data.V(i, j); }); |
|
|
|
|
|
|
|
if(err.Exist()) return err; |
|
|
|
if(err.Exist()) return err; |
|
|
|
|
|
|
|
|
|
|
|
fw.Close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
return "Unknown format: " + outfmt; |
|
|
|
return "Unknown format: " + outfmtvel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Stationary points
|
|
|
|
// Stationary points
|
|
|
|
name = args.contains("stpout") ? args.at("stpout") : ""; |
|
|
|
if(namestp.Exist()) |
|
|
|
outfmt = args.contains("stpoutformat") ? args.at("stpoutformat") : (GetExt(name) == "nc" ? "nc" : "bin"); |
|
|
|
|
|
|
|
if(name.Exist()) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
StPoints p(true); |
|
|
|
stp.Reset(); |
|
|
|
for(size_t ix = 0; ix < data.Nx() - 1; ix++) |
|
|
|
for(size_t ix = 0; ix < data.Nx() - 1; ix++) |
|
|
|
for(size_t iy = 0; iy < data.Ny() - 1; iy++) p.Add(data.StablePoints(ix, iy)); |
|
|
|
for(size_t iy = 0; iy < data.Ny() - 1; iy++) stp.Add(data.StablePoints(ix, iy)); |
|
|
|
|
|
|
|
|
|
|
|
if(outfmt == "bin") |
|
|
|
if(outfmtstp == "bin") |
|
|
|
p.WriteBinBile(name, pars); |
|
|
|
stp.WriteBinBile(name, pars); |
|
|
|
else if(outfmt == "nc" || outfmt == "netcdf") |
|
|
|
else if(outfmtstp == "nc" || outfmtstp == "netcdf") |
|
|
|
{ |
|
|
|
{ |
|
|
|
int compress = args.contains("compress") ? args.at("compress").ToInt() : 3; |
|
|
|
MString err; |
|
|
|
MString err = p.WriteNcFile(name, pars, args.at("_cmdline"), compress); |
|
|
|
if(!err.Exist() && !headwrited) err = stp.CreateNcFile(name, pars, args.at("_cmdline"), compress, tdata, !average); |
|
|
|
|
|
|
|
if(!err.Exist()) err = stp.WriteNcFile(it); |
|
|
|
if(err.Exist()) return err; |
|
|
|
if(err.Exist()) return err; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
return "Unknown format: " + outfmt; |
|
|
|
return "Unknown format: " + outfmt; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(average) break; |
|
|
|
|
|
|
|
headwrited = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
fw.Close(); |
|
|
|
|
|
|
|
fwfilt.Close(); |
|
|
|
|
|
|
|
stp.CloseNcFile(); |
|
|
|
return ""; |
|
|
|
return ""; |
|
|
|
}; |
|
|
|
}; |
|
|
|