Skip to content
Snippets Groups Projects
Commit 791ac840 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

New util method for weather observation list

New weather element
parent 834db4b9
Branches
Tags
No related merge requests found
......@@ -74,6 +74,10 @@ public class WeatherElements {
* Leaf wetness (Minutes per hour)
*/
public static final String LEAF_WETNESS = "BT";
/**
* Leaf wetness at ground level (Minutes per hour)
*/
public static final String LEAF_WETNESS_GROUND_LEVEL = "BTg";
/**
* Average wind speed (meters / second)
*/
......
......@@ -482,7 +482,14 @@ public class WeatherUtil {
* @param UM Relative humidity (average, %)
* @return
*/
public List<WeatherObservation> calculateLeafWetnessHourSeriesBestEffort(List<WeatherObservation> BT, List<WeatherObservation> TM, List<WeatherObservation> RR, List<WeatherObservation> Q0, List<WeatherObservation> FM2, List<WeatherObservation> UM) throws ConfigValidationException {
public List<WeatherObservation> calculateLeafWetnessHourSeriesBestEffort(
List<WeatherObservation> BT,
List<WeatherObservation> TM,
List<WeatherObservation> RR,
List<WeatherObservation> Q0,
List<WeatherObservation> FM2,
List<WeatherObservation> UM
) throws ConfigValidationException {
// If BT is same length as TM, return BT unmodified
if(BT.size() == TM.size())
{
......@@ -1476,4 +1483,24 @@ public class WeatherUtil {
//System.out.println("fixed elements=" + retVal.size());
return retVal;
}
/**
* Simple renaming method. Modifies the given list and returns it
* @param observations
* @param oldName
* @param newName
* @return
*/
public List<WeatherObservation> renameParameter(List<WeatherObservation> observations, String oldName, String newName)
{
for(WeatherObservation obs : observations)
{
if(obs.getElementMeasurementTypeId().equals(oldName))
{
obs.setElementMeasurementTypeId(newName);
}
}
return observations;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment