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).
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.
## Note: Using an external vector in selections is ambiguous.
## ℹ Use `all_of(select_columns)` instead of `select_columns` to silence this message.
## ℹ See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
## This message is displayed once per session.
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-03-03 00:00:05 2020 3 3 0 0 5.0004 281.4672 0.00542
## 2 2020-03-03 00:00:10 2020 3 3 0 0 10.0008 281.4989 0.00543
## 3 2020-03-03 00:00:15 2020 3 3 0 0 15.0012 281.5237 0.00543
## 4 2020-03-03 00:00:20 2020 3 3 0 0 20.0016 281.5451 0.00543
## 5 2020-03-03 00:00:24 2020 3 3 0 0 24.9984 281.5676 0.00544
## 6 2020-03-03 00:00:29 2020 3 3 0 0 29.9988 281.5851 0.00544
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 1.22254 6.62521 6.737063 190.4551 JFK
## 2 1.09269 6.17132 6.267309 190.0407 JFK
## 3 1.01160 5.86766 5.954223 189.7818 JFK
## 4 0.94945 5.63086 5.710345 189.5709 JFK
## 5 0.90630 5.45183 5.526647 189.4384 JFK
## 6 0.87041 5.29583 5.366883 189.3336 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-03-02 00:00:05 2020 3 2 0 0 5.0004 278.6126 0.00272
## 2 2020-03-02 00:00:10 2020 3 2 0 0 10.0008 278.6269 0.00272
## 3 2020-03-02 00:00:15 2020 3 2 0 0 15.0012 278.6368 0.00272
## 4 2020-03-02 00:00:20 2020 3 2 0 0 20.0016 278.6466 0.00272
## 5 2020-03-02 00:00:24 2020 3 2 0 0 24.9984 278.6567 0.00273
## 6 2020-03-02 00:00:29 2020 3 2 0 0 29.9988 278.6671 0.00273
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 2.20330 -0.56591 2.274815 284.4048 JFK
## 2 2.19619 -0.56805 2.268465 284.5019 JFK
## 3 2.17427 -0.55716 2.244522 284.3729 JFK
## 4 2.15956 -0.55426 2.229552 284.3945 JFK
## 5 2.14220 -0.55204 2.212186 284.4506 JFK
## 6 2.12870 -0.54625 2.197670 284.3922 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-03-01 00:00:05 2020 3 1 0 0 5.0004 271.9813 0.0017
## 2 2020-03-01 00:00:10 2020 3 1 0 0 10.0008 272.0778 0.0017
## 3 2020-03-01 00:00:15 2020 3 1 0 0 15.0012 272.1663 0.0017
## 4 2020-03-01 00:00:20 2020 3 1 0 0 20.0016 272.2466 0.0017
## 5 2020-03-01 00:00:24 2020 3 1 0 0 24.9984 272.3199 0.0017
## 6 2020-03-01 00:00:29 2020 3 1 0 0 29.9988 272.3868 0.0017
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 4.56979 -4.92495 6.718490 317.1422 JFK
## 2 4.45795 -4.72146 6.493497 316.6443 JFK
## 3 4.37077 -4.55255 6.311049 316.1670 JFK
## 4 4.28755 -4.42281 6.159897 315.8897 JFK
## 5 4.21225 -4.31989 6.033614 315.7228 JFK
## 6 4.14124 -4.22575 5.916657 315.5787 JFK
## Station Date.Time Temperature Relative.Humidity Wind.Direction
## 1 JFK 2020-03-02 00:00:00 NaN NaN 260
## 2 JFK 2020-03-02 00:05:00 NaN NaN 260
## 3 JFK 2020-03-02 00:10:00 NaN NaN 260
## 4 JFK 2020-03-02 00:15:00 NaN NaN 270
## 5 JFK 2020-03-02 00:20:00 NaN NaN 270
## 6 JFK 2020-03-02 00:25:00 NaN NaN 270
## Wind.Speed year mon day hour min sec
## 1 5.658436 2020 3 2 0 0 0
## 2 5.658436 2020 3 2 0 5 0
## 3 5.658436 2020 3 2 0 10 0
## 4 4.629630 2020 3 2 0 15 0
## 5 4.115226 2020 3 2 0 20 0
## 6 4.629630 2020 3 2 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.000 | 1.365 | 1.058 |
2 | WRF D-1 | 0.312 | 0.977 | 0.679 |
3 | WRF D-2 | 0.352 | 1.294 | 0.974 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -0.915 | 2.230 | 1.667 |
2 | WRF D-1 | -1.559 | 2.373 | 1.808 |
3 | WRF D-2 | -1.595 | 2.353 | 1.802 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 28.878 | 20.575 |
2 | WRF D-1 | 37.086 | 27.049 |
3 | WRF D-2 | 40.537 | 32.745 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 0.089 | 1.338 | 1.060 |
2 | WRF D-1 | -1.134 | 1.568 | 1.289 |
3 | WRF D-2 | -0.536 | 1.696 | 1.373 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -1.719 | 2.082 | 1.887 |
2 | WRF D-1 | -2.118 | 2.459 | 2.242 |
3 | WRF D-2 | -1.983 | 2.391 | 2.151 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 35.464 | 23.010 |
2 | WRF D-1 | 51.938 | 39.425 |
3 | WRF D-2 | 51.286 | 40.253 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 0.283 | 1.360 | 1.051 |
2 | WRF D-1 | -1.185 | 1.731 | 1.329 |
3 | WRF D-2 | -0.223 | 2.271 | 1.919 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -1.824 | 2.083 | 1.856 |
2 | WRF D-1 | -1.968 | 2.204 | 2.002 |
3 | WRF D-2 | -1.914 | 2.176 | 1.961 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 39.643 | 20.491 |
2 | WRF D-1 | 48.649 | 26.385 |
3 | WRF D-2 | 41.150 | 25.615 |