public class MADISWeatherChecker
extends java.lang.Object
implements java.io.Serializable
SRTM elevation data
to qualify some of its checks for weather stations
that do not report their elevation, so the Level 1 static barometric pressure check may be disabled
or loosened for stations in areas without downloaded SRTM data.
Note that this class is not thread-safe, so a unique instance should be created for each thread using it. Also, all the responses for a given field should be obtained before running another check on a different field or station.
If the level 3 spatial consistency checks are to be performed, this uses the modified Shepard's method for doing the weighted checks, but still splits into 8 octants around the checked station.
Constructor and Description |
---|
MADISWeatherChecker()
Create an instance of a MADISWeatherChecker.
|
Modifier and Type | Method and Description |
---|---|
boolean |
check(WeatherEnum en,
java.util.Map<java.lang.Enum,java.lang.Object> weatherMap,
java.util.Map<java.lang.Enum,java.lang.Object> prevWeatherMap,
StationState ss)
Perform the MADIS checks on the specified weather parameter from an APRS packet with
weather data in it.
|
boolean |
check(WeatherEnum en,
OpenTracMessage otm,
OpenTracMessage prevOTM,
StationState ss)
Perform the MADIS checks on the specified weather parameter from an OpenTRAC packet with
weather data in it.
|
static float |
getMinimumPressureForThisLocation(float altitudeM,
double latitude,
double longitude)
Compute the Level 1 static minimum barometric pressure for a given station location,
based on the station's reported altitude if provided, else on the ground elevation at the
station's reported latitude/longitude.
|
static float |
getMinimumPressureForThisLocation(StationState ss)
Compute the Level 1 static minimum barometric pressure for a given station location,
based on the station's reported altitude if provided, else on the ground elevation at the
station's reported latitude/longitude.
|
void |
initializeSpatialCheckEnvironment(float maxRngLvl3SpatialKm)
Specify that the current known set of weather stations should be used for performing
level 3 spatial consistency checks.
|
boolean |
isNotTooOld()
Report if the last data record was not out-of-date.
|
boolean |
level1check(WeatherEnum en,
java.util.Map<java.lang.Enum,java.lang.Object> weatherMap,
StationState ss)
Perform only the MADIS Level 1 validity checks on the specified weather parameter from an APRS packet with
weather data in it.
|
public MADISWeatherChecker()
public static float getMinimumPressureForThisLocation(StationState ss)
ss
- StationState to obtain station location frompublic static float getMinimumPressureForThisLocation(float altitudeM, double latitude, double longitude)
altitudeM
- reported altitude in meters, or Float.NaN if not knownlatitude
- reported latitude in fractional degrees Northlongitude
- reported longitude in fractional degrees Eastpublic boolean isNotTooOld()
public void initializeSpatialCheckEnvironment(float maxRngLvl3SpatialKm)
maxRngLvl3SpatialKm
- the maximum range (in kilometers) from the station under
test to another station for that other station to be considered
as a test referencepublic boolean check(WeatherEnum en, java.util.Map<java.lang.Enum,java.lang.Object> weatherMap, java.util.Map<java.lang.Enum,java.lang.Object> prevWeatherMap, StationState ss)
isNotTooOld()
to get the age results.en
- WeatherEnum to identify the weather parameter to checkweatherMap
- Map of current weather data from APRS packetprevWeatherMap
- earlier APRS packet's weather data Map from same station to use for time variation checksss
- StationState of station being checkedpublic boolean level1check(WeatherEnum en, java.util.Map<java.lang.Enum,java.lang.Object> weatherMap, StationState ss)
en
- WeatherEnum to identify the weather parameter to checkweatherMap
- Map of current weather data from APRS packetss
- StationState of station being checkedpublic boolean check(WeatherEnum en, OpenTracMessage otm, OpenTracMessage prevOTM, StationState ss)
isNotTooOld()
to get the age results.en
- WeatherEnum to identify the weather parameter to checkotm
- OpenTracMessage packet to analyzeprevOTM
- earlier OpenTracMessage packet from same station to use for time variation checksss
- StationState of station being checked