pvlib.iotools.get_nsrdb_psm4_tmy#

pvlib.iotools.get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy', time_step=60, parameters=('air_temperature', 'dew_point', 'dhi', 'dni', 'ghi', 'surface_albedo', 'surface_pressure', 'wind_direction', 'wind_speed'), leap_day=False, full_name='pvlib python', affiliation='pvlib python', utc=False, map_variables=True, url=None, timeout=30)[source]#

Retrieve NSRDB PSM4 timeseries weather data from the PSM4 NSRDB GOES TMY v4 API.

The NSRDB is described in [1] and the PSM4 NSRDB GOES TMY v4 API is described in [2].

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

  • year (str, default 'tmy') – PSM4 API parameter specifing TMY variant to download (e.g. 'tmy' or 'tgy-2022'). The allowed values update periodically, so consult the NSRDB references below for the current set of options. Called names in NSRDB API.

  • time_step (int, {60}) – time step in minutes. Must be 60 for typical year requests. Called interval in NSRDB API.

  • parameters (list of str, optional) – meteorological fields to fetch. If not specified, defaults to pvlib.iotools.psm4.PARAMETERS. See reference [2] for a list of available fields. Alternatively, pvlib names may also be used (e.g. ‘ghi’ rather than ‘GHI’); see REQUEST_VARIABLE_MAP. To retrieve all available fields, set parameters=[].

  • leap_day (bool, default : False) – Include leap day in the results. Ignored for tmy/tgy/tdy requests.

  • full_name (str, default 'pvlib python') – optional

  • affiliation (str, default 'pvlib python') – optional

  • utc (bool, default : False) – retrieve data with timestamps converted to UTC. False returns timestamps in local standard time of the selected location

  • map_variables (bool, default True) – When true, renames columns of the Dataframe to pvlib variable names where applicable. See variable VARIABLE_MAP.

  • url (str, optional) – Full API endpoint URL. If not specified, the PSM4 GOES TMY v4 URL is used.

  • timeout (int, default 30) – time in seconds to wait for server response before timeout

Returns:

  • data (pandas.DataFrame) – timeseries data from NREL PSM4

  • metadata (dict) – metadata from NREL PSM4 about the record, see pvlib.iotools.read_nsrdb_psm4() for fields

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.

Warning

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

References