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-25 00:00:05 2020 4 25 0 0 5.0004 282.3018 0.00654
## 2 2020-04-25 00:00:10 2020 4 25 0 0 10.0008 282.3226 0.00654
## 3 2020-04-25 00:00:15 2020 4 25 0 0 15.0012 282.3431 0.00655
## 4 2020-04-25 00:00:20 2020 4 25 0 0 20.0016 282.3626 0.00655
## 5 2020-04-25 00:00:24 2020 4 25 0 0 24.9984 282.3819 0.00655
## 6 2020-04-25 00:00:29 2020 4 25 0 0 29.9988 282.4017 0.00655
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -0.64592 -2.57242 2.652274 14.09524 JFK
## 2 -0.62324 -2.49231 2.569054 14.03976 JFK
## 3 -0.59594 -2.42148 2.493734 13.82605 JFK
## 4 -0.57400 -2.36096 2.429734 13.66472 JFK
## 5 -0.55576 -2.30793 2.373902 13.53931 JFK
## 6 -0.54057 -2.25693 2.320765 13.46949 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-04-24 00:00:05 2020 4 24 0 0 5.0004 280.4555 0.00353
## 2 2020-04-24 00:00:10 2020 4 24 0 0 10.0008 280.5028 0.00354
## 3 2020-04-24 00:00:15 2020 4 24 0 0 15.0012 280.5467 0.00354
## 4 2020-04-24 00:00:20 2020 4 24 0 0 20.0016 280.5885 0.00354
## 5 2020-04-24 00:00:24 2020 4 24 0 0 24.9984 280.6281 0.00355
## 6 2020-04-24 00:00:29 2020 4 24 0 0 29.9988 280.6665 0.00355
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -1.80493 1.52667 2.363999 130.2257 JFK
## 2 -1.78325 1.50036 2.330464 130.0760 JFK
## 3 -1.77260 1.48220 2.310634 129.9015 JFK
## 4 -1.75523 1.45845 2.282084 129.7238 JFK
## 5 -1.74314 1.43608 2.258509 129.4833 JFK
## 6 -1.72932 1.41137 2.232154 129.2193 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-04-23 00:00:05 2020 4 23 0 0 5.0004 282.3331 0.0028
## 2 2020-04-23 00:00:10 2020 4 23 0 0 10.0008 282.3642 0.0028
## 3 2020-04-23 00:00:15 2020 4 23 0 0 15.0012 282.3939 0.0028
## 4 2020-04-23 00:00:20 2020 4 23 0 0 20.0016 282.4206 0.0028
## 5 2020-04-23 00:00:24 2020 4 23 0 0 24.9984 282.4457 0.0028
## 6 2020-04-23 00:00:29 2020 4 23 0 0 29.9988 282.4695 0.0028
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 4.32144 -1.58800 4.603975 290.1769 JFK
## 2 4.25332 -1.56723 4.532873 290.2274 JFK
## 3 4.19032 -1.53611 4.463005 290.1322 JFK
## 4 4.13571 -1.51886 4.405795 290.1660 JFK
## 5 4.08334 -1.50069 4.350372 290.1792 JFK
## 6 4.02980 -1.48409 4.294393 290.2177 JFK
## Station Date.Time Temperature Relative.Humidity Wind.Direction
## 1 JFK 2020-04-24 00:00:00 NaN NaN 130
## 2 JFK 2020-04-24 00:05:00 NaN NaN 120
## 3 JFK 2020-04-24 00:10:00 NaN NaN 120
## 4 JFK 2020-04-24 00:15:00 NaN NaN 140
## 5 JFK 2020-04-24 00:20:00 NaN NaN 130
## 6 JFK 2020-04-24 00:25:00 NaN NaN 120
## Wind.Speed year mon day hour min sec
## 1 2.572016 2020 4 24 0 0 0
## 2 2.572016 2020 4 24 0 5 0
## 3 1.028807 2020 4 24 0 10 0
## 4 2.572016 2020 4 24 0 15 0
## 5 2.572016 2020 4 24 0 20 0
## 6 2.057613 2020 4 24 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 | 1.224 | 1.938 | 1.628 |
2 | WRF D-1 | 0.910 | 1.456 | 1.187 |
3 | WRF D-2 | 0.015 | 1.257 | 1.076 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -0.264 | 1.226 | 1.029 |
2 | WRF D-1 | -0.433 | 1.459 | 1.165 |
3 | WRF D-2 | 0.433 | 1.350 | 1.136 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 24.589 | 16.309 |
2 | WRF D-1 | 43.276 | 29.413 |
3 | WRF D-2 | 27.670 | 20.040 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 0.710 | 1.188 | 1.059 |
2 | WRF D-1 | 0.131 | 0.982 | 0.840 |
3 | WRF D-2 | -0.589 | 1.116 | 0.861 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -0.875 | 1.815 | 1.382 |
2 | WRF D-1 | -0.934 | 1.951 | 1.502 |
3 | WRF D-2 | -0.219 | 1.873 | 1.531 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 46.370 | 31.312 |
2 | WRF D-1 | 51.193 | 40.494 |
3 | WRF D-2 | 30.584 | 22.654 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 1.195 | 1.594 | 1.364 |
2 | WRF D-1 | 0.895 | 1.702 | 1.557 |
3 | WRF D-2 | 0.063 | 0.901 | 0.729 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -0.463 | 1.289 | 0.920 |
2 | WRF D-1 | -0.468 | 1.303 | 0.952 |
3 | WRF D-2 | -0.359 | 1.240 | 0.951 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 25.600 | 24.187 |
2 | WRF D-1 | 44.530 | 38.800 |
3 | WRF D-2 | 35.958 | 26.669 |
## Warning: Removed 26 rows containing missing values (geom_point).