pydaymet.core
#
Core class for the Daymet functions.
Module Contents#
- class pydaymet.core.Daymet(variables=None, pet=None, snow=False, time_scale='daily', region='na')#
Base class for Daymet requests.
- Parameters:
variables (
str
orlist
ortuple
, optional) – List of variables to be downloaded. The acceptable variables are:tmin
,tmax
,prcp
,srad
,vp
,swe
,dayl
Descriptions can be found here. Defaults to None i.e., all the variables are downloaded.pet (
str
, optional) – Method for computing PET. Supported methods arepenman_monteith
,priestley_taylor
,hargreaves_samani
, and None (don’t compute PET). Thepenman_monteith
method is based on Allen et al.[1] assuming that soil heat flux density is zero. Thepriestley_taylor
method is based on Priestley and TAYLOR[2] assuming that soil heat flux density is zero. Thehargreaves_samani
method is based on Hargreaves and Samani[3]. Defaults toNone
.snow (
bool
, optional) – Compute snowfall from precipitation and minimum temperature. Defaults toFalse
.time_scale (
str
, optional) – Data time scale which can be daily, monthly (monthly summaries), or annual (annual summaries). Defaults to daily.region (
str
, optional) – Region in the US, defaults to na. Acceptable values are:na: Continental North America
hi: Hawaii
pr: Puerto Rico
References
- static check_dates(dates)#
Check if input dates are in correct format and valid.
- dates_todict(dates)#
Set dates by start and end dates as a tuple, (start, end).
- dates_tolist(dates)#
Correct dates for Daymet accounting for leap years.
Daymet doesn’t account for leap years and removes Dec 31 when it’s leap year.
- separate_snow(clm, t_rain=T_RAIN, t_snow=T_SNOW)#
Separate snow based on Martinez and Gupta[4].
- Parameters:
clm (
pandas.DataFrame
orxarray.Dataset
) – Climate data that should includeprcp
andtmin
.t_rain (
float
, optional) – Threshold for temperature for considering rain, defaults to 2.5 degrees C.t_snow (
float
, optional) – Threshold for temperature for considering snow, defaults to 0.6 degrees C.
- Returns:
pandas.DataFrame
orxarray.Dataset
– Input data withsnow (mm/day)
column if input is apandas.DataFrame
, orsnow
variable if input is anxarray.Dataset
.
References
- years_todict(years)#
Set date by list of year(s).