pvlib.iotools.get_psm3

pvlib.iotools.get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60, full_name='pvlib python', affiliation='pvlib python', timeout=30)[source]

Get PSM3 data

Parameters:
  • latitude (float or int) – in decimal degrees, between -90 and 90, north is positive
  • longitude (float or int) – in decimal degrees, between -180 and 180, east is positive
  • api_key (str) – NREL Developer Network API key
  • email (str) – NREL API uses this to automatically communicate messages back to the user only if necessary
  • names (str, default 'tmy') – PSM3 API parameter specifing year or TMY variant to download, see notes below for options
  • interval (int, default 60) – interval size in minutes, can only be either 30 or 60
  • full_name (str, default 'pvlib python') – optional
  • affiliation (str, default 'pvlib python') – optional
  • timeout (int, default 30) – time in seconds to wait for server response before timeout
Returns:

  • headers (dict) – metadata from NREL PSM3 about the record, see notes for fields
  • data (pandas.DataFrame) – timeseries data from NREL PSM3

Raises:

requests.HTTPError – if the request response status is not ok, then the 'errors' field from the JSON response or any error message in the content will be raised as an exception, for example if the api_key was rejected or if the coordinates were not found in the NSRDB

Notes

The required NREL developer key, api_key, is available for free by registering at the NREL Developer Network.

Warning

The “DEMO_KEY” api_key is severely rate limited and may result in rejected requests.

The PSM3 API names parameter must be a single value from the following list:

['1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005',
 '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013',
 '2014', '2015', '2016', '2017', 'tmy', 'tmy-2016', 'tmy-2017',
 'tdy-2017', 'tgy-2017']

The return is a tuple with two items. The first item is a header with metadata from NREL PSM3 about the record containing the following fields:

  • Source
  • Location ID
  • City
  • State
  • Country
  • Latitude
  • Longitude
  • Time Zone
  • Elevation
  • Local Time Zone
  • Dew Point Units
  • DHI Units
  • DNI Units
  • GHI Units
  • Temperature Units
  • Pressure Units
  • Wind Direction Units
  • Wind Speed
  • Surface Albedo Units
  • Version

The second item is a dataframe with the timeseries data downloaded.

Warning

PSM3 is limited to data found in the NSRDB, please consult the references below for locations with available data

References

[1]NREL Developer Network - Physical Solar Model (PSM) v3
[2]NREL National Solar Radiation Database (NSRDB)