遇见数据集

JesseGuerreroML/HeatCast

收藏
Hugging Face2026-05-21 更新2026-05-31 收录
官方服务:

资源简介:

HeatCast数据集是一个包含124个美国城市的Landsat-derived land-surface-temperature(地表温度)时间序列立方体的集合,存储为Zarr v3格式并进行了分片处理。该数据集是从原始的分块GeoTIFF版本重新打包而来,文件数量从1450万减少到7436个,总大小从269GB压缩到170GB,同时保持完全云端可读性。数据集提供了每城市的LST数据以及其他波段(如albedo、blue、green、red、ndvi、ndwi、ndbi等),适用于气候研究、遥感分析、城市热岛效应监测、时间序列分析和地理空间应用。

许可证:MIT协议 任务类别:其他 标签:气候、遥感、地表温度(Land Surface Temperature,LST)、LST、城市热岛、时间序列、地理空间、Zarr 美观名称:HeatCast — 美国城市LST时间序列数据集 样本规模:10万~100万 # HeatCast 本数据集包含124座美国城市的、基于陆地卫星(Landsat)反演的地表温度时间序列立方体,以带分片的Zarr v3(Zarr)格式存储。本数据集从[JesseGuerreroML/US-UrbanLST](https://huggingface.co/datasets/JesseGuerreroML/US-UrbanLST)的原始分幅GeoTIFF版本重新打包而来,整体文件数从1450万缩减至**7436个**,同时保留完全的云端可读特性。 ## 数据布局 isaaccorley/HeatCast/ ├── <City_ST>.zarr/ # 每个城市对应一个Zarr v3存储库(共124个) │ ├── zarr.json │ ├── LST/ # 三维数组(时间T,纬度Y,经度X),类型为int16 │ ├── albedo/ # 反照率 │ ├── blue/ green/ red/ # 蓝、绿、红波段 │ ├── ndvi/ ndwi/ ndbi/ # 归一化差分植被指数(Normalized Difference Vegetation Index,NDVI)、归一化差分水体指数(Normalized Difference Water Index,NDWI)、归一化差分建筑指数(Normalized Difference Built-up Index,NDBI) │ └── ... 每个城市存储库包含以下属性: | 属性名 | 描述 | |----------------|-------------------------------------------------------------| | `city` | 城市名称 | | `timestamps` | ISO-8601格式时间戳列表,长度为`T`(对应每一次陆地卫星采集任务) | | `bands` | 当前存储库中包含的波段名称列表 | | `tile_size` | 单个源瓦片的尺寸`[高h, 宽w]` | | `grid_shape` | 单城市瓦片网格的行列数`[行数, 列数]` | | `full_shape` | 拼接后完整栅格的尺寸`[高度H, 宽度W]` | | `transforms` | 对应每个时间戳的仿射变换参数`{timestamp: affine}`,适用于示例波段 | 每个波段的数组采用**分块大小为单个源瓦片**的分块策略(`1 × 瓦片高 × 瓦片宽`),并打包为覆盖全时间轴上4×4瓦片区域的分片。数据压缩采用**Blosc(Zstd-9, byte-shuffle)**算法。缺失的瓦片将以对应波段的填充值编码(整型为`0`,浮点型为`NaN`,与上游GeoTIFF版本保持一致)。 ## 快速入门 — 从Hub流式读取 无需克隆数据集、无需本地缓存,仅通过HTTPS范围请求读取数据: bash pip install "zarr>=3" obstore pandas matplotlib seaborn python import os from datetime import timedelta import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as mdates import seaborn as sns import obstore import zarr from zarr.storage import ObjectStore sns.set_theme(context="notebook", style="whitegrid", palette="deep") REPO = "isaaccorley/HeatCast" CITY = "Hollywood_FL" BASE = f"https://huggingface.co/datasets/{REPO}/resolve/main" # 使用HF令牌绕过共享网络下的匿名IP速率限制 headers = {} token = os.environ.get("HF_TOKEN") if token: headers["Authorization"] = f"Bearer {token}" http = obstore.store.HTTPStore.from_url( f"{BASE}/{CITY}.zarr", client_options={"default_headers": headers} if headers else None, retry_config={ "max_retries": 2, "backoff": {"init_backoff": timedelta(seconds=2), "max_backoff": timedelta(seconds=10), "base": 2}, "retry_timeout": timedelta(seconds=30), }, ) grp = zarr.open_group(ObjectStore(http, read_only=True), mode="r") timestamps = list(grp.attrs["timestamps"]) print(grp.attrs["city"], "T=", len(timestamps), "bands=", grp.attrs["bands"]) ### 技巧 — 读取完整立方体,而非单时间步数据 对单个像素或单个时间步进行切片操作会触发多次范围请求。免费账户的HF速率限制为每5分钟最多5000个`resolve/`请求,因此若需处理绝大多数时间步的分析任务,建议一次性拉取完整数组: python lst = grp["LST"] raw = lst[:] # 一次性读取所有分片 mask = (raw == lst.fill_value) | (raw <= 0) # 同时过滤填充值和超出范围的填充数据 cube = np.where(mask, np.nan, raw.astype(np.float32)) # 移除5%分位数LST值过低的完整场景。少量上游场景使用了错误的缩放因子存储(例如Hollywood_FL在2022-02-09的全场景值为1~41,而相邻日期的数值约为70~125)。 LST_FLOOR = 50 frame_p5 = np.nanpercentile(cube.reshape(cube.shape[0], -1), 5, axis=1) cube[frame_p5 < LST_FLOOR] = np.nan print(cube.shape, "valid_pct=", 100 * (~np.isnan(cube)).mean()) > **数据质量提示。** 少量源场景存在异常的单场景缩放因子——其整个栅格的数值相较于相邻日期偏差约10倍。本次重打包与上游GeoTIFF版本完全按字节对齐,因此该数据伪影会被保留。上述`LST_FLOOR`过滤规则是最简单且合理的掩膜方案;若需更严格的过滤条件,可针对每个城市/每个单位调整阈值。 ### 示例1 — 中心像素LST时间序列 python dt = pd.to_datetime(timestamps, utc=True) py, px = cube.shape[1] // 2, cube.shape[2] // 2 ts = pd.Series(cube[:, py, px], index=dt).dropna() fig, ax = plt.subplots(figsize=(11, 4.2)) sns.lineplot(x=ts.index, y=ts.values, ax=ax, marker="o", markersize=5, linewidth=1.2, color=sns.color_palette("rocket", 6)[2]) ax.set(title=f"{CITY} — LST at pixel ({py}, {px})", xlabel="date", ylabel="LST") ax.xaxis.set_major_locator(mdates.YearLocator()) ax.xaxis.set_major_formatter(mdates.DateFormatter("%Y")) sns.despine(ax=ax); fig.autofmt_xdate(); fig.tight_layout() ### 示例2 — 覆盖度最佳的场景热图 python valid_t = (~np.isnan(cube)).reshape(cube.shape[0], -1).sum(axis=1).argmax() frame = cube[valid_t] vmin, vmax = np.nanpercentile(frame, [2, 98]) fig, ax = plt.subplots(figsize=(8.5, 6.5)) im = ax.imshow(frame, cmap="rocket_r", vmin=vmin, vmax=vmax, interpolation="nearest") fig.colorbar(im, ax=ax, shrink=0.85, pad=0.02).set_label("LST", rotation=270, labelpad=15) ax.set(title=f"{CITY} — LST on {dt[valid_t].date()}", xlabel="x (px)", ylabel="y (px)") fig.tight_layout() ### 示例3 — 按季节着色的城市平均LST变化轨迹 python means = np.nanmean(cube.reshape(cube.shape[0], -1), axis=1) ok = ~np.isnan(means) df = pd.DataFrame({"date": dt[ok], "LST": means[ok]}) df["month"] = df["date"].dt.month fig, ax = plt.subplots(figsize=(11, 4.2)) sns.scatterplot(data=df, x="date", y="LST", hue="month", palette="rocket", s=45, edgecolor="white", linewidth=0.5, legend=False, ax=ax) trend = df.set_index("date")["LST"].resample("3MS").mean().dropna() ax.plot(trend.index, trend.values, color="#444", lw=1.2, alpha=0.7, label="3-month rolling mean") ax.legend(loc="upper left", frameon=True) ax.set(title=f"{CITY} — city-mean LST (colored by month)", xlabel="date", ylabel="mean LST") ax.xaxis.set_major_locator(mdates.YearLocator()) ax.xaxis.set_major_formatter(mdates.DateFormatter("%Y")) sns.despine(ax=ax); fig.autofmt_xdate(); fig.tight_layout() ## 文件数量对比 | 数据布局 | 文件数量 | 总大小 | |-----------------------------------------------|------------:|-----------:| | 上游分幅GeoTIFF版本(封装于7z+内层zip压缩包中) | 14,490,624 | 269 GB | | HeatCast Zarr v3 | 7,436 | 170 GB | ## 数据集来源 - 数据源:[JesseGuerreroML/US-UrbanLST](https://huggingface.co/datasets/JesseGuerreroML/US-UrbanLST) — 针对124座美国城市的、基于陆地卫星反演的LST与反射率/指数瓦片数据集。 - 重打包流程:7z压缩包 → zip压缩包 → 单城市瓦片索引 → 带分片对齐写入的Zarr v3格式。经往返验证,与源GeoTIFF版本完全按字节对齐(验证样本的每个波段平均绝对差值为0)。 - 压缩方案:采用Blosc-Zstd-9算法并搭配字节洗牌(byte shuffle)。 ## 许可证 采用MIT协议。若基于本数据集发表研究成果,请引用上游原始数据集。

提供机构:
JesseGuerreroML
二维码
社区交流群
二维码
科研交流群
商业服务