easy_vic_build.tools.mete_func.build_MeteForcing_interface

Build meteorological forcing NetCDF files from gridded time series.

Classes

buildMeteForcing_interface(evb_dir, logger, ...)

Interface for building yearly VIC meteorological forcing files.

class easy_vic_build.tools.mete_func.build_MeteForcing_interface.buildMeteForcing_interface(evb_dir, logger, dpc_VIC_level2, date_period_process, date_period_forcing, date_format='%Y%m%d', timestep='D', reverse_lat=True, stand_grids_lat_level2=None, stand_grids_lon_level2=None, rows_index_level2=None, cols_index_level2=None, file_format='NETCDF4')[source]

Bases: object

Interface for building yearly VIC meteorological forcing files.

Initialize the forcing builder.

Parameters:
  • evb_dir (object) – Directory/config object that provides output paths and filename prefix.

  • logger (object) – Logger instance used for progress messages.

  • dpc_VIC_level2 (object) – Data-processing container that stores level-2 basin grid data.

  • date_period_process (sequence of str) – Start and end date strings for files to be generated.

  • date_period_forcing (sequence of str) – Start and end date strings of available forcing time series.

  • date_format (str, optional) – Date parsing format used by datetime.strptime.

  • timestep (str, optional) – Pandas frequency string used to build the time axis.

  • reverse_lat (bool, optional) – Whether latitude is stored in reverse order.

  • stand_grids_lat_level2 (array-like, optional) – Standard latitude coordinate array.

  • stand_grids_lon_level2 (array-like, optional) – Standard longitude coordinate array.

  • rows_index_level2 (array-like, optional) – Row indices mapping each basin grid to standard grid.

  • cols_index_level2 (array-like, optional) – Column indices mapping each basin grid to standard grid.

  • file_format (str, optional) – NetCDF output format.

__init__(evb_dir, logger, dpc_VIC_level2, date_period_process, date_period_forcing, date_format='%Y%m%d', timestep='D', reverse_lat=True, stand_grids_lat_level2=None, stand_grids_lon_level2=None, rows_index_level2=None, cols_index_level2=None, file_format='NETCDF4')[source]

Initialize the forcing builder.

Parameters:
  • evb_dir (object) – Directory/config object that provides output paths and filename prefix.

  • logger (object) – Logger instance used for progress messages.

  • dpc_VIC_level2 (object) – Data-processing container that stores level-2 basin grid data.

  • date_period_process (sequence of str) – Start and end date strings for files to be generated.

  • date_period_forcing (sequence of str) – Start and end date strings of available forcing time series.

  • date_format (str, optional) – Date parsing format used by datetime.strptime.

  • timestep (str, optional) – Pandas frequency string used to build the time axis.

  • reverse_lat (bool, optional) – Whether latitude is stored in reverse order.

  • stand_grids_lat_level2 (array-like, optional) – Standard latitude coordinate array.

  • stand_grids_lon_level2 (array-like, optional) – Standard longitude coordinate array.

  • rows_index_level2 (array-like, optional) – Row indices mapping each basin grid to standard grid.

  • cols_index_level2 (array-like, optional) – Column indices mapping each basin grid to standard grid.

  • file_format (str, optional) – NetCDF output format.

static generate_cftime_dates(d)[source]

Convert one pandas datetime value to cftime.datetime.

Parameters:

d (pandas.Timestamp) – Datetime value to be converted.

Returns:

Converted datetime in proleptic Gregorian calendar.

Return type:

cftime.datetime

buildMeteForcing_loop_years()[source]

Build forcing files year by year for the configured period.

set_vars_names_map()[source]

Set mapping from output variable names to source column names.

set_date_period()[source]

Prepare datetime indices for process period and forcing period.

set_coord_map()[source]

Prepare standard coordinates and index mapping for level-2 grids.

set_var_value(grid_shp_column, var_name)[source]

Write one variable from source grid series into the output dataset.

Parameters:
  • grid_shp_column (str) – Source column name in level-2 grid shapefile data.

  • var_name (str) – Target variable name in meteorological forcing dataset.