reVX.utilities.reeds_cols.add_reeds_columns

add_reeds_columns(supply_curve_fpath, out_fp=None, capacity_col='capacity', extra_data=None, merge_col='sc_point_gid', filter_out_zero_capacity=True, rename_mapping=None, regions='https://www2.census.gov/geo/tiger/TIGER2021/COUNTY/tl_2021_us_county.zip')[source]

Add columns to supply curve required by ReEDS.

This method will add columns like “cnty_fips”, “state”, “county”, “nrel_region”, “eos_mult”, and “reg_mult”. This method also allows you to add extra columns from H5 or JSON files.

Parameters:
  • supply_curve_fpath (str) – Path to input supply curve. Should have standard reV supply curve output columns (e.g. latitude, longitude, capacity, sc_point_gid, etc.). If running from CLI, this can be a list of supply curve paths.

  • out_fp (str, optional) – Path to output file for supply curve with new columns. If None, the supply curve will be overwritten (i.e. the data will be written to supply_curve_fpath). If running from CLI, this can be a list output paths (length must match length of supply_curve_fpath). By default, None.

  • capacity_col (str, optional) – Name of capacity column. This is used to filter out sites with zero capacity, if that option is selected. By default, "capacity".

  • extra_data (list of dicts, optional) – A list of dictionaries, where each dictionary contains two keys. The first key is “source”, and its value must either be a dictionary of field: value pairs or a path to the extra data being extracted. The latter must be a path pointing to an HDF5 or JSON file (i.e. it must end in “.h5” or “.json”). The second key is “dsets”, and it points to a list of dataset names to extract from source. For JSON and dictionary data extraction, the values of the datasets must either be scalars or must match the length of the input data_frame. For HDF5 data, the datasets must be 1D datasets, and they will be merged with the input data_frame on merge_col (column must be in the HDF5 file meta). By default, None.

  • merge_col (str, optional) – Name of column used to merge the data in the input supply curve with the data in the HDF5 file if extra_data is specified. Note that this column must be present in both the input supply curve as well as the HDF5 file meta. By default, "sc_point_gid".

  • filter_out_zero_capacity (bool, optional) – Flag to filter out sites with zero capacity. By default, True.

  • rename_mapping (dict, optional) – Optional mapping of old column names to new column names. This mapping will be used to rename the columns in the supply curve towards the end of the procedure (after all extra columns except eos_mult and reg_mult have been added). By default, None (no renaming).

  • regions (str, optional) – Path to a regions shapefile containing county geometries labeled with county FIPS values. Default value pulls the data from www2.census.gov.

Returns:

out_fpath (str) – Path to output file.