In this document I will explore how to create the first part of the evaluation system I proposed. The working title of this is the “Forecast-Hour Evaluation.” The idea here is that we are looking at the performance of the model by looking at how it performed with different start times (using the most recent 00-hr forecast as input).
## Warning in rgl.init(initValue, onlyNULL): RGL: unable to open X11 display
## Warning: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'.
For this evaluation system we need to look at three different output folders. Here we use the folders named, forecast_day_minus_0
, forecast_day_minus_1
, forecast_day_minus_2
. The contents of each of these folders will be similar: wrfout files for 86 forecast hours and time-series data for different locations of interest. Here we will first read the forecast data.
Now we will read the observation data from the ASOS stations. The script that downloads the data is in ./obs_station_day_minus_0/dl_ny_asos.py
. The lines for the dates to download need to be changed before running it. Once the files are download, the lines below reads the data and adds column names.
Model and observation data do not share the same units for the same variable. For temperature, WRF is in Kelvin and ASOS is in degreesF. For winds, WRF is in m/s and ASOS is in knots. The formulas used to convert the numbers to a common system is shown here. For temperature I will use Kelvin, and m/s for wind speeds.
Now we have one data frame for all the observations, and three (3) data frames of the WRF data (one data frame per forecast init time). The lines below provide a visual of the data frames.
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-07-22 00:00:05 2020 7 22 0 0 5.0004 299.2834 0.0164
## 2 2020-07-22 00:00:10 2020 7 22 0 0 10.0008 299.3737 0.0164
## 3 2020-07-22 00:00:15 2020 7 22 0 0 15.0012 299.4538 0.0164
## 4 2020-07-22 00:00:20 2020 7 22 0 0 20.0016 299.5265 0.0164
## 5 2020-07-22 00:00:24 2020 7 22 0 0 24.9984 299.5924 0.0164
## 6 2020-07-22 00:00:29 2020 7 22 0 0 29.9988 299.6529 0.0164
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -0.30280 3.51635 3.529363 175.0783 JFK
## 2 -0.32375 3.37883 3.394305 174.5268 JFK
## 3 -0.33964 3.27984 3.297379 174.0879 JFK
## 4 -0.35301 3.18158 3.201104 173.6687 JFK
## 5 -0.36535 3.10078 3.122230 173.2801 JFK
## 6 -0.37027 3.02515 3.047726 173.0219 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-07-21 00:00:05 2020 7 21 0 0 5.0004 303.7483 0.01567
## 2 2020-07-21 00:00:10 2020 7 21 0 0 10.0008 303.7796 0.01567
## 3 2020-07-21 00:00:15 2020 7 21 0 0 15.0012 303.8073 0.01567
## 4 2020-07-21 00:00:20 2020 7 21 0 0 20.0016 303.8313 0.01567
## 5 2020-07-21 00:00:24 2020 7 21 0 0 24.9984 303.8523 0.01567
## 6 2020-07-21 00:00:29 2020 7 21 0 0 29.9988 303.8714 0.01567
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 3.47407 -0.59788 3.525142 279.7648 JFK
## 2 3.42218 -0.58846 3.472406 279.7569 JFK
## 3 3.37524 -0.57717 3.424233 279.7038 JFK
## 4 3.33204 -0.56788 3.380086 279.6720 JFK
## 5 3.29009 -0.55644 3.336813 279.5994 JFK
## 6 3.24839 -0.54384 3.293600 279.5042 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-07-20 00:00:05 2020 7 20 0 0 5.0004 298.9888 0.01875
## 2 2020-07-20 00:00:10 2020 7 20 0 0 10.0008 299.1123 0.01875
## 3 2020-07-20 00:00:15 2020 7 20 0 0 15.0012 299.2151 0.01875
## 4 2020-07-20 00:00:20 2020 7 20 0 0 20.0016 299.3042 0.01875
## 5 2020-07-20 00:00:24 2020 7 20 0 0 24.9984 299.3829 0.01874
## 6 2020-07-20 00:00:29 2020 7 20 0 0 29.9988 299.4472 0.01874
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 0.11679 6.50548 6.506528 181.0285 JFK
## 2 0.02975 6.10297 6.103043 180.2793 JFK
## 3 -0.02853 5.82294 5.823010 179.7193 JFK
## 4 -0.07052 5.60088 5.601324 179.2786 JFK
## 5 -0.09859 5.41937 5.420267 178.9578 JFK
## 6 -0.11801 5.27576 5.277080 178.7186 JFK
## Station Date.Time Temperature Relative.Humidity Wind.Direction
## 1 JFK 2020-07-21 00:00:00 NaN NaN 280
## 2 JFK 2020-07-21 00:05:00 NaN NaN 280
## 3 JFK 2020-07-21 00:10:00 NaN NaN 280
## 4 JFK 2020-07-21 00:15:00 NaN NaN 280
## 5 JFK 2020-07-21 00:20:00 NaN NaN 270
## 6 JFK 2020-07-21 00:25:00 NaN NaN 270
## Wind.Speed year mon day hour min sec
## 1 5.658436 2020 7 21 0 0 0
## 2 5.144033 2020 7 21 0 5 0
## 3 7.716049 2020 7 21 0 10 0
## 4 5.658436 2020 7 21 0 15 0
## 5 6.687243 2020 7 21 0 20 0
## 6 6.687243 2020 7 21 0 25 0
Time-matching is performed using a routine that can be found in Analysis01-Time_Matching_Problem.Rmd
. The time matching will be done per variable. For the Forecast-Hour Evaluation product, we will focus on the temperature, wind speed and wind direction variables. Also, now that we have read all the TS data and ASOS data, we need to extract the day of interest, or doi
for the time-series.
Note that for this product the “day of interest” will always be the UTC date of the day before.
We now have filtered data frames for the observations and model data for the day of interest.
Next, we will select only the temperature data for comparing the model and observations. This needs to be done on a per station basis. Note that we use the function drop_na()
to drop rows which contain NaN or NA data. Since each variable is measured at different intervals, not all variables will have data available at every time step in the ASOS data. The functions may be too sensitive to missing data and thus we take care to remvove it here from the observations, after we have isolated a particular variable.
For the temperature data I will use Bias, RMSE and MAE for the comparison statistics
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 0.261 | 1.764 | 1.432 |
2 | WRF D-1 | -0.264 | 1.857 | 1.465 |
3 | WRF D-2 | -0.549 | 2.166 | 1.691 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -0.708 | 2.265 | 1.460 |
2 | WRF D-1 | -0.686 | 2.310 | 1.387 |
3 | WRF D-2 | 0.238 | 2.237 | 1.717 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 63.113 | 47.290 |
2 | WRF D-1 | 55.984 | 42.492 |
3 | WRF D-2 | 67.241 | 57.490 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 0.541 | 2.129 | 1.656 |
2 | WRF D-1 | -0.014 | 2.370 | 1.686 |
3 | WRF D-2 | -1.747 | 2.821 | 2.250 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -1.695 | 2.437 | 2.009 |
2 | WRF D-1 | -1.884 | 2.535 | 2.130 |
3 | WRF D-2 | -1.256 | 2.305 | 1.757 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 72.082 | 52.534 |
2 | WRF D-1 | 60.758 | 44.778 |
3 | WRF D-2 | 78.870 | 63.515 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 3.309 | 4.175 | 3.309 |
2 | WRF D-1 | 2.066 | 3.737 | 2.475 |
3 | WRF D-2 | 0.545 | 2.260 | 1.930 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -0.509 | 1.999 | 1.247 |
2 | WRF D-1 | -0.578 | 1.976 | 1.250 |
3 | WRF D-2 | -0.442 | 1.961 | 1.275 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 118.540 | 104.458 |
2 | WRF D-1 | 104.685 | 91.478 |
3 | WRF D-2 | 89.593 | 81.284 |
## Warning: Removed 344 rows containing missing values (geom_point).
## Warning: Removed 344 rows containing missing values (geom_path).
## Warning: Removed 2 rows containing missing values (geom_point).