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-05-12 00:00:05 2020 5 12 0 0 5.0004 284.4861 0.00540
## 2 2020-05-12 00:00:10 2020 5 12 0 0 10.0008 284.6521 0.00540
## 3 2020-05-12 00:00:15 2020 5 12 0 0 15.0012 284.7949 0.00540
## 4 2020-05-12 00:00:20 2020 5 12 0 0 20.0016 284.9193 0.00540
## 5 2020-05-12 00:00:24 2020 5 12 0 0 24.9984 285.0302 0.00541
## 6 2020-05-12 00:00:29 2020 5 12 0 0 29.9988 285.1306 0.00541
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 6.50246 -1.04592 6.586041 279.1378 JFK
## 2 6.30699 -1.01466 6.388087 279.1394 JFK
## 3 6.14529 -0.98820 6.224237 279.1353 JFK
## 4 6.00212 -0.96661 6.079456 279.1486 JFK
## 5 5.86643 -0.94247 5.941654 279.1269 JFK
## 6 5.74277 -0.91471 5.815161 279.0501 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-05-11 00:00:05 2020 5 11 0 0 5.0004 285.7833 0.00578
## 2 2020-05-11 00:00:10 2020 5 11 0 0 10.0008 285.8739 0.00579
## 3 2020-05-11 00:00:15 2020 5 11 0 0 15.0012 285.9524 0.00579
## 4 2020-05-11 00:00:20 2020 5 11 0 0 20.0016 286.0221 0.00579
## 5 2020-05-11 00:00:24 2020 5 11 0 0 24.9984 286.0852 0.00580
## 6 2020-05-11 00:00:29 2020 5 11 0 0 29.9988 286.1436 0.00580
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 2.49281 3.95728 4.676983 212.2081 JFK
## 2 2.40258 3.73807 4.443597 212.7302 JFK
## 3 2.33753 3.58037 4.275874 213.1395 JFK
## 4 2.27977 3.43802 4.125207 213.5486 JFK
## 5 2.23034 3.33116 4.008871 213.8038 JFK
## 6 2.18926 3.24191 3.911884 214.0311 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-05-10 00:00:05 2020 5 10 0 0 5.0004 279.5222 0.00376
## 2 2020-05-10 00:00:10 2020 5 10 0 0 10.0008 279.6288 0.00376
## 3 2020-05-10 00:00:15 2020 5 10 0 0 15.0012 279.7226 0.00376
## 4 2020-05-10 00:00:20 2020 5 10 0 0 20.0016 279.8058 0.00376
## 5 2020-05-10 00:00:24 2020 5 10 0 0 24.9984 279.8806 0.00376
## 6 2020-05-10 00:00:29 2020 5 10 0 0 29.9988 279.9486 0.00375
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 5.83965 -1.62780 6.062281 285.5758 JFK
## 2 5.68336 -1.59002 5.901588 285.6299 JFK
## 3 5.56474 -1.55119 5.776896 285.5760 JFK
## 4 5.46019 -1.52387 5.668849 285.5937 JFK
## 5 5.35828 -1.49706 5.563484 285.6099 JFK
## 6 5.26687 -1.47101 5.468436 285.6048 JFK
## Station Date.Time Temperature Relative.Humidity Wind.Direction
## 1 JFK 2020-05-11 00:00:00 NaN NaN 220
## 2 JFK 2020-05-11 00:05:00 NaN NaN 220
## 3 JFK 2020-05-11 00:10:00 NaN NaN 220
## 4 JFK 2020-05-11 00:15:00 NaN NaN 220
## 5 JFK 2020-05-11 00:20:00 NaN NaN 220
## 6 JFK 2020-05-11 00:25:00 NaN NaN 220
## Wind.Speed year mon day hour min sec
## 1 5.658436 2020 5 11 0 0 0
## 2 5.658436 2020 5 11 0 5 0
## 3 6.687243 2020 5 11 0 10 0
## 4 5.658436 2020 5 11 0 15 0
## 5 6.687243 2020 5 11 0 20 0
## 6 6.687243 2020 5 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.557 | 1.084 | 0.891 |
2 | WRF D-1 | -1.072 | 1.525 | 1.311 |
3 | WRF D-2 | -1.569 | 1.926 | 1.607 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -2.041 | 2.835 | 2.343 |
2 | WRF D-1 | -2.132 | 2.768 | 2.254 |
3 | WRF D-2 | -1.781 | 2.499 | 2.039 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 15.027 | 12.078 |
2 | WRF D-1 | 19.761 | 14.503 |
3 | WRF D-2 | 21.246 | 15.313 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -0.914 | 1.403 | 1.145 |
2 | WRF D-1 | -1.517 | 1.897 | 1.639 |
3 | WRF D-2 | -1.828 | 2.207 | 1.828 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -5.091 | 5.264 | 5.091 |
2 | WRF D-1 | -5.095 | 5.293 | 5.095 |
3 | WRF D-2 | -4.982 | 5.195 | 4.982 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 15.946 | 12.893 |
2 | WRF D-1 | 18.982 | 15.179 |
3 | WRF D-2 | 22.525 | 16.631 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -0.579 | 1.006 | 0.810 |
2 | WRF D-1 | -1.002 | 1.462 | 1.257 |
3 | WRF D-2 | -1.319 | 1.731 | 1.413 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -2.851 | 3.146 | 2.851 |
2 | WRF D-1 | -2.825 | 3.116 | 2.825 |
3 | WRF D-2 | -2.730 | 3.019 | 2.730 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 26.836 | 22.836 |
2 | WRF D-1 | 37.295 | 34.503 |
3 | WRF D-2 | 33.261 | 31.886 |