Exercise 4: Compute Degree Days for the Entire Season
Summary
In this Notebook, we import the weather data tables we imported in Exercise 2 & 3 for three time periods:
Recent past (Exercise 2)
Short-term forecast (Exercise 3)
Seasonal forecast (Exercise 3):
Open-Meteo’s Seasonal Forecast service
Long-term daily averages from gridMet
We will then:
append the tables together to get a time series for the entire season
compute degrees for the entire season
make predictions about the best time to till to disrupt the life cycle of the three-cornered alfalfa hopper (exercise 1)
compare the predictions for the two proxies for the seasonal forecast
1 Import the individual weather data files
Begin by importing the weather data tables we created in exercises 2 and 3:
1.1 Recent past:
data_dir<-here::here("exercises/data")dir.exists(data_dir)## For the recent past data for CIMIS Station 077, we will use a saved copy of the station## data download using the CIMIS API (see import-data-cimis-api.qmd), ## rather than the copy we imported thru Syntopic,## We do this because there is ~6 week gap in the Synoptic data during Jan & Feb 2024 ## when CIMIS data were not ingested into Synoptic.stn_rctpast_dlytas_tbl<-readRDS(file.path(data_dir, "stn_rctpast_cimis_dlytas_tbl.Rds"))stn_rctpast_dlytas_tbl|>head()stn_rctpast_dlytas_tbl$date|>range()
Note: after combining the tables we convert the period column to a factor with manually specified levels. This is how we control the order of the three periods in the legend in ggplot.
Let’s visualize the difference between accumulated degree days the seasonal forecast vs historic daily averages make in the accumulation of degree days?
Compare the predictions by the seasonal forecast and long-term daily averages regarding when adults are expected (3137-3447 accumulated degree days Fahrenheit). [Solution]
## Your answer here
4 END!
We now have all the code we need to make a Shiny app!