energy_data_retrieval.sources.bsrn.client#
Bounded BSRN discovery and native minute data through PANGAEA’s DOI interface.
The supported product is one station/month’s LR0100 radiation, optionally with LR0300 variables in the same published table. This is not a general PANGAEA client, an FTP credential handler, or an hourly weather preparation step.
- energy_data_retrieval.sources.bsrn.client.normalize_dataset(text, metadata, *, doi, station, year, month, maximum_rows=50000)[source]#
Keep original minute labels, all raw fields, and unaltered numeric payloads.
Empty fields become null only in numeric columns. A published qualifier (? / * # > <) remains beside its numeric payload and in the original source field; qualified numbers are not promoted to unqualified observations. Values, including negatives, are never clipped or interpolated.
- Parameters:
text (str)
metadata (dict[str, JSONValue])
doi (str)
station (str)
year (int)
month (int)
maximum_rows (int)
- Return type:
DataFrame
- class energy_data_retrieval.sources.bsrn.client.BSRNSearch(station: 'str', year: 'int', month: 'int', query: 'str', candidates: 'tuple[dict[str, JSONValue], ...]', requests: 'tuple[RequestRecord, ...]')[source]#
Bases:
object- Parameters:
station (str)
year (int)
month (int)
query (str)
candidates (tuple[dict[str, JSONValue], ...])
requests (tuple[RequestRecord, ...])
- station: str#
- year: int#
- month: int#
- query: str#
- candidates: tuple[dict[str, JSONValue], ...]#
- requests: tuple[RequestRecord, ...]#
- class energy_data_retrieval.sources.bsrn.client.BSRNDataset(doi: 'str', station: 'str', year: 'int', month: 'int', maximum_rows: 'int', frame: 'pd.DataFrame', metadata: 'dict[str, JSONValue]', raw_text: 'str', requests: 'tuple[RequestRecord, ...]')[source]#
Bases:
object- Parameters:
doi (str)
station (str)
year (int)
month (int)
maximum_rows (int)
frame (DataFrame)
metadata (dict[str, JSONValue])
raw_text (str)
requests (tuple[RequestRecord, ...])
- doi: str#
- station: str#
- year: int#
- month: int#
- maximum_rows: int#
- frame: DataFrame#
- metadata: dict[str, JSONValue]#
- raw_text: str#
- requests: tuple[RequestRecord, ...]#
- energy_data_retrieval.sources.bsrn.client.save_dataset(result, output)[source]#
Publish normalized minutes plus exact source text, JSON-LD and source hashes.
- Parameters:
result (BSRNDataset)
output (Path)
- Return type:
- class energy_data_retrieval.sources.bsrn.client.BSRNClient(http: 'HTTPClient', maximum_rows: 'int' = 50000)[source]#
Bases:
object- Parameters:
http (HTTPClient)
maximum_rows (int)
- http: HTTPClient#
- maximum_rows: int#
- search(station, year, month, *, maximum_results=100, page_size=20)[source]#
Discover DOI candidates; a broad search hit is not verified station data.
PANGAEA documents this search endpoint as internal and not a stable public REST contract. It is used by its official client; DOI retrieval below is independent of search and uses the documented DOI export interface.
- Parameters:
station (str)
year (int)
month (int)
maximum_results (int)
page_size (int)
- Return type: