LTER-LIFE / VeluweProtoDT

Veluwe proto-DT: a digital mini twin of tree phenology and climate scenarios
0 stars 0 forks source link

Write script for running climate window analysis (climwin) #27

Closed StefanVriend closed 10 months ago

StefanVriend commented 10 months ago

Write script to run a {climwin} model (cq. Bailey & van de Pol 2016) using the bud burst and temperature data.

{climwin} allows users to run two types of analysis:

We only explore the absolute analysis.

StefanVriend commented 10 months ago

{climwin} has elaborate documentation but sometimes the error messages are rather opaque.

Error: You do not have enough climate data to search 183 days before 1988-04-28. Please adjust the value of range or add additional climate data. 

This error message seems incorrect. In this case, we run a model of the 'absolute' type with a reference date of 31st of May. However, the message suggests that the analysis was of the 'relative' type (as it refers to the earliest biological date and not the reference date).

Error: Climate data should not contain NA values: 3828 NA value(s) found. Please add missing climate data or set cmissing to `method1` or `method2`. See object 'missing' for all missing climate data.

This error message is rather opaque. It suggests that there are missing values in the climate/temperature data. When looking at the missing R object, it produces dates that we did not include in our climate data on purpose (i.e., we were only interested in finding a window between 1 December and 31 May, but missing included dates in June, July, etc.). However, there actually were missing values in our selected period (as a result of the EDR API failing sometimes, see #2 or #25), and that is what caused this error.

CherineJ commented 10 months ago

With the complete temperature data, the reference day of the 31 of May and a possible range of windows from 181 to 0 days before the reference day, all abovementioned errors are solved and the climwin analysis runs.