I/O Operations#

Readers#

Reading .dat.gz archive files is now handled by bsrn.dataset.BSRNDataset.from_file().

bsrn.dataset.BSRNDataset.from_file(path[, ...])

Parse a BSRN .dat.gz station-to-archive file and return a fully validated BSRNDataset.

Data Fetching#

bsrn.io.retrieval.get_bsrn_file_inventory(...)

Connects to bsrn ftp and lists available station-to-archive files.

bsrn.io.retrieval.download_bsrn_single(...)

Download a single BSRN file by specifying station, year, and month.

bsrn.io.retrieval.download_bsrn_stn(station, ...)

Download all available station-to-archive files for a specific station.

bsrn.io.retrieval.download_bsrn_mon(...[, host])

Download station-to-archive files for multiple stations for a specific month and year.

bsrn.io.retrieval.download_bsrn_files(...[, ...])

Download many BSRN files efficiently using a single FTP connection with robust retries.

bsrn.io.mcclear.fetch_mcclear(index, ...[, ...])

Retrieve and align McClear data to a target DatetimeIndex.

bsrn.io.merra2.fetch_rest2(index, station_code)

Fetch MERRA-2 from Hugging Face and return REST2-ready inputs aligned to target index.

CAMS Radiation Service (CRS)#

bsrn.io.crs.check_crs_availability(stations, ...)

Check which BSRN stations are geographically covered by CAMS Radiation Service (CRS) and have BSRN archive files overlapping the CRS temporal range.

bsrn.io.crs.download_crs(latitude, ...[, ...])

Download and parse CAMS Radiation Service (CRS) time series from SoDa.

bsrn.io.crs.fetch_crs_hf(index, station_code)

Fetch CRS from Hugging Face and return inputs aligned to target index.

bsrn.io.crs.add_crs_columns(df[, ...])

Adds CRS (CAMS Radiation Service) all-sky columns to a DataFrame.

NSRDB (National Solar Radiation Database)#

bsrn.io.nsrdb.check_nsrdb_availability(...)

Check which BSRN stations are geographically covered by an NSRDB variant and have BSRN archive files overlapping the variant's year range.

bsrn.io.nsrdb.download_nsrdb(latitude, ...)

Download NSRDB data from NLR API.

bsrn.io.nsrdb.fetch_nsrdb_hf(index, station_code)

Fetch NSRDB from Hugging Face aligned to target index.

bsrn.io.nsrdb.add_nsrdb_columns(df[, ...])

Adds NSRDB all-sky columns to a DataFrame.

BSRN Inventory Helpers#

bsrn.io.retrieval.parse_bsrn_filename(filename)

Extract station code, year, month, and optional suffix from a filename.

bsrn.io.retrieval.months_from_ftp_filenames(...)

Extract a unique set of (year, month) tuples from a list of BSRN filenames.