- pvlib.iotools.get_bsrn(station, start, end, username, password, logical_records=('0100',), save_path=None)[source]#
Retrieve ground measured irradiance data from the BSRN FTP server.
The BSRN (Baseline Surface Radiation Network) is a world wide network of high-quality solar radiation monitoring stations as described in 1. Data is retrieved from the BSRN FTP server 2.
Data is returned for the entire months between and including start and end.
station (str) – 3-letter BSRN station abbreviation
start (datetime-like) – First day of the requested period
end (datetime-like) – Last day of the requested period
username (str) – username for accessing the BSRN FTP server
password (str) – password for accessing the BSRN FTP server
logical_records (list or tuple, default: ('0100',)) – List of the logical records (LR) to parse. Options include: ‘0100’, ‘0300’, and ‘0500’.
save_path (str or path-like, optional) – If specified, a directory path of where to save each monthly file.
data (DataFrame) – timeseries data from the BSRN archive, see
pvlib.iotools.read_bsrn()for fields. An empty DataFrame is returned if no data was found for the time period.
metadata (dict) – metadata for the last available monthly file.
KeyError – If the specified station does not exist on the FTP server.
UserWarning – If one or more requested files are missing a UserWarning is returned with a list of the filenames missing. If no files match the specified station and timeframe a seperate UserWarning is given.
The username and password for the BSRN FTP server can be obtained for free as described in the BSRN’s Data Release Guidelines 3.
Currently only parsing of logical records 0100, 0300 and 0500 is supported. Note not all stations measure LR0300 and LR0500. However, LR0100 is mandatory as it contains the basic irradiance and auxillary measurements. See 4 for a description of the different logical records. Future updates may include parsing of additional data and metadata.
While data from the BSRN is generally of high-quality, measurement data should always be quality controlled before usage!
>>> # Retrieve two months irradiance data from the Cabauw BSRN station >>> data, metadata = pvlib.iotools.get_bsrn( >>> start=pd.Timestamp(2020,1,1), end=pd.Timestamp(2020,12,1), >>> station='cab', username='yourusername', password='yourpassword')