Resource Data#

These are the primary methods for accessing wind and solar resource data.

NREL API Keys#

An NREL API key is required to use the functionality for Solar Resource (API) and Wind Resource (API).

An NREL API key can be obtained from here.

Once an API key is obtained, create a file “.env” in the HOPP root directory (/path/to/HOPP/.env) that contains the lines:

NREL_API_KEY=key
NREL_API_EMAIL=your.name@email.com

where key is your API key and your.name@email.com is the email that was used to get the API key.

NREL HPC Datasets#

To load resource data from datasets hosted on NREL’s HPC, HOPP must be installed and run from the NREL HPC. Currently, loading resource data from HPC is only enabled for wind and solar resource.

Resource Base Class#

Base class for resource data

class hopp.simulation.technologies.resource.Resource(lat, lon, year, **kwargs)#

Bases: object

Class to manage resource data for a given lat & lon. If a resource file doesn’t exist, it is downloaded and saved to ‘resource_files’ folder. The resource file is then read to the appropriate SAM resource data format.

__init__(lat, lon, year, **kwargs)#
Parameters:
  • lat (float) – The latitude

  • lon (float) – The longitude

  • year (int) – The year of resource_files data

filename#

filepath of resource data file, defaults to None

check_download_dir()#

Creates directory for the resource file if it does not exist.

static call_api(url, filename)#
Parameters:
  • url (str) – The API endpoint to return data from

  • filename (str) – The filename where data should be written

Returns:

True if downloaded file successfully, False if encountered error in downloading

abstract download_resource()#

Download resource for given lat/lon

abstract format_data()#

Reads data from file and formats it for use in SAM

abstract property data#

Get data as dictionary formatted for SAM