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-29 00:00:05 2020 4 29 0 0 5.0004 282.9729 0.00630
## 2 2020-04-29 00:00:10 2020 4 29 0 0 10.0008 283.0519 0.00630
## 3 2020-04-29 00:00:15 2020 4 29 0 0 15.0012 283.1215 0.00631
## 4 2020-04-29 00:00:20 2020 4 29 0 0 20.0016 283.1846 0.00631
## 5 2020-04-29 00:00:24 2020 4 29 0 0 24.9984 283.2430 0.00631
## 6 2020-04-29 00:00:29 2020 4 29 0 0 29.9988 283.2976 0.00631
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -1.21458 3.88410 4.069575 162.6352 JFK
## 2 -1.22315 3.73477 3.929962 161.8662 JFK
## 3 -1.22919 3.61473 3.818007 161.2194 JFK
## 4 -1.23016 3.50521 3.714807 160.6614 JFK
## 5 -1.22645 3.40705 3.621073 160.2024 JFK
## 6 -1.21936 3.31924 3.536127 159.8286 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-04-28 00:00:05 2020 4 28 0 0 5.0004 280.8803 0.00496
## 2 2020-04-28 00:00:10 2020 4 28 0 0 10.0008 280.9404 0.00496
## 3 2020-04-28 00:00:15 2020 4 28 0 0 15.0012 280.9956 0.00496
## 4 2020-04-28 00:00:20 2020 4 28 0 0 20.0016 281.0460 0.00497
## 5 2020-04-28 00:00:24 2020 4 28 0 0 24.9984 281.0927 0.00497
## 6 2020-04-28 00:00:29 2020 4 28 0 0 29.9988 281.1365 0.00497
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 1.18013 -5.73527 5.855427 348.3727 JFK
## 2 1.21656 -5.44030 5.574664 347.3949 JFK
## 3 1.23473 -5.20785 5.352220 346.6620 JFK
## 4 1.24913 -5.02442 5.177366 346.0386 JFK
## 5 1.25819 -4.87098 5.030854 345.5169 JFK
## 6 1.25781 -4.74852 4.912283 345.1639 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-04-27 00:00:05 2020 4 27 0 0 5.0004 281.0728 0.00627
## 2 2020-04-27 00:00:10 2020 4 27 0 0 10.0008 281.1285 0.00627
## 3 2020-04-27 00:00:15 2020 4 27 0 0 15.0012 281.1789 0.00627
## 4 2020-04-27 00:00:20 2020 4 27 0 0 20.0016 281.2253 0.00627
## 5 2020-04-27 00:00:24 2020 4 27 0 0 24.9984 281.2687 0.00628
## 6 2020-04-27 00:00:29 2020 4 27 0 0 29.9988 281.3108 0.00628
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -2.48566 -5.98303 6.478823 22.56052 JFK
## 2 -2.32374 -5.53625 6.004151 22.76934 JFK
## 3 -2.20656 -5.21192 5.659772 22.94624 JFK
## 4 -2.10938 -4.95568 5.385931 23.05698 JFK
## 5 -2.02726 -4.74365 5.158682 23.14007 JFK
## 6 -1.96089 -4.57175 4.974534 23.21520 JFK
## Station Date.Time Temperature Relative.Humidity Wind.Direction
## 1 JFK 2020-04-28 00:51:00 279.8722 75.93 350
## 2 JFK 2020-04-28 01:51:00 279.8722 75.93 330
## 3 JFK 2020-04-28 02:51:00 279.2611 79.19 340
## 4 JFK 2020-04-28 03:51:00 279.2611 79.19 340
## 5 JFK 2020-04-28 04:51:00 279.8722 75.93 350
## 6 JFK 2020-04-28 05:51:00 279.8722 75.93 350
## Wind.Speed year mon day hour min sec
## 1 5.658436 2020 4 28 0 51 0
## 2 6.687243 2020 4 28 1 51 0
## 3 6.172840 2020 4 28 2 51 0
## 4 6.172840 2020 4 28 3 51 0
## 5 6.172840 2020 4 28 4 51 0
## 6 5.658436 2020 4 28 5 51 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 | 1.605 | 2.299 | 1.799 |
2 | WRF D-1 | 1.222 | 2.081 | 1.669 |
3 | WRF D-2 | 0.569 | 1.579 | 1.353 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -2.015 | 2.549 | 2.206 |
2 | WRF D-1 | -1.588 | 2.050 | 1.799 |
3 | WRF D-2 | -0.855 | 1.572 | 1.288 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 61.407 | 40.340 |
2 | WRF D-1 | 62.408 | 53.164 |
3 | WRF D-2 | 43.971 | 34.379 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 0.648 | 2.350 | 1.638 |
2 | WRF D-1 | 0.980 | 1.864 | 1.721 |
3 | WRF D-2 | 0.465 | 1.918 | 1.611 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -2.986 | 3.257 | 2.990 |
2 | WRF D-1 | -3.076 | 3.371 | 3.084 |
3 | WRF D-2 | -2.684 | 3.068 | 2.716 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 42.647 | 32.945 |
2 | WRF D-1 | 49.565 | 38.080 |
3 | WRF D-2 | 42.377 | 32.619 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 1.324 | 2.111 | 1.699 |
2 | WRF D-1 | 1.303 | 2.320 | 2.066 |
3 | WRF D-2 | 0.934 | 2.316 | 1.947 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -1.711 | 2.148 | 1.879 |
2 | WRF D-1 | -1.639 | 2.108 | 1.856 |
3 | WRF D-2 | -1.533 | 2.041 | 1.833 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 71.873 | 51.604 |
2 | WRF D-1 | 77.064 | 64.819 |
3 | WRF D-2 | 58.553 | 51.418 |
## Warning: Removed 1 rows containing missing values (geom_point).