reVX.least_cost_xmission.trans_cap_costs.TransCapCosts
- class TransCapCosts(cost_fpath, sc_point, features, capacity_class, radius=None, xmission_config=None, barrier_mult=100)[source]
Bases:
TieLineCosts
Compute total transmission capital cost (least-cost tie-line cost + connection cost) for all features to be connected a single supply curve point
- Parameters:
cost_fpath (str) – Full path of .h5 file with cost arrays
sc_point (gpd.GeoSeries) – Supply Curve Point meta data
features (pandas.DataFrame) – Table of transmission features
capacity_class (int | str) – Transmission feature capacity_class class
radius (int, optional) – Radius around sc_point to clip cost to, by default None
xmission_config (str | dict | XmissionConfig, optional) – Path to Xmission config .json, dictionary of Xmission config .jsons, or preloaded XmissionConfig objects, by default None
barrier_mult (int, optional) – Multiplier on transmission barrier costs, by default 100
Methods
compute
([min_line_length, save_paths, ...])Compute Transmission capital cost of connecting SC point to transmission features.
compute_connection_costs
([features])Calculate connection costs for tie lines
compute_tie_line_costs
([min_line_length, ...])Compute least cost path and distance between supply curve point and every transmission feature
least_cost_path
(end_idx[, save_path])Find least cost path, its length, and its total (un-barriered) cost
run
(cost_fpath, sc_point, features, ...[, ...])Compute Transmission capital cost of connecting SC point to transmission features.
Attributes
SC point capacity class
Polygon used to clip transmission lines to the clipped raster bounds
Shaped of clipped cost raster
Column index inside clipped array
Offset to apply to column indices to move into clipped array
Tie line costs array
Table of transmission features
MCP_Geometric instance initialized on mcp_cost array with starting point at sc_point
Tie line costs array with barrier costs applied for MCP analysis
Row index inside clipped array
Offset to apply to row indices to move into clipped array
Supply curve point data: - gid - lat - lon - idx (row, col)
Supply curve point gid
Tie line voltage in kV
- property sc_point
Supply curve point data: - gid - lat - lon - idx (row, col)
- Returns:
pandas.Series
- property sc_point_gid
Supply curve point gid
- Returns:
int
- property features
Table of transmission features
- Returns:
pandas.DataFrame
- property clip_mask
Polygon used to clip transmission lines to the clipped raster bounds
- Returns:
shapely.Polygon
- property tie_line_voltage
Tie line voltage in kV
- Returns:
int
- compute_tie_line_costs(min_line_length=5.7, save_paths=False)[source]
Compute least cost path and distance between supply curve point and every transmission feature
- Parameters:
min_line_length (float, optional) – Minimum line length in km, by default 5.7
save_paths (bool, optional) – Flag to save least cost path as a multi-line geometry, by default False
- Returns:
tie_line_costs (gpd.GeoDataFrame) – Updated table of transmission features with the tie-line cost and distance added
- compute_connection_costs(features=None)[source]
Calculate connection costs for tie lines
- Returns:
features (pd.DataFrame) – Updated table of transmission features with the connection costs added
- compute(min_line_length=5.7, save_paths=False, simplify_geo=None)[source]
Compute Transmission capital cost of connecting SC point to transmission features. trans_cap_cost = tie_line_cost + connection_cost
- Parameters:
min_line_length (float, optional) – Minimum line length in km, by default 5.7
save_paths (bool, optional) – Flag to save least cost path as a multi-line geometry, by default False
simplify_geo (float | None, optional) – If float, simplify geometries using this value
- Returns:
features (pd.DataFrame | gpd.GeoDataFrame) – Transmission table with tie-line costs and distances and connection costs added. Includes paths if
save_paths == True
- classmethod run(cost_fpath, sc_point, features, capacity_class, radius=None, xmission_config=None, barrier_mult=100, min_line_length=5.7, save_paths=False, simplify_geo=None)[source]
Compute Transmission capital cost of connecting SC point to transmission features. trans_cap_cost = tie_line_cost + connection_cost
- Parameters:
cost_fpath (str) – Full path of .h5 file with cost arrays
sc_point (gpd.GeoSeries) – Supply Curve Point meta data
features (pandas.DataFrame) – Table of transmission features
capacity_class (int | str) – Transmission feature capacity_class class
radius (int, optional) – Radius around sc_point to clip cost to, by default None
xmission_config (str | dict | XmissionConfig, optional) – Path to Xmission config .json, dictionary of Xmission config .jsons, or preloaded XmissionConfig objects, by default None
barrier_mult (int, optional) – Multiplier on transmission barrier costs, by default 100
min_line_length (float, optional) – Minimum line length in km, by default 5.7
save_paths (bool, optional) – Flag to save least cost path as a multi-line geometry, by default False
simplify_geo (float | None, optional) – If float, simplify geometries using this value
- Returns:
features (pd.DataFrame | gpd.GeoDataFrame | None) – Transmission table with tie-line costs and distances and connection costs added. Will include paths if
save_paths == True
- property capacity_class
SC point capacity class
- Returns:
str
- property clip_shape
Shaped of clipped cost raster
- Returns:
tuple
- property col
Column index inside clipped array
- Returns:
int
- property col_offset
Offset to apply to column indices to move into clipped array
- Returns:
int
- property cost
Tie line costs array
- Returns:
ndarray
- least_cost_path(end_idx, save_path=False)
Find least cost path, its length, and its total (un-barriered) cost
- Parameters:
end_idx (Tuple[int, int]) – (row, col) index of end point to connect and compute least cost path to.
save_path (bool) – Flag to save least cost path as a multi-line geometry. By default,
False
.
- Returns:
length (float) – Length of path (km).
cost (float) – Cost of path including terrain and land use multipliers, but not barrier costs.
poi_lat, poi_lon (numpy.float64) – Latitude and longitude of the end_idx of the least cost path (i.e. the POI/transmission feature that was connected to).
path (shapely.geometry.linestring, optional) – Path as a LineString, if save_path was set to
True
.
- property mcp
MCP_Geometric instance initialized on mcp_cost array with starting point at sc_point
- Returns:
MCP_Geometric
- property mcp_cost
Tie line costs array with barrier costs applied for MCP analysis
- Returns:
ndarray
- property row
Row index inside clipped array
- Returns:
int
- property row_offset
Offset to apply to row indices to move into clipped array
- Returns:
int