% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pheno_regional_hh.R
\name{pheno_regional_hh}
\alias{pheno_regional_hh}
\title{Compile Regional Phenological Time Series for Heading and Harvest}
\usage{
pheno_regional_hh(
  pep,
  giss = NULL,
  lon_min = 4.2,
  lon_max = 8.1,
  lat_min = 44.7,
  lat_max = 48.1,
  species_name = "Triticum aestivum",
  year_min = 1961,
  pep_for_giss = c("aggregated", "near")
)
}
\arguments{
\item{pep}{A data.table containing PEP725 phenological data.}

\item{giss}{Optional. A data.table with GISS global temperature anomalies
(\code{year}, \code{dT}, \code{dT_sm}). If \code{NULL}, GISS-related
outputs are omitted.}

\item{lon_min}{Minimum longitude for bounding box filter (default is 4.2)}

\item{lon_max}{Maximum longitude for bounding box filter (default is 8.1)}

\item{lat_min}{Minimum latitude for bounding box filter (default is 44.7)}

\item{lat_max}{Maximum latitude for bounding box filter (default is 48.1)}

\item{species_name}{Name of the species to filter (default is
\code{"Triticum aestivum"})}

\item{year_min}{Minimum year for all time series outputs (default is 1961)}

\item{pep_for_giss}{Which PEP725 dataset to use for merging with GISS climate
anomalies. Either \code{"aggregated"} (global) or \code{"near"} (spatially
filtered). Ignored if \code{giss} is \code{NULL}.}
}
\value{
A named list with the following elements:
\describe{
\item{\code{ts_tidy}}{Long-format time series with consistent phase and source labeling}
\item{\code{pep_agg}}{Aggregated PEP725 time series (global species-level)}
\item{\code{pep_cgi}}{Spatially filtered PEP725 time series (based on
lat/lon box)}
\item{\code{giss}}{GISS global temperature anomalies (if provided)}
\item{\code{pep_giss}}{PEP time series merged with GISS anomalies (if provided)}
\item{\code{species}}{Species name used for filtering}
}
}
\description{
Generates harmonized phenological time series for heading (BBCH 60) and
harvest (BBCH 100) phases of a specified species and spatial region.
Optionally integrates GISS climate data for climate-sensitivity studies.
}
\details{
This function filters the PEP725 dataset by species and optionally by spatial
box. It aggregates phenological phases (Heading = 60, Harvest = 100) and
computes mean day-of-year (DOY) per year. If GISS data is provided,
temperature anomalies are merged with the selected PEP time series to support
phenology-climate analysis. Warnings are issued if phases are missing for
selected periods.
}
\examples{
\donttest{
pep <- pep_download()

out <- pheno_regional_hh(pep,
         species_name = "Triticum aestivum")
pheno_plot_hh(out)
}
}
\seealso{
\code{\link{pep_import}}, \code{\link{pheno_plot_hh}}
}
\author{
Matthias Templ
}
