Commit 8267a95b authored by Purves, Murray's avatar Purves, Murray
Browse files

Added code to remove a row if pressure value invalid - primarily useful for...

Added code to remove a row if pressure value invalid - primarily useful for files converted from Buonaiuto data where many blank lines may be present at end
parent 5d9ba562
Pipeline #27249 failed with stages
in 16 minutes and 16 seconds
......@@ -60,6 +60,12 @@ bool interpolateValues(const std::vector<float> &pressureValues,
{
std::cout << "Error! Pressure vector contains " << missingValue
<< " values - can't use to interpolate" << std::endl;
std::cout << " Pressure vector:";
for (float p : pressureValues)
{
std::cout << " " << p << ";";
}
std::cout << std::endl;
return false;
}
}
......@@ -464,6 +470,27 @@ int main(int argc, char **argv)
<< std::endl;
inputHeights.push_back(missingValue);
}
// If pressure value in this row is -9999, remove the row
// - pressure entry is required for interpolation & by HYSPLIT
if (inputPressures.back() == missingValue)
{
std::cout << " Warning: pressure entry in row " << row
<< " is -9999; removing row" << std::endl;
inputPressures.pop_back();
inputTemps.pop_back();
if (usingRelHum)
{
inputRelHums.pop_back();
}
if (usingDewPt)
{
inputDewPts.pop_back();
}
inputWSpds.pop_back();
inputWDirs.pop_back();
inputHeights.pop_back();
}
}
std::cout << "Data read complete: " << inputPressures.size()
<< " entries read." << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment