bsrn.io.mcclear.fetch_mcclear#
- bsrn.io.mcclear.fetch_mcclear(index, latitude, longitude, elev, email, timeout=30)[source]#
Retrieve and align McClear data to a target DatetimeIndex.
- Parameters:
index (pd.DatetimeIndex) – Target time index to align McClear outputs to.
latitude (float) – Latitude in decimal degrees. [degrees]
longitude (float) – Longitude in decimal degrees. [degrees]
elev (float) – Site elevation. [m]
email (str) – SoDa account email.
timeout (int, default 30) – HTTP request timeout in seconds.
- Returns:
aligned – McClear data reindexed to index. Must contain ghi_clear, bni_clear, and dhi_clear.
- Return type:
pd.DataFrame
- Raises:
ValueError – If
indexis not a DatetimeIndex, McClear columns are missing, or the downloaded frame has an invalid index.requests.Timeout – Propagated from
_download_mcclear()when the HTTP call times out.requests.HTTPError – Propagated from SoDa on HTTP failure.