crest-data-lance / README.md
tsmithv11's picture
Publish native CREST stations, forecasts, and external forcing grids
7999bab verified
|
Raw History Blame
6.99 kB
metadata
pretty_name: CREST hydrology data in Lance
license: cc-by-4.0
language:
  - en
tags:
  - lance
  - hydrology
  - time-series
  - precipitation
  - geospatial
  - information-retrieval
configs:
  - config_name: stations
    default: true
    data_files:
      - split: train
        path: preview/stations.parquet
  - config_name: forcing
    data_files:
      - split: train
        path: preview/forcing.parquet

CREST hydrology data in Lance

Explore the EF5/CREST hydrology inputs, forecasts and flood-event products from the public CREST data repository. The forcing table lets you fetch an individual original grid from its monthly archive using its product and UTC timestamp. The station table supports geographic metadata queries and semantic search by gauge name or river. Original CREST dataset · Pinned source revision

Tables

Path Rows Contents
data/forcing.lance 194,767 Product, UTC time, original path, original member offset, and byte-exact Blob v2 references to each monthly TAR member and standalone recent grid
data/stations.lance 9,322 GAGES-II station names, coordinates, drainage areas, classifications, time zones, and generated gauge search embeddings
data/events.lance 107 Event IDs and source artifact counts, including 104 current final summaries with original numeric outcomes
data/event_summaries.lance 111 Source event metrics and JSON text for the public current and pre-merge event summaries
data/latest_nowcast.lance 9,067 Published gauge forecast snapshot with the source columns and numeric values
data/virtual_latest_nowcast.lance 2,676 Published virtual-gauge forecast snapshot with the source columns and numeric values
data/forecast_thresholds.lance 9,322 The pinned source’s typed flood thresholds
data/parameter_multipliers.lance 9,058 The pinned source’s typed calibration multipliers
data/source_files.lance 39,998 Complete pinned source inventory with size and content identifiers, including 39,993 lazily readable file payloads

The forcing index covers all 392 monthly TARs and all standalone recent MRMS forcing grids. A Blob v2 range is the original grid file inside the archive. Grid cell values and geographic metadata remain in their original .pqf Parquet layout, and they can be read with PyArrow or EF5. Each TAR member row records the containing archive’s SHA-256 and the member’s byte offset and length. Some source months have missing timesteps, and the index preserves the observed timestamps. The catalog preserves the annual packages and gzip-compressed gauge archives as whole-file Blob v2 references. The source also organizes forecasts and event products by timestamp and path. It supplies no training, validation, or test partition convention. The Hugging Face Parquet previews use the default train split for browsing. Provider README · Conversion coverage

The two HydroRIVERS-associated rivers/ files and three HydroSHEDS basic/ rasters have catalog records, pinned source links, and null Blob payloads. Consult the original product terms for these data. The station table draws from the USGS gauge data and CREST timezone and grid metadata. HydroRIVERS · HydroSHEDS core products · HydroSHEDS v1 terms

Search gauges and read a forcing grid

The source contains no compatible gauge search vectors. This release embeds English descriptions built from each station’s original name, state, ecoregion, and drainage area. It uses intfloat/multilingual-e5-small at revision 614241f622f53c4eeff9890bdc4f31cfecc418b3 with passage: for gauge descriptions and query: for search queries. The vectors are 384-dimensional float32 values normalized to unit length. Scores are cosine similarity, calculated as one minus the Lance cosine distance. Pinned encoder

The example locates five Mississippi River streamflow gauges in Minnesota, then reads a daily PET grid from a single original archive member.

python -m pip install 'pylance==14.0.3' 'sentence-transformers==6.3.0' pyarrow
from io import BytesIO
import lance
import pyarrow.parquet as pq
from sentence_transformers import SentenceTransformer

root = "hf://datasets/lance-format/crest-data-lance"
source_base = "hf://datasets/vincewin/CREST_data"
source_revision = "6a8652b491e8a2574efca4854d23de0fd5028c92"
model = SentenceTransformer("intfloat/multilingual-e5-small", revision="614241f622f53c4eeff9890bdc4f31cfecc418b3", device="cpu")
vector = model.encode("query: Mississippi River streamflow gauges in Minnesota", normalize_embeddings=True)
stations = lance.dataset(root + "/data/stations.lance")
hits = stations.to_table(
    columns=['station_id', 'name', 'state', 'latitude', 'longitude', '_distance'],
    nearest={"column": "embedding", "q": vector, "k": 5, "metric": "cosine"},
).to_pylist()
for hit in hits:
    score = 1 - hit["_distance"]
    print(hit["station_id"], hit["name"], hit["state"], f"{score:.4f}")

forcing = lance.dataset(
    root + "/data/forcing.lance",
    base_store_params={source_base: {"hf_revision": source_revision}},
)
grid_record = forcing.to_table(
    columns=["product", "time_utc", "member_path"], with_row_id=True,
    filter="product = 'pet' AND time_key = '2016010100'", limit=1,
).to_pylist()[0]
with forcing.take_blobs("original", ids=[grid_record["_rowid"]])[0] as grid:
    payload = grid.read()
parquet = pq.ParquetFile(BytesIO(payload))
print(grid_record["member_path"], parquet.metadata.num_rows, parquet.schema_arrow.names)

Attribution and licence

Vincewin publishes the CREST collection under Creative Commons Attribution 4.0. This release adds typed Lance tables, scoped payload references, station search vectors, and Parquet previews. The original dataset card is included. CREST source card · CC BY 4.0

The forcing products are NOAA MRMS corrected quantitative precipitation estimates, NASA’s NLDAS-2 FORA hourly temperature, and USGS FEWS NET daily potential evapotranspiration. The gauge catalog includes USGS GAGES-II, compiled by J. A. Falcone. NOAA MRMS · NASA NLDAS-2 FORA · USGS FEWS NET PET · USGS GAGES-II · USGS Watershed Boundary Dataset