# cedar-graph
使用 cedarkit-maps 开发的绘图示例包。
## 快速绘图
绘制 2 米温度填充图
```py
from cedar_graph.quickplot import quick_plot
plot_type = "cn.t_2m.default"
plot_settings = dict(
system_name="CMA-GFS",
start_time="2024073000",
forecast_time="48h",
)
quick_plot(
plot_type=plot_type,
**plot_settings,
)
```
绘制区域 10 米风场填充图
```py
from cedar_graph.quickplot import quick_plot
from cedarkit.maps.util import AreaRange
plot_type = "cn.wind_10m.default"
plot_settings = dict(
system_name="CMA-MESO",
start_time="2024073000",
forecast_time="48h",
area_name="NorthEast",
area_range=AreaRange.from_tuple((108, 137, 37, 55))
)
quick_plot(
plot_type=plot_type,
**plot_settings,
)
```
## 绘图模块
使用绘图模块的函数和类实现图形绘制
```py
import pandas as pd
from cedar_graph.plots.cn.t_2m.default import PlotMetadata, plot, load_data
from cedar_graph.data import LocalDataSource, DataLoader
system_name = "CMA-MESO"
start_time = pd.to_datetime("2024-07-17 00:00:00")
forecast_time = pd.to_timedelta("24h")
metadata = PlotMetadata(
start_time=start_time,
forecast_time=forecast_time,
system_name=system_name
)
# system -> field
data_source = LocalDataSource(system_name=system_name)
data_loader = DataLoader(data_source=data_source)
plot_data = load_data(
data_loader=data_loader,
start_time=start_time,
forecast_time=forecast_time
)
# field -> plot
panel = plot(
plot_data=plot_data,
plot_metadata=metadata,
)
# plot -> output
panel.show()
```
## 绘图清单
| 类别 | 名称 | 说明 |
|----|---------------------|---------------------------|
| 常规 | | |
| | height_500_mslp | 500hPa高度场+海平面气压 |
| | height_500_wind_850 | 500hPa高度场+850hPa风场 |
| | t_2m | 2米温度 |
| | wind_10m | 10米风场 |
| 诊断 | | |
| | radar_reflectivity | 雷达组合反射率 |
| | div_wind | 散度+风场 |
| | k_wind | K指数+风场 |
| | cin_wind | CIN+风场 |
| | cape_wind | CAPE+风场 |
| | bpli_wind | 最优抬升指数+风场 |
| | pte_wind | 500hPa与850hPa假相当位温之差+风场 |
| | qv_div | 水汽通量散度 |
| | shr | 垂直风切变 (0-1km/0-3km/0-6km) |
| | t_dew_t | 温度和露点差 |
| 降水 | | |
| | prep_24h | 24小时降水 (多相态) |
| | rain_24h | 24小时降水 |
| | rain_wind_10m | 1/3/6/12/24小时降水+10米风场 |
## LICENSE
Copyright © 2024, developers at cemc-oper.
`cedar-graph` is licensed under [Apache License V2.0](./LICENSE)
Raw data
{
"_id": null,
"home_page": null,
"name": "cedar-graph",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "graphic, cemc, cedarkit",
"author": null,
"author_email": "Wang Dapeng <perillaroc@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/1a/9f/f935b6566fac57016baab4b4356a2e0db7f9ded68c9216f4cd077dde4f20/cedar_graph-2024.10.0.tar.gz",
"platform": null,
"description": "# cedar-graph\n\n\u4f7f\u7528 cedarkit-maps \u5f00\u53d1\u7684\u7ed8\u56fe\u793a\u4f8b\u5305\u3002\n\n## \u5feb\u901f\u7ed8\u56fe\n\n\u7ed8\u5236 2 \u7c73\u6e29\u5ea6\u586b\u5145\u56fe\n\n```py\nfrom cedar_graph.quickplot import quick_plot\n\nplot_type = \"cn.t_2m.default\"\nplot_settings = dict(\n system_name=\"CMA-GFS\",\n start_time=\"2024073000\",\n forecast_time=\"48h\",\n)\n\nquick_plot(\n plot_type=plot_type,\n **plot_settings,\n)\n```\n\n\u7ed8\u5236\u533a\u57df 10 \u7c73\u98ce\u573a\u586b\u5145\u56fe\n\n```py\nfrom cedar_graph.quickplot import quick_plot\nfrom cedarkit.maps.util import AreaRange\n\nplot_type = \"cn.wind_10m.default\"\nplot_settings = dict(\n system_name=\"CMA-MESO\",\n start_time=\"2024073000\",\n forecast_time=\"48h\",\n area_name=\"NorthEast\",\n area_range=AreaRange.from_tuple((108, 137, 37, 55))\n)\n\nquick_plot(\n plot_type=plot_type,\n **plot_settings,\n)\n```\n\n## \u7ed8\u56fe\u6a21\u5757\n\n\u4f7f\u7528\u7ed8\u56fe\u6a21\u5757\u7684\u51fd\u6570\u548c\u7c7b\u5b9e\u73b0\u56fe\u5f62\u7ed8\u5236\n\n```py\nimport pandas as pd\n\nfrom cedar_graph.plots.cn.t_2m.default import PlotMetadata, plot, load_data\nfrom cedar_graph.data import LocalDataSource, DataLoader\n\nsystem_name = \"CMA-MESO\"\nstart_time = pd.to_datetime(\"2024-07-17 00:00:00\")\nforecast_time = pd.to_timedelta(\"24h\")\n\nmetadata = PlotMetadata(\n start_time=start_time,\n forecast_time=forecast_time,\n system_name=system_name\n)\n\n# system -> field\ndata_source = LocalDataSource(system_name=system_name)\ndata_loader = DataLoader(data_source=data_source)\nplot_data = load_data(\n data_loader=data_loader, \n start_time=start_time, \n forecast_time=forecast_time\n)\n \n# field -> plot\npanel = plot(\n plot_data=plot_data,\n plot_metadata=metadata,\n)\n\n# plot -> output\npanel.show()\n```\n\n## \u7ed8\u56fe\u6e05\u5355\n\n| \u7c7b\u522b | \u540d\u79f0 | \u8bf4\u660e |\n|----|---------------------|---------------------------|\n| \u5e38\u89c4 | | |\n| | height_500_mslp | 500hPa\u9ad8\u5ea6\u573a+\u6d77\u5e73\u9762\u6c14\u538b |\n| | height_500_wind_850 | 500hPa\u9ad8\u5ea6\u573a+850hPa\u98ce\u573a |\n| | t_2m | 2\u7c73\u6e29\u5ea6 |\n| | wind_10m | 10\u7c73\u98ce\u573a |\n| \u8bca\u65ad | | |\n| | radar_reflectivity | \u96f7\u8fbe\u7ec4\u5408\u53cd\u5c04\u7387 |\n| | div_wind | \u6563\u5ea6+\u98ce\u573a |\n| | k_wind | K\u6307\u6570+\u98ce\u573a |\n| | cin_wind | CIN+\u98ce\u573a |\n| | cape_wind | CAPE+\u98ce\u573a |\n| | bpli_wind | \u6700\u4f18\u62ac\u5347\u6307\u6570+\u98ce\u573a |\n| | pte_wind | 500hPa\u4e0e850hPa\u5047\u76f8\u5f53\u4f4d\u6e29\u4e4b\u5dee+\u98ce\u573a |\n| | qv_div | \u6c34\u6c7d\u901a\u91cf\u6563\u5ea6 |\n| | shr | \u5782\u76f4\u98ce\u5207\u53d8 (0-1km/0-3km/0-6km) |\n| | t_dew_t | \u6e29\u5ea6\u548c\u9732\u70b9\u5dee |\n| \u964d\u6c34 | | |\n| | prep_24h | 24\u5c0f\u65f6\u964d\u6c34 (\u591a\u76f8\u6001) |\n| | rain_24h | 24\u5c0f\u65f6\u964d\u6c34 |\n| | rain_wind_10m | 1/3/6/12/24\u5c0f\u65f6\u964d\u6c34+10\u7c73\u98ce\u573a |\n\n\n## LICENSE\n\nCopyright © 2024, developers at cemc-oper.\n\n`cedar-graph` is licensed under [Apache License V2.0](./LICENSE)\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Plot tool for CEMC.",
"version": "2024.10.0",
"project_urls": {
"Homepage": "https://github.com/cemc-oper/cedar-graph",
"Repository": "https://github.com/cemc-oper/cedar-graph.git"
},
"split_keywords": [
"graphic",
" cemc",
" cedarkit"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "090bfbdb38cb9ce832b8693a7b7153661d58c42a1e58b52132856378d7557760",
"md5": "a0e13bb27efa9bca43824f0c6ecf8c52",
"sha256": "109fa6df7bd4c013640862eac5c8d03f041a430377db3137c818742eeea959ba"
},
"downloads": -1,
"filename": "cedar_graph-2024.10.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a0e13bb27efa9bca43824f0c6ecf8c52",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 44479,
"upload_time": "2024-10-12T12:31:40",
"upload_time_iso_8601": "2024-10-12T12:31:40.661358Z",
"url": "https://files.pythonhosted.org/packages/09/0b/fbdb38cb9ce832b8693a7b7153661d58c42a1e58b52132856378d7557760/cedar_graph-2024.10.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1a9ff935b6566fac57016baab4b4356a2e0db7f9ded68c9216f4cd077dde4f20",
"md5": "3a48ac9bc43d1091e039705ed1b0533e",
"sha256": "c35314fa80e975f0ce9dfed9d8cffb16a99269de5073b7fe8e563f173e6d0d4e"
},
"downloads": -1,
"filename": "cedar_graph-2024.10.0.tar.gz",
"has_sig": false,
"md5_digest": "3a48ac9bc43d1091e039705ed1b0533e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 29099,
"upload_time": "2024-10-12T12:31:41",
"upload_time_iso_8601": "2024-10-12T12:31:41.658639Z",
"url": "https://files.pythonhosted.org/packages/1a/9f/f935b6566fac57016baab4b4356a2e0db7f9ded68c9216f4cd077dde4f20/cedar_graph-2024.10.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-12 12:31:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cemc-oper",
"github_project": "cedar-graph",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cedar-graph"
}