reVX.plexos.plexos_plants.PlantProfileAggregation
- class PlantProfileAggregation(plexos_table, sc_table, mymean_fpath, cf_fpath, plants=None, dist_percentile=90, dist_thresh_km=None, lcoe_col='total_lcoe', lcoe_thresh=1.3, offshore=False, max_workers=None, plants_per_worker=40, points_per_worker=400, plant_name_col=None, tech_tag=None, dset_tag='', timezone='UTC')[source]
Bases:
object
Aggregate renewable generation profiles to Plexos “plants”
- Parameters:
plexos_table (str | pandas.DataFrame) – PLEXOS table of bus locations and capacity (MW) provided as a .csv, .json, or pandas DataFrame. Needs columns: latitude, longitude, capacity. Note that capacity needs to be AC for wind and DC for solar.
sc_table (str | pandas.DataFrame) – Supply Curve table .csv or pre-loaded pandas DataFrame
mymean_fpath (str) – Path to reV multi-year-mean output .h5 file to pull cf_mean-means from - this will be used to determine where plants are built so it does not differ from year to year. The meta must match cf_fpath.
cf_fpath (str) – Path to reV annual Generation output .h5 file to pull CF profiles from. Meta must match mymean_fpath.
plants (PlexosPlants | None) – Optional PlexosPlants input. If None, PlexosPlants object will be Initialized from the plexos table input.
dist_percentile (int, optional) – Percentile to use to compute distance threshold using sc_gid to SubStation distance , by default 90
lcoe_col (str, optional) – LCOE column to sort by, by default ‘total_lcoe’
lcoe_thresh (float, optional) – LCOE threshold multiplier, exclude sc_gids above threshold, by default 1.3
max_workers (int, optional) – Number of workers to use for point and plant creation, 1 == serial, > 1 == parallel, None == parallel using all available cpus, by default None
points_per_worker (int, optional) – Number of points to create on each worker, by default 400
plants_per_worker (int, optional) – Number of plants to identify on each worker, by default 40
offshore (bool, optional) – Include offshore points, by default False
plant_name_col (str | None) – Column in plexos_table that has the plant name that should be used in the plexos output csv column headers.
tech_tag (str | None) – Optional technology tag to include as a suffix in the plexos output csv column headers.
dset_tag (str) – Dataset tag to append to dataset names in cf profile file. e.g. If the cf profile file is a multi year file using dset_tag=”-2008” will enable us to select the corresponding datasets (cf_mean-2008, cf_profile-2008, etc)
timezone (str) – Timezone for output generation profiles. This is a string that will be passed to pytz.timezone() e.g. US/Pacific, US/Mountain, US/Central, US/Eastern, or UTC. For a list of all available timezones, see pytz.all_timezones
Methods
aggregate
(plexos_table, sc_table, ...[, ...])Aggregate pre-filled plants
aggregate_profiles
(out_fpath)Aggregate plants from capacity factor profiles and save to given output .h5 path
get_gen_gid
(res_gid)Get a generation gid from a resource gid using cf_gid_map.
Create plants meta data from filled plants DataFrames:
run
(plexos_table, sc_table, mymean_fpath, ...)Find, fill, and save profiles for Plants associated with given PLEXOS buses
Attributes
reV generation output file path
Mapping of res_gid (index) to gen_gid (values)
reV multi year mean output file path
PLEXOS Plant builds
Dictionary matching plants to plant ids
PLEXOS table
Compute distance between every Supply Curve gid and every PLEXOS bus
Supply Curve Table
Get a short 3-char tz alias if the timezone is common in the US (pst, mst, cst, est)
Get a list of ordered unique plant names if plant_name_col was provided.
- property plexos_table
PLEXOS table
- Returns:
pandas.DataFrame
- property mymean_fpath
reV multi year mean output file path
- Returns:
str
- property cf_fpath
reV generation output file path
- Returns:
str
- property cf_gid_map
Mapping of res_gid (index) to gen_gid (values)
- Returns:
pd.Series
- property sc_table
Supply Curve Table
- Returns:
pandas.DataFrame
- property plants
Dictionary matching plants to plant ids
- Returns:
dict
- property plant_builds
PLEXOS Plant builds
- Returns:
dict
- property sc_bus_dist
Compute distance between every Supply Curve gid and every PLEXOS bus
- Returns:
ndarray
- property unique_plant_names
Get a list of ordered unique plant names if plant_name_col was provided.
- Returns:
list | None
- property tz_alias
Get a short 3-char tz alias if the timezone is common in the US (pst, mst, cst, est)
- Returns:
str
- get_gen_gid(res_gid)[source]
Get a generation gid from a resource gid using cf_gid_map. Accounts for a many-to-one resource-to-gen_gid mapping.
- Parameters:
res_gid (int)
- Returns:
gen_gid
- plants_meta()[source]
Create plants meta data from filled plants DataFrames:
Location (lat, lon)
final capacity (MW)
sc_gids
res_gids
res gid_counts
- Parameters:
plants (list) – List of filled plant DataFrames
out_fpath (str) – .csv path to save plant meta data too
- Returns:
plants_meta (pandas.DataFrame) – Location (lat, lon), final capacity, and associated sc_gids, res_gids, and res gid_counts for all plants
- aggregate_profiles(out_fpath)[source]
Aggregate plants from capacity factor profiles and save to given output .h5 path
- Parameters:
out_fpath (str) – .h5 path to save aggregated plant profiles to A companion .csv with be saved at the same location for plexos.
- classmethod aggregate(plexos_table, sc_table, mymean_fpath, cf_fpath, plants_fpath, out_fpath, offshore=False)[source]
Aggregate pre-filled plants
- Parameters:
plexos_table (str | pandas.DataFrame) – PLEXOS table of bus locations and capacity (MW) provided as a .csv, .json, or pandas DataFrame
sc_table (str | pandas.DataFrame) – Supply Curve table .csv or pre-loaded pandas DataFrame
mymean_fpath (str) – Path to reV multi-year-mean output .h5 file to pull cf_mean-means from - this will be used to determine where plants are built so it does not differ from year to year. The meta must match cf_fpath.
cf_fpath (str) – Path to reV annual Generation output .h5 file to pull CF profiles from. Meta must match mymean_fpath.
plants_fpath (str) – Path to .csv containing pre-filled plants
out_fpath (str) – .h5 path to save aggregated plant profiles to
offshore (bool, optional) – Include offshore points, by default False
- classmethod run(plexos_table, sc_table, mymean_fpath, cf_fpath, out_fpath, dist_percentile=90, dist_thresh_km=None, lcoe_col='total_lcoe', lcoe_thresh=1.3, max_workers=None, points_per_worker=400, plants_per_worker=40, offshore=False, plant_name_col=None, tech_tag=None, dset_tag='', timezone='UTC')[source]
Find, fill, and save profiles for Plants associated with given PLEXOS buses
- Parameters:
plexos_table (str | pandas.DataFrame) – PLEXOS table of bus locations and capacity (MW) provided as a .csv, .json, or pandas DataFrame. Needs columns: latitude, longitude, capacity. Note that capacity needs to be AC for wind and DC for solar.
sc_table (str | pandas.DataFrame) – Supply Curve table .csv or pre-loaded pandas DataFrame
mymean_fpath (str) – Path to reV multi-year-mean output .h5 file to pull cf_mean-means from - this will be used to determine where plants are built so it does not differ from year to year. The meta must match cf_fpath.
cf_fpath (str) – Path to reV annual Generation output .h5 file to pull CF profiles from. Meta must match mymean_fpath.
out_fpath (str) – .h5 path to save aggregated plant profiles to A companion .csv with be saved at the same location for plexos.
dist_percentile (int, optional) – Percentile to use to compute distance threshold using sc_gid to SubStation distance , by default 90
dist_thresh_km (float | None) – Optional absolute distance threshold in km that will override the dist_percentile input.
lcoe_col (str, optional) – LCOE column to sort by, by default ‘total_lcoe’
lcoe_thresh (float, optional) – LCOE threshold multiplier, exclude sc_gids above threshold, by default 1.3
max_workers (int, optional) – Number of workers to use for point and plant creation, 1 == serial, > 1 == parallel, None == parallel using all available cpus, by default None
points_per_worker (int, optional) – Number of points to create on each worker, by default 400
plants_per_worker (int, optional) – Number of plants to identify on each worker, by default 40
offshore (bool, optional) – Include offshore points, by default False
plant_name_col (str | None) – Column in plexos_table that has the plant name that should be used in the plexos output csv column headers.
tech_tag (str | None) – Optional technology tag to include as a suffix in the plexos output csv column headers.
dset_tag (str) – Dataset tag to append to dataset names in cf profile file. e.g. If the cf profile file is a multi year file using dset_tag=”-2008” will enable us to select the corresponding datasets (cf_mean-2008, cf_profile-2008, etc)
timezone (str) – Timezone for output generation profiles. This is a string that will be passed to pytz.timezone() e.g. US/Pacific, US/Mountain, US/Central, US/Eastern, or UTC. For a list of all available timezones, see pytz.all_timezones