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-03-23 00:00:05 2020 3 23 0 0 5.0004 276.4862 0.00313
## 2 2020-03-23 00:00:10 2020 3 23 0 0 10.0008 276.5794 0.00313
## 3 2020-03-23 00:00:15 2020 3 23 0 0 15.0012 276.6618 0.00313
## 4 2020-03-23 00:00:20 2020 3 23 0 0 20.0016 276.7345 0.00314
## 5 2020-03-23 00:00:24 2020 3 23 0 0 24.9984 276.7975 0.00314
## 6 2020-03-23 00:00:29 2020 3 23 0 0 29.9988 276.8546 0.00314
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -4.74603 2.71537 5.467910 119.7754 JFK
## 2 -4.62852 2.63980 5.328390 119.6976 JFK
## 3 -4.54188 2.58068 5.223848 119.6051 JFK
## 4 -4.45942 2.52421 5.124262 119.5116 JFK
## 5 -4.38091 2.46790 5.028211 119.3939 JFK
## 6 -4.30723 2.41769 4.939378 119.3059 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-03-22 00:00:05 2020 3 22 0 0 5.0004 280.9452 0.00322
## 2 2020-03-22 00:00:10 2020 3 22 0 0 10.0008 280.9665 0.00322
## 3 2020-03-22 00:00:15 2020 3 22 0 0 15.0012 280.9866 0.00322
## 4 2020-03-22 00:00:20 2020 3 22 0 0 20.0016 281.0061 0.00323
## 5 2020-03-22 00:00:24 2020 3 22 0 0 24.9984 281.0251 0.00323
## 6 2020-03-22 00:00:29 2020 3 22 0 0 29.9988 281.0446 0.00323
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -0.74185 -0.88287 1.153170 40.03936 JFK
## 2 -0.73771 -0.86946 1.140253 40.31358 JFK
## 3 -0.73021 -0.85208 1.122162 40.59570 JFK
## 4 -0.72304 -0.84176 1.109661 40.66133 JFK
## 5 -0.72123 -0.83101 1.100341 40.95457 JFK
## 6 -0.70656 -0.82398 1.085435 40.61297 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-03-21 00:00:05 2020 3 21 0 0 5.0004 282.2782 0.00637
## 2 2020-03-21 00:00:10 2020 3 21 0 0 10.0008 282.2890 0.00637
## 3 2020-03-21 00:00:15 2020 3 21 0 0 15.0012 282.2994 0.00637
## 4 2020-03-21 00:00:20 2020 3 21 0 0 20.0016 282.3095 0.00637
## 5 2020-03-21 00:00:24 2020 3 21 0 0 24.9984 282.3202 0.00638
## 6 2020-03-21 00:00:29 2020 3 21 0 0 29.9988 282.3323 0.00638
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -0.48246 0.00766 0.4825208 90.90961 JFK
## 2 -0.48280 0.00671 0.4828466 90.79625 JFK
## 3 -0.48615 0.01237 0.4863074 91.45757 JFK
## 4 -0.47869 0.00569 0.4787238 90.68102 JFK
## 5 -0.47714 0.00274 0.4771479 90.32902 JFK
## 6 -0.47076 0.00563 0.4707937 90.68519 JFK
## Station Date.Time Temperature Relative.Humidity Wind.Direction
## 1 JFK 2020-03-22 00:00:00 NaN NaN 30
## 2 JFK 2020-03-22 00:05:00 NaN NaN 30
## 3 JFK 2020-03-22 00:10:00 NaN NaN 30
## 4 JFK 2020-03-22 00:15:00 NaN NaN 30
## 5 JFK 2020-03-22 00:20:00 NaN NaN 30
## 6 JFK 2020-03-22 00:25:00 NaN NaN 10
## Wind.Speed year mon day hour min sec
## 1 2.572016 2020 3 22 0 0 0
## 2 4.115226 2020 3 22 0 5 0
## 3 4.629630 2020 3 22 0 10 0
## 4 3.600823 2020 3 22 0 15 0
## 5 4.115226 2020 3 22 0 20 0
## 6 2.572016 2020 3 22 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.788 | 0.989 | 0.807 |
2 | WRF D-1 | 0.455 | 0.802 | 0.616 |
3 | WRF D-2 | -2.463 | 3.134 | 2.638 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -3.258 | 3.573 | 3.269 |
2 | WRF D-1 | -2.492 | 2.839 | 2.577 |
3 | WRF D-2 | -4.134 | 4.381 | 4.134 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 17.314 | 10.647 |
2 | WRF D-1 | 20.655 | 14.776 |
3 | WRF D-2 | 57.121 | 52.315 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 0.652 | 1.071 | 0.875 |
2 | WRF D-1 | 0.518 | 1.138 | 0.910 |
3 | WRF D-2 | -1.851 | 2.398 | 1.928 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -4.299 | 4.429 | 4.299 |
2 | WRF D-1 | -3.986 | 4.157 | 3.986 |
3 | WRF D-2 | -4.009 | 4.161 | 4.009 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 25.044 | 19.210 |
2 | WRF D-1 | 32.124 | 27.022 |
3 | WRF D-2 | 67.243 | 55.429 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 1.324 | 1.504 | 1.324 |
2 | WRF D-1 | 0.974 | 1.413 | 1.144 |
3 | WRF D-2 | -1.020 | 1.841 | 1.448 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -3.185 | 3.319 | 3.185 |
2 | WRF D-1 | -3.029 | 3.178 | 3.029 |
3 | WRF D-2 | -3.240 | 3.384 | 3.240 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 31.365 | 23.240 |
2 | WRF D-1 | 33.695 | 26.421 |
3 | WRF D-2 | 60.886 | 42.761 |