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. 获取并对齐 McClear 数据到给定的 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. SoDa 账户邮箱。
timeout (int, default 30) – HTTP request timeout in seconds. HTTP 请求超时时间(秒)。
- Returns:
aligned – McClear data reindexed to index. Must contain ghi_clear, bni_clear, and dhi_clear. 重新索引到 index 的 McClear 数据,包含 ghi_clear、bni_clear 与 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.index非 DatetimeIndex、McClear 缺列或下载数据索引无效时。requests.Timeout – Propagated from
_download_mcclear()when the HTTP call times out. 由_download_mcclear()在 HTTP 超时时向上传递。requests.HTTPError – Propagated from SoDa on HTTP failure. SoDa HTTP 失败时向上传递。