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-13 00:00:05 2020 4 13 0 0 5.0004 283.8241 0.00624
## 2 2020-04-13 00:00:10 2020 4 13 0 0 10.0008 283.9417 0.00625
## 3 2020-04-13 00:00:15 2020 4 13 0 0 15.0012 284.0410 0.00625
## 4 2020-04-13 00:00:20 2020 4 13 0 0 20.0016 284.1282 0.00625
## 5 2020-04-13 00:00:24 2020 4 13 0 0 24.9984 284.2056 0.00625
## 6 2020-04-13 00:00:29 2020 4 13 0 0 29.9988 284.2758 0.00626
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -0.36565 5.22576 5.238537 175.9975 JFK
## 2 -0.41412 4.97756 4.994757 175.2441 JFK
## 3 -0.44710 4.79333 4.814137 174.6711 JFK
## 4 -0.46841 4.63671 4.660310 174.2314 JFK
## 5 -0.48690 4.51559 4.541764 173.8458 JFK
## 6 -0.48808 4.41032 4.437245 173.6849 JFK
## 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
## Station Date.Time Temperature Relative.Humidity Wind.Direction
## 1 JFK 2020-04-12 00:00:00 NaN NaN 280
## 2 JFK 2020-04-12 00:05:00 NaN NaN 270
## 3 JFK 2020-04-12 00:10:00 NaN NaN 280
## 4 JFK 2020-04-12 00:15:00 NaN NaN 280
## 5 JFK 2020-04-12 00:20:00 NaN NaN 270
## 6 JFK 2020-04-12 00:25:00 NaN NaN 280
## Wind.Speed year mon day hour min sec
## 1 4.115226 2020 4 12 0 0 0
## 2 5.658436 2020 4 12 0 5 0
## 3 5.144033 2020 4 12 0 10 0
## 4 5.658436 2020 4 12 0 15 0
## 5 4.629630 2020 4 12 0 20 0
## 6 5.144033 2020 4 12 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.390 | 1.068 | 0.888 |
2 | WRF D-1 | -0.062 | 0.659 | 0.486 |
3 | WRF D-2 | -0.076 | 0.968 | 0.639 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -3.091 | 3.817 | 3.200 |
2 | WRF D-1 | -2.022 | 3.248 | 2.627 |
3 | WRF D-2 | -2.598 | 3.509 | 2.941 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 11.037 | 8.261 |
2 | WRF D-1 | 12.709 | 9.726 |
3 | WRF D-2 | 28.090 | 14.150 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -0.092 | 1.220 | 0.904 |
2 | WRF D-1 | -0.290 | 1.170 | 0.974 |
3 | WRF D-2 | -0.238 | 1.437 | 1.128 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -4.306 | 4.962 | 4.311 |
2 | WRF D-1 | -3.857 | 4.968 | 3.893 |
3 | WRF D-2 | -4.303 | 4.969 | 4.354 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 14.866 | 10.686 |
2 | WRF D-1 | 14.791 | 9.889 |
3 | WRF D-2 | 33.787 | 17.190 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 1.082 | 1.656 | 1.168 |
2 | WRF D-1 | 1.115 | 1.613 | 1.356 |
3 | WRF D-2 | 1.482 | 2.167 | 1.783 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -2.268 | 2.593 | 2.279 |
2 | WRF D-1 | -2.282 | 2.604 | 2.282 |
3 | WRF D-2 | -2.376 | 2.643 | 2.388 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 26.881 | 18.154 |
2 | WRF D-1 | 31.695 | 19.971 |
3 | WRF D-2 | 29.475 | 20.516 |
## Warning: Removed 55 rows containing missing values (geom_point).
## Warning: Removed 38 rows containing missing values (geom_path).
## Warning: Removed 24 rows containing missing values (geom_point).