pvdeg.weather.weather_distributed#
- pvdeg.weather.weather_distributed(database: str, coords: list[tuple], api_key: str = '', email: str = '')[source]#
Grab weather using pvgis for all locations using dask for parallelization.
You must create a dask client with multiple processes before calling this function, otherwise results will not be properly calculated.
PVGIS supports up to 30 requests per second so your dask client should not have more than $x$ workers/threads that would put you over this limit.
NSRDB (including database=”PSM4”) is rate limited and your key will face restrictions after making too many requests. See rates [here](https://developer.nrel.gov/docs/solar/nsrdb/guide/).
- Parameters:
database ((str)) – ‘PVGIS’ or ‘PSM4’
coords (list[tuple]) –
list of tuples containing (latitude, longitude) coordinates
coords_example = [ (49.95, 1.5), (51.95, -9.5), (51.95, -8.5), (51.95, -4.5), (51.95, -3.5)]
api_key (str) – Only required when making NSRDB requests using “PSM4”. [NSRDB developer API key](https://developer.nrel.gov/signup/)
email (str) – Only required when making NSRDB requests using “PSM4”. [NSRDB developer account email associated with api_key](https://developer.nrel.gov/signup/)
- Returns:
weather_ds (xr.Dataset) – Weather data for all locations requested in an xarray.Dataset using a dask array backend.
meta_df (pd.DataFrame) – Pandas DataFrame containing metadata for all requested locations. Each row maps to a single entry in the weather_ds.
gids_failed (list) – list of index failed coordinates in input coords