pvdeg.weather.get#
- pvdeg.weather.get(database, id=None, geospatial=False, find_meta=False, **kwargs)[source]#
Load weather data directly from NSRDB or through any other PVLIB i/o tools function.
- Parameters:
database ((str)) – ‘NSRDB’ or ‘PVGIS’. Use “PSM4” for tmy NSRDB data.
id ((int or tuple)) – If NSRDB, id is the gid for the desired location. If PVGIS, id is a tuple of (latitude, longitude) for the desired location
geospatial ((bool)) – If True, initialize weather data via xarray dataset and meta data via dask dataframe. This is useful for large scale geospatial analyses on distributed compute systems. Geospatial analyses are only supported for NSRDB data and locally stored h5 files that follow pvlib conventions.
find_meta ((bool)) – If true, this instructs the code to look up additional meta data. This only works for single locations and not for distributed data download or geospatial analysis. The default is False.
**kwargs – Additional keyword arguments to pass to the get_weather function (see pvlib.iotools.get_nsrdb_psm4_tmy for NSRDB)
- Returns:
weather_df ((pd.DataFrame)) – DataFrame of weather data
meta ((dict)) – Dictionary of metadata for the weather data
Example
Collecting a single site of PSM4 NSRDB data. Api key and email must be replaced with your personal api key and email. [Request a key!](https://developer.nrel.gov/signup/)
weather_arg = { 'api_key': <api_key>, 'email': <email>, 'names': 'tmy', 'attributes': [], 'map_variables': True } weather_df, meta_dict = pvdeg.weather.get(database="PSM4",id=(25.783388, -80.189029), **weather_arg)
Collecting a single site of PVGIS TMY data
weather_df, meta_dict = pvdeg.weather.get(database="PVGIS", id=(49.95, 1.5))
Collecting geospatial data from NSRDB on Kestrel (NREL INTERNAL USERS ONLY)
- satellite options:
"GOES", "METEOSAT", "Himawari", "SUNY", "CONUS", "Americas"
weather_db = "NSRDB" weather_arg = { "satellite": "Americas", "names": "TMY", "NREL_HPC": True, "attributes": [ "air_temperature", "wind_speed", "dhi", "ghi", "dni", "relative_humidity", ], } geo_weather, geo_meta = pvdeg.weather.get( weather_db, geospatial=True, **weather_arg )