|
|
@ -137,6 +137,7 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
if(err.Exist()) return err; |
|
|
|
if(err.Exist()) return err; |
|
|
|
|
|
|
|
|
|
|
|
bool average = args.contains("average"); |
|
|
|
bool average = args.contains("average"); |
|
|
|
|
|
|
|
bool obfuscate = args.contains("obfuscate"); |
|
|
|
|
|
|
|
|
|
|
|
int compress = 3; |
|
|
|
int compress = 3; |
|
|
|
if(args.contains("compress")) compress = args.at("compress").ToInt(); |
|
|
|
if(args.contains("compress")) compress = args.at("compress").ToInt(); |
|
|
@ -231,7 +232,7 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
|
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fw.Create(data, name, compress); |
|
|
|
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.AddTimeData(tdata, !average); |
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddAtts(pars); |
|
|
|
if(!err.Exist() && !headwrited && !obfuscate) err = fw.AddAtts(pars); |
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("u", "", "Eastward velocity", velunit, ""); |
|
|
|
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("v", "", "Northward velocity", velunit, ""); |
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("div", "", "Velocity divergence", "(" + velunit + ")/" + distunit, ""); |
|
|
|
if(!err.Exist() && !headwrited) err = fw.AddVariable("div", "", "Velocity divergence", "(" + velunit + ")/" + distunit, ""); |
|
|
@ -287,7 +288,7 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
|
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.Create(sdata, namevel, compress); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.Create(sdata, namevel, compress); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.AddTimeData(tdata, !average); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.AddTimeData(tdata, !average); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.AddAtts(pars); |
|
|
|
if(!err.Exist() && !headwrited && !obfuscate) err = fwfilt.AddAtts(pars); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.AddVariable("u", "", "Eastward velocity", velunit, ""); |
|
|
|
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.AddVariable("v", "", "Northward velocity", velunit, ""); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.WriteGrid(sdata); |
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.WriteGrid(sdata); |
|
|
@ -312,7 +313,10 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
else if(outfmtstp == "nc" || outfmtstp == "netcdf") |
|
|
|
else if(outfmtstp == "nc" || outfmtstp == "netcdf") |
|
|
|
{ |
|
|
|
{ |
|
|
|
MString err; |
|
|
|
MString err; |
|
|
|
if(!err.Exist() && !headwrited) err = stp.CreateNcFile(namestp, pars, args.at("_cmdline"), compress, tdata, !average); |
|
|
|
{ |
|
|
|
|
|
|
|
michlib_internal::ParameterListEx epars; |
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = stp.CreateNcFile(namestp, obfuscate ? epars : pars, obfuscate ? "" : args.at("_cmdline"), compress, tdata, !average); |
|
|
|
|
|
|
|
} |
|
|
|
if(!err.Exist()) err = stp.WriteNcFile(it); |
|
|
|
if(!err.Exist()) err = stp.WriteNcFile(it); |
|
|
|
if(err.Exist()) return err; |
|
|
|
if(err.Exist()) return err; |
|
|
|
} |
|
|
|
} |
|
|
|