The primary objective of this package is to improve the utility of ERA5-Land data at AmeriFlux site locations. This package comprises of a collection of tools useful for workflows involving ERA5-Land and AmeriFlux data. It includes functions for downloading ERA5-Land data based on AmeriFlux sites, formatting the downloaded data to match AmeriFlux standards, merging both datasets together to ensure consistent timestamps, and blending them to create a single gap-filled time series.
Installation
You can install the development version of ERA5Flux from GitHub with:
# install.packages("pak")
pak::pak("Malone-Disturbance-Ecology-Lab/ERA5Flux")Or download from CRAN with:
install.packages("ERA5Flux")Function Overview
Main Workflow
utc_offset(): produces an hour offset number converting local to UTC, where offset is the difference between UTC and local time without considering Daylight Saving Timeget_site_metadata(): builds an AmeriFlux site metadata data frameget_land_sea_mask(): downloads the netCDF land-sea mask from ERA5-Landget_land_proportion(): returns land proportion given a latitude and longitudedownload_ERA5(): downloads ERA5-Land data for each site specified in the AmeriFlux site metadata data framenetcdf_df_formatter(): reformats ERA5-Land .nc data into a data framenetcdf_to_csv(): takes a directory of ERA5-Land .nc data as an argument and exports the data in CSV formatmerge_ERA5_Flux(): merges data from AmeriFlux and data from ERA5-Land, ensuring they both have the same start and end timestampsblend_ERA5_Flux(): blends data from AmeriFlux and data from ERA5-Land, ensuring they both have the same start and end timestamps
Other Functions
check_DST(): checks if a given time point is in Daylight Saving Time (DST) and if so, it will adjust the time to the standard (non-DST) timedate_conversion(): produces a converted time, either UTC -> local, or local -> UTCday_padding(): pads 1 day for the beginning and ending days, adding 1 day to start and end dates for future time zone offset issues