Skip to main content

Radiust

简体中文 · English

让普通人能够方便地获取、理解和使用公共气象雷达观测。

Public radar, directly to you.

Radiust 希望让用户通过自己设备上的开放工具连接雷达来源,优先采用官方来源,也支持可靠、可追溯的第三方产品。数据默认在本地获取、缓存和处理,核心观测功能无需 Radiust 账号或 Radiust 数据中转服务。

当前提供 CLI、Python SDK 和可复用的 Rust radiust-core;Python console command 和 SDK 共用 Rust Engine。面向普通公众的 Desktop 尚未实现,其查看、时间序列播放、多源默认选择、手动切换与故障回退属于后续路线。当前先做好观测,为未来预测模型保留数据接口;跨来源雷达拼图留待后续。

项目理念 · 发展路线与 Desktop 验收目标 · 数据来源政策 · 品牌使用规则

当前版本为 0.1.1 alpha。

Features · Install · Usage · 项目与许可 · Dev

Features

  • 多来源雷达获取:目录登记 25 个来源,可查询来源、产品、站点和最新时次;实际可用性及访问要求见来源清单。
  • 终端预览:查看来源原图、规则生成的灰度编码或已支持产品的 dBZ 数值。
  • 数值反射率:台湾 CWA tw/grid 和 RainViewer 有线上获取与数值读回记录;RDCAP 单站产品已实现数值解码,三国在线能力仍未验收。
  • 数据导出:保存原始资料、PNG、NetCDF、GeoTIFF 或 Zarr,保留来源、时间和处理记录;科学格式取决于产品与几何支持。
  • 本地资料读写:读取数值文件,将明确声明的灰度编码图转为 dBZ;灰度转换不等于物理色标已验证。
  • 批量与缓存:批量查询和获取,复用缓存,跳过已有完整输出,支持取消操作。
  • Python SDK:提供同步、异步和批量接口,与 CLI 共用 Rust Engine。

Install

Python 包:CLI 与 SDK

使用 CPython 3.10–3.13。0.1.1 的预编译 wheel 覆盖 macOS Apple Silicon(macOS 11+)和 Linux x86_64(glibc ≥ 2.28),无需安装 Rust 或 CMake:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install "radiust==0.1.1"
python -m radiust --version
radiust --help

Python 包同时提供 radiust 命令和 SDK。需要 NumPy/xarray 转换时,安装 "radiust[science]==0.1.1";GeoTIFF、Zarr 及其他可选依赖见安装说明。同时安装独立 CLI 时,可用 python -m radiust 明确调用虚拟环境中的版本。

原生 CLI 与 Rust 库:crates.io

原生 CLI 无需 Python。Cargo 安装会从源码编译,需要 Rust 1.92+、CMake、C/C++ 编译器及构建工具:

cargo install --locked radiust-cli
radiust --version

Cargo 包名是 radiust-cli,可执行命令名是 radiust;~/.cargo/bin 需要在 PATH 中。Rust 项目可通过 cargo add radiust-core 使用同版本核心库。macOS 用户可用 xcode-select --install 准备编译工具,再用 brew install cmake 安装 CMake;完整前置依赖见源码构建说明。

macOS Apple Silicon:旧版独立预编译 CLI

下载预编译程序即可使用,无需安装 Python 或 Rust。当前提供 v0.1.0 预览包,支持 macOS 11 及更新版本。下载、校验并安装到用户目录:

mkdir -p "$HOME/.local/bin"
workdir="$(mktemp -d)"
cd "$workdir"
curl -fL -O https://github.com/chorust/radiust/releases/download/v0.1.0/radiust-v0.1.0-macos-arm64.tar.gz
curl -fL -O https://github.com/chorust/radiust/releases/download/v0.1.0/radiust-v0.1.0-macos-arm64.sha256
shasum -a 256 -c radiust-v0.1.0-macos-arm64.sha256
tar -xzf radiust-v0.1.0-macos-arm64.tar.gz
install -m 755 radiust "$HOME/.local/bin/radiust"
export PATH="$HOME/.local/bin:$PATH"
radiust --help

校验通过后再解压安装。若新终端找不到 radiust,将上述 export PATH 行加入 ~/.zshrc。此预览包未经过 Apple 公证,首次运行可能出现 Gatekeeper 提示;处理方式及适用范围见完整安装说明。

这个 v0.1.0 旧预览包不包含本次 0.1.1 的全部变化;当前版本可通过上方 PyPI 或 Cargo 命令安装。

从源码安装

准备上述源码构建工具后,在仓库根目录运行:

git clone https://github.com/chorust/radiust.git
cd radiust
cargo install --locked --path crates/radiust-cli

Python 源码安装使用 python -m pip install ".",可选科学依赖使用 python -m pip install ".[science]"。后续版本由 GitHub tag 发布流程构建、验证并上传;各平台的实际发布状态见安装说明。

Usage

Config

在运行命令的目录创建 config.yaml,设置联网、缓存和默认输出:

runtime:
  allow_network: true
  request_timeout: 30  # 单次请求超时,单位:秒

cache:
  enabled: true
  dir: ~/.cache/radiust

storage:
  output: ./data

output:
  format: netcdf
  grid: native

CLI 和 SDK 会自动读取当前目录的 config.yaml。通用配置可放在 ~/.config/radiust/config.yaml;当前目录配置覆盖其中的同名字段,RADIUST_ 环境变量再覆盖文件配置。也可显式指定文件并查看生效配置:

radiust --conf ./config.yaml config show
radiust --conf ./config.yaml discover rainviewer --latest

allow_network: true 允许连接上游;只想临时开启时,可在当前终端运行 export RADIUST_RUNTIME__ALLOW_NETWORK=true。省略 --output 和 --format 时,下载使用配置中的默认值。更多选项见完整示例和配置说明。

1. 查询来源与最新时次

配置好联网权限后,查看来源目录并查询最新资料:

radiust list sources
radiust discover rainviewer --latest --max-age 3600

--max-age 3600 筛选最近一小时的资料。报告中的时间为 UTC;latest 表示来源最新提供的帧,仍可能过期。凭据、浏览器或其他来源配置要求见数据来源文档。

2. 在终端查看最新雷达

# 查看 RainViewer 原始瓦片预览
radiust cat rainviewer --latest --raw

# 查看台湾 CWA 数值网格的反射率
radiust cat tw --product grid --latest --dbz

交互终端默认自动选择预览方式;重定向、脚本或只需元数据时加 --renderer text。--raw、--gray 和 --dbz 是不同模式,不根据图像外观自动推断。

3. 保存图像或数值资料

# PNG 图像及元数据
radiust download rainviewer --latest --format png --output ./data

# 数值反射率,同时保留同次获取的原始资料
radiust download tw --product grid --latest --format netcdf --raw --output ./data

# 只保存来源原始资料,不请求科学解码
radiust download tw-http --latest --station CV1_3600 --raw-only --output ./raw

下载报告会列出实际输出路径。同一帧已有完整输出时,再次下载会报告 skipped。数值产品也可用 --format geotiff 或 --format zarr;不同来源的科学与几何限制仍适用。自动化处理加 --json 获取结构化报告。

查看已有数值文件:

radiust cat --file ./reflectivity.nc --dbz --variable reflectivity --renderer text

本地灰度编码、多帧选取、批量发现、时间范围、缓存与配置的完整用法见CLI 文档;输出文件和清单规则见输出维护说明。

Python SDK

下面的示例连接 RainViewer,查询最新帧,读取数值场并下载 NetCDF:

from datetime import timedelta

import radiust

query = radiust.Query("rainviewer", latest=True, max_age=timedelta(hours=1))

with radiust.Client(config={"runtime": {"allow_network": True}}) as client:
    refs = client.discover(query)
    field = client.fetch(query)  # 获取并解码到内存
    report = client.download(
        query, output="./data", format="netcdf", raw=True,
    )

fetch() 返回 Rust 持有的 RadarField/RadarDataset;download() 写入正式输出。安装 science 可选依赖后,用 radiust.to_xarray(field) 转为 xarray。异步入口、批量、取消、本地 read_dbz() 和 write() 见SDK 文档。

项目与许可

Radiust 优先接入官方来源,也支持可靠、可追溯的第三方产品。当前先做好观测;Desktop 查看与播放、多源选择与回退、预测和跨来源拼图属于后续路线。

项目理念 · 发展路线与 Desktop 验收目标 · 架构 · 规格路线

软件采用标准 Apache-2.0,允许商业使用。上游数据的访问、署名、商用与再分发条件按来源另行记录,未确认项保持未确认;软件许可不替代数据授权。名称与标识的使用见品牌规则。

Dev

在仓库根目录安装开发依赖并运行检查:

uv sync --group dev
.venv/bin/ruff check python tests
cargo fmt --all -- --check
cargo test --workspace
.venv/bin/pytest -q

默认测试禁止公网。需要无网络样本试用时,见离线 quickstart。该文档包含历史迁移流程,当前安装方式以本文为准。live/provider、真实终端、远端存储与平台验收分别记录;离线测试通过不代表这些验收完成。迁移限制见迁移说明和 migration/blockers/。

Metadata

Release files for radiust 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for radiust 0.1.1
File
radiust-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
radiust-0.1.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
radiust-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
radiust-0.1.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
radiust-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
radiust-0.1.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
radiust-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
radiust-0.1.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 129.0 MB

Release files / radiust-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL radiust-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl
Size 17.7 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ccb3fc5dfafaf41bfefffa1926a9f005ef53020dcd9acb5dc557d1e234b6e130
BLAKE2b-256 checksum
How to use checksums
231d3f4ec3f0f9dcb415f0ce410f822d1555a22f2a52485835cb41346e46180b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / radiust-0.1.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL radiust-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
Size 14.5 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dc0f810358c867fc7d65145e9e9435ba1beadd99f6e7bd2a41dce0004a6f7da1
BLAKE2b-256 checksum
How to use checksums
b607a1110376b598f75dc87595016a19e5cb7ac320d490cad093b83dc2c8937b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / radiust-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL radiust-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl
Size 17.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9775362901dc934167a318db376209450d9a94429597d61d3bfa2c47d9f3705c
BLAKE2b-256 checksum
How to use checksums
acdc2beefa26e8f6f4caf0e037de907863fedca9b82584d05a42c78d596ed032
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / radiust-0.1.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL radiust-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Size 14.5 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6241020ab68a83e0a9fedd3c6c5da4f51793797a2f4b9e1f193a6408e5c4cc9f
BLAKE2b-256 checksum
How to use checksums
69db4df7d15a947ac1d6cf1d0d3242aa96ffca104778f4fae9b2e197985bf7ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / radiust-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL radiust-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 17.8 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
edbaca0cbc223c405925eaad835d272b66efc0510f9d51ba6946d231f868967f
BLAKE2b-256 checksum
How to use checksums
9e5c241756d5ba2340e375cfb2941155bd9c476cbb38101395ecf2c079bcf8f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / radiust-0.1.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL radiust-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Size 14.5 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e1a79ba27ea6918fdad980d5b6f44b456b7f52eec730024279738dcf01d3ccba
BLAKE2b-256 checksum
How to use checksums
d58df731073ea23139748a1be33fc5c8e49934badb8a87c405b055ba5beb356b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / radiust-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL radiust-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 17.8 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
19ccf210107dff6b72e88ebe65b7eaa8f23729d75ab85d999ae2a0fddff32163
BLAKE2b-256 checksum
How to use checksums
73a4ce8c4592a9c2e55706e8efae116dcabb119b6be43751cebd7c49d6c6c2f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / radiust-0.1.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL radiust-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Size 14.5 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b0c64e39d3540c515ed18d832abe4faf7c451acbaec405cf31a44245a3594d7e
BLAKE2b-256 checksum
How to use checksums
a1bc4893d9d441be9c9146da4fc7ef2bba10d81cf4886ebf81e70db50b236cb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release history Release notifications | RSS feed

0.1.7

8 release files

0.1.6

8 release files

0.1.5

8 release files

0.1.2

8 release files

This release

0.1.1 This release

8 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page