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-29 00:00:05 2020 3 29 0 0 5.0004 281.5700 0.00643
## 2 2020-03-29 00:00:10 2020 3 29 0 0 10.0008 281.6098 0.00644
## 3 2020-03-29 00:00:15 2020 3 29 0 0 15.0012 281.6478 0.00644
## 4 2020-03-29 00:00:20 2020 3 29 0 0 20.0016 281.6833 0.00644
## 5 2020-03-29 00:00:24 2020 3 29 0 0 24.9984 281.7169 0.00644
## 6 2020-03-29 00:00:29 2020 3 29 0 0 29.9988 281.7498 0.00645
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -4.96307 -1.92827 5.324499 68.76768 JFK
## 2 -4.84700 -1.80931 5.173685 69.53018 JFK
## 3 -4.75221 -1.72211 5.054618 70.08045 JFK
## 4 -4.66448 -1.65323 4.948792 70.48416 JFK
## 5 -4.57720 -1.59935 4.848575 70.73973 JFK
## 6 -4.49558 -1.54968 4.755181 70.98032 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-03-28 00:00:05 2020 3 28 0 0 5.0004 284.4556 0.00539
## 2 2020-03-28 00:00:10 2020 3 28 0 0 10.0008 284.5055 0.00539
## 3 2020-03-28 00:00:15 2020 3 28 0 0 15.0012 284.5514 0.00539
## 4 2020-03-28 00:00:20 2020 3 28 0 0 20.0016 284.5932 0.00540
## 5 2020-03-28 00:00:24 2020 3 28 0 0 24.9984 284.6317 0.00540
## 6 2020-03-28 00:00:29 2020 3 28 0 0 29.9988 284.6685 0.00540
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 -0.08000 1.89402 1.895709 177.5814 JFK
## 2 -0.08732 1.85627 1.858323 177.3068 JFK
## 3 -0.09732 1.81876 1.821362 176.9371 JFK
## 4 -0.10869 1.78067 1.783984 176.5071 JFK
## 5 -0.11899 1.75000 1.754041 176.1102 JFK
## 6 -0.11969 1.72665 1.730793 176.0346 JFK
## Date.Time year mon day hour min sec Temperature Mixing.Ratio
## 1 2020-03-27 00:00:05 2020 3 27 0 0 5.0004 280.3574 0.00525
## 2 2020-03-27 00:00:10 2020 3 27 0 0 10.0008 280.4142 0.00525
## 3 2020-03-27 00:00:15 2020 3 27 0 0 15.0012 280.4645 0.00525
## 4 2020-03-27 00:00:20 2020 3 27 0 0 20.0016 280.5093 0.00526
## 5 2020-03-27 00:00:24 2020 3 27 0 0 24.9984 280.5502 0.00526
## 6 2020-03-27 00:00:29 2020 3 27 0 0 29.9988 280.5884 0.00526
## U_WIND V_WIND Wind.Speed Wind.Direction Station
## 1 0.06529 4.98872 4.989147 180.7498 JFK
## 2 0.01592 4.75248 4.752507 180.1919 JFK
## 3 -0.01840 4.57917 4.579207 179.7698 JFK
## 4 -0.04371 4.44076 4.440975 179.4361 JFK
## 5 -0.05924 4.32888 4.329285 179.2160 JFK
## 6 -0.06935 4.23352 4.234088 179.0615 JFK
## Station Date.Time Temperature Relative.Humidity Wind.Direction
## 1 JFK 2020-03-28 00:00:00 NaN NaN 220
## 2 JFK 2020-03-28 00:05:00 NaN NaN 230
## 3 JFK 2020-03-28 00:10:00 NaN NaN 220
## 4 JFK 2020-03-28 00:15:00 NaN NaN 210
## 5 JFK 2020-03-28 00:20:00 NaN NaN 220
## 6 JFK 2020-03-28 00:25:00 NaN NaN 200
## Wind.Speed year mon day hour min sec
## 1 2.572016 2020 3 28 0 0 0
## 2 2.057613 2020 3 28 0 5 0
## 3 2.057613 2020 3 28 0 10 0
## 4 2.057613 2020 3 28 0 15 0
## 5 2.057613 2020 3 28 0 20 0
## 6 2.572016 2020 3 28 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.581 | 1.173 | 0.952 |
2 | WRF D-1 | -0.059 | 0.952 | 0.745 |
3 | WRF D-2 | -1.363 | 2.112 | 1.789 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -1.274 | 2.226 | 1.703 |
2 | WRF D-1 | -0.224 | 1.501 | 1.237 |
3 | WRF D-2 | -0.945 | 2.069 | 1.527 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 34.551 | 29.002 |
2 | WRF D-1 | 39.675 | 34.472 |
3 | WRF D-2 | 41.770 | 38.121 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 1.467 | 1.841 | 1.467 |
2 | WRF D-1 | 1.142 | 1.409 | 1.142 |
3 | WRF D-2 | -0.374 | 1.250 | 1.111 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -6.019 | 6.197 | 6.019 |
2 | WRF D-1 | -5.477 | 5.654 | 5.477 |
3 | WRF D-2 | -6.027 | 6.216 | 6.027 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 15.765 | 12.865 |
2 | WRF D-1 | 22.495 | 19.776 |
3 | WRF D-2 | 28.852 | 24.880 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | 1.467 | 1.787 | 1.478 |
2 | WRF D-1 | 1.095 | 1.266 | 1.095 |
3 | WRF D-2 | -0.306 | 1.357 | 1.254 |
Forecast.Init | BIAS | RMSE | MAE | |
1 | WRF D-0 | -4.583 | 4.747 | 4.583 |
2 | WRF D-1 | -4.355 | 4.525 | 4.355 |
3 | WRF D-2 | -4.538 | 4.707 | 4.538 |
Forecast.Init | RMSE | MAE | |
1 | WRF D-0 | 12.975 | 10.171 |
2 | WRF D-1 | 20.992 | 15.720 |
3 | WRF D-2 | 22.947 | 17.642 |