|
|
@ -152,9 +152,9 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
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 namevel = args.contains("velout") ? args.at("velout") : ""; |
|
|
|
MString outfmtvel = args.contains("veloutformat") ? args.at("veloutformat") : (GetExt(name) == "nc" ? "nc" : "bin"); |
|
|
|
MString outfmtvel = args.contains("veloutformat") ? args.at("veloutformat") : (GetExt(namevel) == "nc" ? "nc" : "bin"); |
|
|
|
MString namestp = args.contains("stpout") ? args.at("stpout") : ""; |
|
|
|
MString namestp = args.contains("stpout") ? args.at("stpout") : ""; |
|
|
|
MString outfmtstp = args.contains("stpoutformat") ? args.at("stpoutformat") : (GetExt(name) == "nc" ? "nc" : "bin"); |
|
|
|
MString outfmtstp = args.contains("stpoutformat") ? args.at("stpoutformat") : (GetExt(namestp) == "nc" ? "nc" : "bin"); |
|
|
|
|
|
|
|
|
|
|
|
size_t shiftx = args.contains("shiftx") ? args.at("shiftx").ToInteger<size_t>() : 0; |
|
|
|
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 shifty = args.contains("shifty") ? args.at("shifty").ToInteger<size_t>() : 0; |
|
|
@ -263,7 +263,7 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
if(outfmtvel == "bin") |
|
|
|
if(outfmtvel == "bin") |
|
|
|
{ |
|
|
|
{ |
|
|
|
BFileW vel; |
|
|
|
BFileW vel; |
|
|
|
vel.Create(name, 4); |
|
|
|
vel.Create(namevel, 4); |
|
|
|
vel.SetColumnName(1, "Longitude"); |
|
|
|
vel.SetColumnName(1, "Longitude"); |
|
|
|
vel.SetColumnName(2, "Latitude"); |
|
|
|
vel.SetColumnName(2, "Latitude"); |
|
|
|
vel.SetColumnName(3, "u, " + velunit); |
|
|
|
vel.SetColumnName(3, "u, " + velunit); |
|
|
@ -285,7 +285,7 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
{ |
|
|
|
{ |
|
|
|
MString err; |
|
|
|
MString err; |
|
|
|
|
|
|
|
|
|
|
|
if(!err.Exist() && !headwrited) err = fwfilt.Create(sdata, name, 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) 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, ""); |
|
|
@ -312,11 +312,11 @@ template<class D> MString ActionUV::DoAction(const CLArgs& args, D& ds) |
|
|
|
for(size_t iy = 0; iy < data.Ny() - 1; iy++) stp.Add(data.StablePoints(ix, iy)); |
|
|
|
for(size_t iy = 0; iy < data.Ny() - 1; iy++) stp.Add(data.StablePoints(ix, iy)); |
|
|
|
|
|
|
|
|
|
|
|
if(outfmtstp == "bin") |
|
|
|
if(outfmtstp == "bin") |
|
|
|
stp.WriteBinBile(name, pars); |
|
|
|
stp.WriteBinBile(namestp, pars); |
|
|
|
else if(outfmtstp == "nc" || outfmtstp == "netcdf") |
|
|
|
else if(outfmtstp == "nc" || outfmtstp == "netcdf") |
|
|
|
{ |
|
|
|
{ |
|
|
|
MString err; |
|
|
|
MString err; |
|
|
|
if(!err.Exist() && !headwrited) err = stp.CreateNcFile(name, pars, args.at("_cmdline"), compress, tdata, !average); |
|
|
|
if(!err.Exist() && !headwrited) err = stp.CreateNcFile(namestp, pars, 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; |
|
|
|
} |
|
|
|
} |
|
|
|