reV.supply_curve.sc_aggregation.SupplyCurveAggFileHandler
- class SupplyCurveAggFileHandler(excl_fpath, gen_fpath, econ_fpath=None, data_layers=None, power_density=None, excl_dict=None, friction_fpath=None, friction_dset=None, area_filter_kernel='queen', min_area=None)[source]
Bases:
AbstractAggFileHandler
Framework to handle aggregation summary context managers: - exclusions .h5 file - generation .h5 file - econ .h5 file (optional) - friction surface .h5 file (optional) - variable power density .csv (optional)
- Parameters:
excl_fpath (str | list | tuple) – Filepath to exclusions h5 with techmap dataset (can be one or more filepaths).
gen_fpath (str) – Filepath to .h5 reV generation output results.
econ_fpath (str | None) – Filepath to .h5 reV econ output results. This is optional and only used if the lcoe_dset is not present in the gen_fpath file.
data_layers (None | dict) – Aggregation data layers. Must be a dictionary keyed by data label name. Each value must be another dictionary with “dset”, “method”, and “fpath”.
power_density (float | str | None) – Power density in MW/km2 or filepath to variable power density file. None will attempt to infer a constant power density from the generation meta data technology. Variable power density csvs must have “gid” and “power_density” columns where gid is the resource gid (typically wtk or nsrdb gid) and the power_density column is in MW/km2.
excl_dict (dict | None) – Dictionary of exclusion keyword arugments of the format {layer_dset_name: {kwarg: value}} where layer_dset_name is a dataset in the exclusion h5 file and kwarg is a keyword argument to the reV.supply_curve.exclusions.LayerMask class.
friction_fpath (str | None) – Filepath to friction surface data (cost based exclusions). Must be paired with friction_dset. The friction data must be the same shape as the exclusions. Friction input creates a new output “mean_lcoe_friction” which is the nominal LCOE multiplied by the friction data.
friction_dset (str | None) – Dataset name in friction_fpath for the friction surface data. Must be paired with friction_fpath. Must be same shape as exclusions.
area_filter_kernel (str) – Contiguous area filter method to use on final exclusions mask
min_area (float | None) – Minimum required contiguous area filter in sq-km
Methods
close
()Close all file handlers.
Attributes
Get the data layers object.
Get the exclusions file handler object.
Get the friction layer (cost based exclusions).
Get the gen file handler object.
Placeholder for h5 Resource handler
Get the power density object.
- property gen
Get the gen file handler object.
- Returns:
_gen (Outputs) – reV gen outputs handler object.
- property data_layers
Get the data layers object.
- Returns:
_data_layers (dict) – Data layers namespace.
- property power_density
Get the power density object.
- Returns:
_power_density (float | None | pd.DataFrame) – Constant power density float, None, or opened dataframe with (resource) “gid” and “power_density columns”.
- property friction_layer
Get the friction layer (cost based exclusions).
- Returns:
friction_layer (None | FrictionMask) – Friction layer with scalar friction values if valid friction inputs were entered. Otherwise, None to not apply friction layer.
- property exclusions
Get the exclusions file handler object.
- Returns:
_excl (ExclusionMask) – Exclusions h5 handler object.
- property h5
Placeholder for h5 Resource handler