dapper.met.adapters.era5

ERA5-Land adapter implementation.

Classes

ERA5Adapter()

ERA5-Land hourly → ELM adapter.

class dapper.met.adapters.era5.ERA5Adapter[source]

Bases: BaseAdapter

ERA5-Land hourly → ELM adapter.

Handles ERA5-specific file discovery, unit conversions, humidity diagnostics, renaming to ELM short names, and nonnegativity so the Exporter stays source-agnostic.

preprocess_shard steps:

  1. keep rows from Jan 1 of start_year through Jan 1 00:00 of end_year + 1 (a one-hour lookahead for end-labeled fluxes); Feb 29 is kept here and dropped later during temporal alignment

  2. unit conversions: J/m² per hour → W/m² (÷3600), m/hr → mm/s (÷3.6), wind speed from u/v

  3. RH and specific humidity when temperature, dewpoint, and surface pressure are all present

  4. rename to ELM short names via dapper.config.metsources.era5.RAW_TO_ELM

  5. clip canonical nonnegative variables at 0

  6. return the format’s required variables plus LONGXY, LATIXY, time, gid, zone, sorted by time and location

Accumulated fields (FSDS, FLDS, PRECTmms) are labeled at interval end; temporal_options() tells the exporter to relabel them to interval start.

DRIVER_TAG = 'ERA5'
GEE_COLLECTION_START = Timestamp('1950-01-01 01:00:00')
INTERVAL_END_VARS = ('FSDS', 'FLDS', 'PRECTmms')
SOURCE_INTERVAL_HOURS = 1.0
SOURCE_NAME = 'ERA5-Land hourly reanalysis'
discover_files(csv_directory, calendar, *, clip_to_full_years=None)[source]

Discover ERA5 CSV shards in a directory and infer the inclusive year range.

id_column_for_csv(df_csv, id_col)[source]

Return the identifier column name expected in ERA5 CSV shards (“gid”).

Deprecated: the Exporter always uses gid and never calls this.

pack_params(elm_var, data=None)[source]

Return (add_offset, scale_factor) used to pack a variable for NetCDF output.

preprocess_shard(df_merged, start_year, end_year, calendar, dformat)[source]

Convert one merged CSV shard to canonical ELM columns (see class docstring).

required_vars(dformat)[source]

Return the canonical ELM variables required for the requested output format.

temporal_metadata(options=None)[source]

NetCDF provenance for ERA5-Land interval alignment.

temporal_options(df, *, start_year, end_year, calendar)[source]

Describe how GEE’s ERA5-Land hourly fields are time-labeled.