Hybrid Plant Site Information#

The purpose of this class is to house all site specific data, e.g., weather data.

class hopp.simulation.technologies.sites.SiteInfo(data, solar_resource_file='', wind_resource_file='', wave_resource_file='', tidal_resource_file='', grid_resource_file='', path_resource=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/hopp/envs/latest/lib/python3.11/site-packages/hopp/simulation/resource_files'), wtk_source_path='', nsrdb_source_path='', hub_height=97.0, capacity_hours=[], desired_schedule=[], curtailment_value_type='interconnect_kw', solar=True, wind=True, wave=False, tidal=False, renewable_resource_origin='API', wind_resource_origin='WTK', wind_resource_region='conus', site_buffer=1e-08, solar_resource=None, wind_resource=None, n_timesteps=8760)#

Bases: BaseClass

Represents site-specific information needed by the hybrid simulation class and layout optimization.

Parameters:
  • data (dict) – Dictionary containing site-specific information.

  • solar_resource_file (Path | str) – Path to solar resource file. Defaults to “”.

  • wind_resource_file (Path | str) – Path to wind resource file. Defaults to “”.

  • wave_resource_file (Path | str) – Path to wave resource file. Defaults to “”.

  • tidal_resource_file (Path | str) – Path to tidal resource file. Defaults to “”.

  • grid_resource_file (Path | str) – Path to grid pricing data file. Defaults to “”.

  • path_resource (str | Path | None) – Path to folder to save resource files. Defaults to ROOT/simulation/resource_files.

  • wtk_source_path (Optional) – directory of Wind Toolkit h5 files hosted on HPC. Only used if renewable_resource_origin != “API”.

  • nsrdb_source_path (Optional) – directory of NSRDB h5 files hosted on HPC. Only used if renewable_resource_origin != “API”.

  • hub_height (float64) – Turbine hub height for resource download in meters. Defaults to 97.0.

  • capacity_hours (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – Boolean list indicating hours for capacity payments. Defaults to [].

  • desired_schedule (ndarray[tuple[Any, ...], dtype[float64]]) – Absolute desired load profile in MWe. Defaults to [].

  • curtailment_value_type (str) – whether to curtail power above grid interconnection limit or desired schedule. Options “interconnect_kw” or “desired_schedule”. Defaults to “interconnect_kw”.

  • solar (bool) – Whether to set solar data for this site. Defaults to True.

  • wind (bool) – Whether to set wind data for this site. Defaults to True.

  • wave (bool) – Whether to set wave data for this site. Defaults to False.

  • tidal (bool) – Whether to set tidal data for this site. Defaults to False.

  • renewable_resource_origin (str) – whether to download resource data from API or load directly from datasets files. Options are “API” or “HPC”. Defaults to “API”.

  • wind_resource_origin (str) – Which wind resource API to use, defaults to “WTK” for WIND Toolkit. Options are “WTK”, “TAP” or “BC-HRRR”.

  • site_buffer (Optional) – value to buffer site polygon. Defaults to 1e-8.

  • solar_resource (Optional) – dictionary or object containing solar resource data.

  • wind_resource (Optional) – dictionary or object containing wind resource data.

  • wind_resource_region (Optional) –

    which region to use for wind resource data. Defaults to “conus”. Options are:

    • ”conus”: continental United States

    • ”ak”: Alaska

  • n_timesteps (int | None)

data: dict#

dictionary of site info data with key as:

  • lat (float): site latitude.

  • lon (float): site longitude.

  • elev (int, Optional): elevation of site (m).

  • year (int): year to get resource data for. Defaults to 2012.

  • tz (int, Optional): timezone of site.

  • site_boundaries (dict,Optional):
    • verts (list[list[float]]): vertices of site polygon. list of [x,y] coordinates in meters.

    • verts_simple (list[list[float]]): TODO

  • site_details (dict, Optional):
    • site_area_m2 (float): area of site in square meters.

    • site_area_km2 (float): area of site in square kilometers. required if site_area_m2 is not provided.

    • site_shape (str, Optional): shape of site area. Options are “circle”, “rectangle”, “square” or “hexagon”. Defaults to “square”.

    • x0 (float, Optional): left-most x coordinate of the site in meters. Defaults to 0.0.

    • y0 (float, Optional): bottom-most x coordinate of the site in meters. Defaults to 0.0.

    • aspect_ratio (float, Optional): aspect ratio (width/height)

      Only used if site_shape is set as “rectangle”. Defaults to 1.5.

    • degrees_between_points (float | int, Optional): difference in degrees for generating circular boundary.

      Only used if site_shape is set as “circle”. Defaults to 10.

  • solar_lat (float, Optional): latitude to get solar resource data if solar plant is in a different location than lat/lon. Defaults to lat value above.

  • solar_lon (float, Optional): longitude to get solar resource data if solar plant is in a different location than lat/lon. Defaults to lon value above.

  • solar_year (int, Optional): resource year for solar data if wanting a different resource year than data["year"]. Defaults to year value above.

  • wind_lat (float, Optional): latitude to get wind resource data if wind plant is in a different location than lat/lon. Defaults to lat value above.

  • wind_lon (float, Optional): longitude to get wind resource data if wind plant is in a different location than lat/lon. Defaults to lon value above.

  • wind_year (int, Optional): resource year for wind data if wanting different resource than data["year"]. Defaults to year value above.

  • urdb_label (str, Optional): string corresponding to data from utility rate database. Defaults to None.

solar_resource_file: Path | str#
wind_resource_file: Path | str#
wave_resource_file: Path | str#
tidal_resource_file: Path | str#
grid_resource_file: Path | str#
path_resource: str | Path | None#
wtk_source_path: str | Path | None#
nsrdb_source_path: str | Path | None#
hub_height: float64#
capacity_hours: ndarray[tuple[Any, ...], dtype[_ScalarT]]#
desired_schedule: ndarray[tuple[Any, ...], dtype[float64]]#
curtailment_value_type: str#
solar: bool#
wind: bool#
wave: bool#
tidal: bool#
renewable_resource_origin: str#
wind_resource_origin: str#
wind_resource_region: str#
site_buffer: float | None#
lat: float64#
lon: float64#
elev: float | None#
year: int#
tz: int | None#
vertices: ndarray[tuple[Any, ...], dtype[float64]]#
polygon: Polygon | BaseGeometry#
solar_resource: SolarResource | HPCSolarData | None#
wind_resource: WindResource | HPCWindData | AlaskaWindData | BCHRRRWindData | None#
wave_resource: WaveResource | None#
tidal_resource: TidalResource | None#
elec_prices: ElectricityPrices | None#
n_timesteps: int | None#
n_periods_per_day: int#
interval: int#
urdb_label: str#
follow_desired_schedule: bool#
kml_data: KML | None#
create_site_polygon(data)#

function to create site polygon.

Parameters:

data (dict) – dictionary of site info data

Returns:

2-element tuple containing

  • poly (shapely.geometry.Polygon): site boundary polygon

  • vertices (2D numpy.ndarray): vertices of site polygon. list of [x,y] coordinates in meters.

make_site_polygon_from_shape(site_details)#

create site polygon and vertices if “site_details” provided in data.

Parameters:

site_details (dict) – sub-dictionary of data, equivalent to data["site_details"]

Raises:

ValueError – if site_details["site_shape"] is not one of the following: “circle”, “square”, “rectangle”, or “hexagon”

Returns:

2-element tuple containing

  • poly (shapely.geometry.Polygon): site boundary polygon

  • vertices (2D numpy.ndarray): vertices of site polygon. list of [x,y] coordinates in meters.

initialize_solar_resource(data)#

Download/load solar resource data

Parameters:

data (dict) – Dictionary containing site-specific information.

Returns:

hopp.simulation.technologies.resource.SolarResource or hopp.simulation.technologies.resource.HPCSolarData – solar resource data class

initialize_wind_resource(data)#

Download/load wind resource data

Parameters:

data (dict) – Dictionary containing site-specific information.

Returns:

hopp.simulation.technologies.resource.WindResource or hopp.simulation.technologies.resource.HPCWindData – wind resource data class

property boundary: BaseGeometry#
property bounding_box: ndarray#
property center: Point#
plot(figure=None, axes=None, border_color=(0, 0, 0), alpha=0.95, linewidth=1.0)#
kml_write(filepath, turb_coords=None, solar_region=None, wind_radius=200)#
static kml_read(filepath)#
__init__(data, solar_resource_file='', wind_resource_file='', wave_resource_file='', tidal_resource_file='', grid_resource_file='', path_resource=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/hopp/envs/latest/lib/python3.11/site-packages/hopp/simulation/resource_files'), wtk_source_path='', nsrdb_source_path='', hub_height=97.0, capacity_hours=[], desired_schedule=[], curtailment_value_type='interconnect_kw', solar=True, wind=True, wave=False, tidal=False, renewable_resource_origin='API', wind_resource_origin='WTK', wind_resource_region='conus', site_buffer=1e-08, solar_resource=None, wind_resource=None, n_timesteps=8760)#

Method generated by attrs for class SiteInfo.

Parameters:
  • data (dict)

  • solar_resource_file (str)

  • wind_resource_file (str)

  • wave_resource_file (str)

  • tidal_resource_file (str)

  • grid_resource_file (str)

  • path_resource (str | Path | None)

  • wtk_source_path (str | Path | None)

  • nsrdb_source_path (str | Path | None)

  • capacity_hours (Iterable)

  • desired_schedule (Iterable)

  • curtailment_value_type (str)

  • solar (bool)

  • wind (bool)

  • wave (bool)

  • tidal (bool)

  • renewable_resource_origin (str)

  • wind_resource_origin (str)

  • site_buffer (float | None)

  • solar_resource (SolarResource | HPCSolarData | None)

  • wind_resource (WindResource | HPCWindData | AlaskaWindData | BCHRRRWindData | None)

  • n_timesteps (int | None)

Return type:

None

_get_model_dict()#

Convenience method that wraps the attrs.asdict method. Returns the object’s parameters as a dictionary.

Returns:

dict – The provided or default, if no input provided, model settings as a dictionary.

Return type:

dict

static append_kml_data(kml_data, polygon, name)#
as_dict()#

Creates a JSON and YAML friendly dictionary that can be save for future reloading. This dictionary will contain only Python types that can later be converted to their proper Turbine formats.

Returns:

dict – All key, vaue pais required for class recreation.

Return type:

dict

classmethod from_dict(data)#

Maps a data dictionary to an attr-defined class.

TODO: Add an error to ensure that either none or all the parameters are passed in

Parameters:

data (dict) – dict The data dictionary to be mapped.

Returns:

cls

The attr-defined class.

classmethod get_model_defaults()#

Produces a dictionary of the keyword arguments and their defaults.

Returns:

Dict[str, Any] – Dictionary of keyword argument: default.

Return type:

Dict[str, Any]

property logger#