% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_phenological_doys.R
\name{get_phenology_doys}
\alias{get_phenology_doys}
\title{Compute CTRL and SCEN Phenology Day-of-Year Values}
\usage{
get_phenology_doys(
  pep,
  phase1,
  phase2,
  genus_name,
  phenology_method = c("robust_shift", "simple_shift", "gdd_cmip6"),
  ctrl_years = 2011:2021,
  scen_years = 2085:2095,
  calib_years = 1991:2020,
  scen_warming = 3,
  shift_per_deg = -4,
  cmip6_tas = NULL,
  gdd_base = 5,
  gdd_threshold1 = 150,
  gdd_threshold2 = 350,
  regions = NULL,
  delta_Tgl = 2.09,
  giss_data = NULL
)
}
\arguments{
\item{pep}{A data frame containing PEP725 phenology observations, including
columns \code{country}, \code{day}, \code{year}, \code{phase_id}, and \code{genus}.}

\item{phase1}{Integer. First phenophase (e.g. 65).}

\item{phase2}{Integer. Second phenophase (e.g. 87).}

\item{genus_name}{Character. Genus to filter (e.g. "Malus").}

\item{phenology_method}{Either \code{"simple_shift"} or \code{"gdd_cmip6"}.}

\item{ctrl_years}{Integer vector. Years for CTRL period (default 2011:2021).}

\item{scen_years}{Integer vector. Years for scenario period (default 2085:2095).}

\item{calib_years}{Integer vector. Years for calibration period (default 1991:2020).}

\item{scen_warming}{Numeric. Warming in degC (simple shift model).}

\item{shift_per_deg}{Numeric. DOY shift per degC (simple shift).}

\item{cmip6_tas}{Optional list of daily temperature vectors--only required
if using \code{"gdd_cmip6"}.}

\item{gdd_base}{Numeric. Base temperature for GDD model.}

\item{gdd_threshold1}{Numeric. GDD threshold for phase1.}

\item{gdd_threshold2}{Numeric. GDD threshold for phase2.}

\item{regions}{Character vector. Countries/regions to include. If NULL, all are used.}

\item{delta_Tgl}{Numeric. Global temperature change (degC) for scenario.}

\item{giss_data}{Data frame with GISS temperature data (columns: \code{year},
\code{dT} or \code{Tgl}). Required for robust_shift method.}
}
\value{
A data frame containing:
\item{Country}{Country name}
\item{doy_start_ctrl}{Start DOY for CTRL period}
\item{doy_end_ctrl}{End DOY for CTRL period}
\item{doy_start_scen}{Start DOY for SCEN period}
\item{doy_end_scen}{End DOY for SCEN period}
}
\description{
This function computes the mean phenological day-of-year (DOY) for two
phenophases (e.g. BBCH 65 and 87) for each country, using either a simple
warming-shift model or a GDD-based model.
}
\examples{
\donttest{
pep <- pep_download()

# Use Alpine subset for faster computation
regions <- c("Austria", "Switzerland")
pep_alpine <- pep[country \%in\% regions]

# Simple shift method
d1 <- get_phenology_doys(
  pep = pep_alpine,
  phase1 = 65,
  phase2 = 87,
  genus_name = "Malus",
  regions = regions,
  phenology_method = 'simple_shift'
)
d1
}

}
\author{
Matthias Templ
}
