metno/edrisobaric

GitHub: metno/edrisobaric

该项目是一个基于 OGC EDR 标准的等压面气象数据 API 示例,将 GRIB 格式的天气数据转换为可通过坐标查询的垂直大气剖面数据服务。

Stars: 5 | Forks: 1

# EDR-isobaric ![Logo](/img/pressure_9189764.png "Logo") ## 什么是 EDR-isobaric? EDR-isobaric 是一个用于处理等压面数据(等压层中的温度和风)的 API。该 API 基于 [OGC Environmental Data Retrieval (EDR)](https://ogcapi.ogc.org/edr/)。数据源是来自 的 [GRIB](https://en.wikipedia.org/wiki/GRIB) 文件。 最终的 API 专为需要单一位置垂直环境数据的用户而设计。 这段代码是作为示例编写的,主要面向 Met.no 的 API 开发者。 生成的结果数据可以粘贴到 [covjson playground](https://covjson.org/playground) 中进行可视化: ![playground](/img/playground.png "playground") 数据源覆盖的区域: ![playground](/img/extent.jpg "extent") [![代码检查:pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint) [![代码风格:black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![安全性:bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit) [![许可证:MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/metno/edrisobaric/blob/main/LICENSE) ## 谁负责维护? - met.no 的 larsfp ## 状态 功能已完成。 ## 开始使用 ### 试运行 选择以下方式之一: #### 从 Github registry 拉取镜像并使用 docker 运行 ``` docker pull ghcr.io/metno/edrisobaric:main docker run -it --rm --publish 5000:5000 ghcr.io/metno/edrisobaric:main --bind_host 0.0.0.0 ``` #### 使用 Uv 构建 克隆仓库并运行(需要 eccodes lib): ``` uv venv uv sync uv run edriso/app.py ``` #### Web - 测试实例可访问 。 - 可以使用以下工具测试合规性 - https://github.com/metno/sedr - https://ogcbrowser.rauhala.app/ ## 用法 如果未提供 grib 数据文件,系统将按需下载。 启动应用程序将提供以下 URL: - 落地页: - Openapi spec: - SwaggerUI: - Redoc: 位置查询示例: - 支持的参数: ``` usage: app.py [-h] [--time TIME] [--file FILE] [--base_url BASE_URL] [--bind_host BIND_HOST] [--api_url API_URL] [--data_path DATA_PATH] options: -h, --help show this help message and exit --time TIME Timestamp to fetch data for. Must be in format 2024-01-24T18:00:00Z, where time matches an available production. See for available files. They are produced every 3rd hour. Example: --datetime="2024-01-24T18:00:00Z" --file FILE Local grib file to read data from. Default will fetch file from API. --base_url BASE_URL Base URL for API, with a trailing slash. Default is http://localhost:5000/ --bind_host BIND_HOST Which host to bind to. Default is 127.0.0.1. Use 0.0.0.0 when running in container. --api_url API_URL URL to download grib file from. Default is . --data_path DATA_PATH Where to store data files. Default is ./data ``` ### 用于生产环境 这仅用于学习目的。请按照[试运行](#test-it-out)中的说明使用。 ## 架构概述 - [C4 架构图](docs/C4.md) ## 文档 - 基于由 [KNMI](https://github.com/KNMI/) 开发的 Pydantic EDR 和 covjson 库 - 除非重启,否则此应用程序不会下载_新_数据。 - [输出示例](docs/Output.md) ### 测试 该项目经过了严格的测试,旨在为 API 开发者和 [sedr](https://github.com/metno/sedr) 提供示例。 - 每次 commit 到内部 [gitlab](https://gitlab.met.no/team-punkt/hydra/lekestue/edrisobaric/-/blob/main/.gitlab-ci.yml) 时都会测试此 API - 每次 commit 到公共 [github](https://gitlab.met.no/team-punkt/hydra/lekestue/edrisobaric/-/blob/main/.github/workflows/tests.yml?ref_type=heads) 时都会测试此 API - 要运行测试,请使用 `uvx tox`。该命令不会在容器中运行,因此需要安装 eccodes lib。 ### 用于对比的其他 API - - - - ### 参考资料与致谢 - 图标来自 [freepik.com](https://www.freepik.com/icon/pressure_9189764#fromView=search&term=air+preassure&track=ais&page=1&position=49&uuid=c5d25f23-4efd-4063-b6ec-2ab35db07d62) - - ## 如何贡献 - Issues ## 模板 - 本文档基于 [Met-norway-readme](https://gitlab.met.no/maler/met-norway-readme)-模板。 - Gitlab-ci 基于 [team-punkt gitlab-ci](https://gitlab.met.no/team-punkt/gitlab-ci/config)
标签:GRIB, OGC规范, Python, 无后门, 气象数据API, 环境数据检索, 等压面数据, 请求拦截, 逆向工具