dapper.ERA5Adapter¶
- class dapper.ERA5Adapter[source]¶
Bases:
BaseAdapterERA5-Land hourly → ELM adapter.
Handles ERA5-specific file discovery, unit conversions, humidity diagnostics, renaming to ELM short names, and nonnegativity so the
Exporterstays source-agnostic.preprocess_shardsteps:keep rows from Jan 1 of
start_yearthrough Jan 1 00:00 ofend_year + 1(a one-hour lookahead for end-labeled fluxes); Feb 29 is kept here and dropped later during temporal alignmentunit conversions: J/m² per hour → W/m² (÷3600), m/hr → mm/s (÷3.6), wind speed from u/v
RH and specific humidity when temperature, dewpoint, and surface pressure are all present
rename to ELM short names via
dapper.config.metsources.era5.RAW_TO_ELMclip canonical nonnegative variables at 0
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.- __init__()¶
Methods
__init__()discover_files(csv_directory, calendar, *[, ...])Discover ERA5 CSV shards in a directory and infer the inclusive year range.
id_column_for_csv(df_csv, id_col)Return the identifier column name expected in ERA5 CSV shards ("gid").
normalize_locations(df_loc[, id_col])Standardize df_loc to include ['gid','lat','lon','lon_0-360','zone'], sorted by (lat, lon).
pack_params(elm_var[, data])Return (add_offset, scale_factor) used to pack a variable for NetCDF output.
preprocess_shard(df_merged, start_year, ...)Convert one merged CSV shard to canonical ELM columns (see class docstring).
required_vars(dformat)Return the canonical ELM variables required for the requested output format.
temporal_metadata([options])NetCDF provenance for ERA5-Land interval alignment.
temporal_options(df, *, start_year, ...)Describe how GEE's ERA5-Land hourly fields are time-labeled.
Attributes
- 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
gidand 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).