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-04-12 00:00:05 2020 4 12 0 0 5.0004 283.3337 0.00385
## 2 2020-04-12 00:00:10 2020 4 12 0 0 10.0008 283.3686 0.00385
## 3 2020-04-12 00:00:15 2020 4 12 0 0 15.0012 283.4007 0.00385
## 4 2020-04-12 00:00:20 2020 4 12 0 0 20.0016 283.4303 0.00385
## 5 2020-04-12 00:00:24 2020 4 12 0 0 24.9984 283.4584 0.00385
## 6 2020-04-12 00:00:29 2020 4 12 0 0 29.9988 283.4852 0.00385
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 3.28792 -0.19474 3.293682 273.3896 JFK
## 2 3.25129 -0.19964 3.257414 273.5137 JFK
## 3 3.21695 -0.19682 3.222965 273.5011 JFK
## 4 3.18527 -0.19884 3.191470 273.5720 JFK
## 5 3.15717 -0.19967 3.163478 273.6188 JFK
## 6 3.13000 -0.19681 3.136181 273.5979 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-04-11 00:00:05 2020 4 11 0 0 5.0004 280.5398 0.00371
## 2 2020-04-11 00:00:10 2020 4 11 0 0 10.0008 280.6251 0.00371
## 3 2020-04-11 00:00:15 2020 4 11 0 0 15.0012 280.7003 0.00371
## 4 2020-04-11 00:00:20 2020 4 11 0 0 20.0016 280.7659 0.00371
## 5 2020-04-11 00:00:24 2020 4 11 0 0 24.9984 280.8237 0.00371
## 6 2020-04-11 00:00:29 2020 4 11 0 0 29.9988 280.8758 0.00371
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 7.14118 -4.58683 8.487371 302.7129 JFK
## 2 6.90254 -4.41104 8.191601 302.5804 JFK
## 3 6.71820 -4.25757 7.953686 302.3639 JFK
## 4 6.55442 -4.13071 7.747463 302.2198 JFK
## 5 6.40317 -4.01794 7.559393 302.1080 JFK
## 6 6.25332 -3.91227 7.376304 302.0314 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-04-10 00:00:05 2020 4 10 0 0 5.0004 283.8201 0.00691
## 2 2020-04-10 00:00:10 2020 4 10 0 0 10.0008 283.9124 0.00691
## 3 2020-04-10 00:00:15 2020 4 10 0 0 15.0012 283.9962 0.00691
## 4 2020-04-10 00:00:20 2020 4 10 0 0 20.0016 284.0736 0.00691
## 5 2020-04-10 00:00:24 2020 4 10 0 0 24.9984 284.1458 0.00691
## 6 2020-04-10 00:00:29 2020 4 10 0 0 29.9988 284.2134 0.00692
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -0.57875 2.32576 2.396688 166.0261 JFK
## 2 -0.57692 2.26299 2.335372 165.6978 JFK
## 3 -0.57382 2.22165 2.294558 165.5178 JFK
## 4 -0.57045 2.17530 2.248854 165.3057 JFK
## 5 -0.56632 2.13857 2.212284 165.1678 JFK
## 6 -0.56016 2.10459 2.177861 165.0956 JFK
## Station Date.Time Temperature Relative.Humidity Wind.Direction
## 1 JFK 2020-04-11 00:00:00 NaN NaN NaN
## 2 JFK 2020-04-11 00:05:00 NaN NaN 290
## 3 JFK 2020-04-11 00:10:00 NaN NaN 300
## 4 JFK 2020-04-11 00:15:00 NaN NaN NaN
## 5 JFK 2020-04-11 00:20:00 NaN NaN 300
## 6 JFK 2020-04-11 00:25:00 NaN NaN NaN
## Wind.Speed year mon day hour min sec
## 1 9.259259 2020 4 11 0 0 0
## 2 8.744856 2020 4 11 0 5 0
## 3 9.259259 2020 4 11 0 10 0
## 4 11.831276 2020 4 11 0 15 0
## 5 11.316872 2020 4 11 0 20 0
## 6 9.773663 2020 4 11 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.552 | 1.709 | 1.428 |
2 | WRF D-1 | 0.315 | 1.538 | 1.180 |
3 | WRF D-2 | -3.363 | 3.917 | 3.363 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -1.419 | 2.093 | 1.723 |
2 | WRF D-1 | -1.236 | 2.131 | 1.680 |
3 | WRF D-2 | 1.185 | 3.256 | 2.695 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 47.849 | 30.604 |
2 | WRF D-1 | 55.138 | 34.542 |
3 | WRF D-2 | 122.516 | 109.307 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 0.102 | 1.231 | 0.915 |
2 | WRF D-1 | -0.553 | 1.382 | 1.175 |
3 | WRF D-2 | -5.206 | 5.380 | 5.206 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -2.524 | 3.044 | 2.620 |
2 | WRF D-1 | -2.330 | 2.788 | 2.446 |
3 | WRF D-2 | -1.480 | 2.784 | 2.375 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 44.582 | 28.317 |
2 | WRF D-1 | 64.848 | 44.493 |
3 | WRF D-2 | 118.300 | 104.666 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 0.516 | 1.554 | 1.331 |
2 | WRF D-1 | -0.200 | 1.267 | 0.993 |
3 | WRF D-2 | -5.529 | 5.751 | 5.529 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -1.592 | 2.045 | 1.741 |
2 | WRF D-1 | -1.523 | 1.940 | 1.655 |
3 | WRF D-2 | -1.419 | 1.991 | 1.653 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 61.232 | 45.450 |
2 | WRF D-1 | 66.425 | 42.111 |
3 | WRF D-2 | 121.262 | 111.603 |
## Warning: Removed 2 rows containing missing values (geom_point).