Skip to contents

The primary objective of this package is to improve the utility of ERA5 data at AmeriFlux site locations. This package comprises of a collection of tools useful for workflows involving ERA5 and AmeriFlux data. It includes functions for downloading ERA5 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")

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 Time

  • get_site_metadata(): builds an AmeriFlux site metadata file

  • get_land_sea_mask(): downloads the netCDF land-sea mask from ERA5

  • get_land_proportion(): returns land proportion given a latitude and longitude

  • download_ERA5(): downloads ERA5 data for each site specified in the AmeriFlux site metadata data frame

  • netcdf_df_formatter(): reformats ERA5 .nc data into a data frame

  • netcdf_to_csv(): takes a directory of ERA5 .nc data as an argument and exports the data in CSV format

  • merge_ERA5_Flux(): merges data from AmeriFlux and data from ERA5, ensuring they both have the same start and end timestamps

  • blend_ERA5_Flux(): blends data from AmeriFlux and data from ERA5, 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) time

  • date_conversion(): produces a converted time, either UTC -> local, or local -> UTC

  • day_padding(): pads 1 day for the beginning and ending days, adding 1 day to start and end dates for future time zone offset issues