Giter VIP home page Giter VIP logo

sokort's Introduction

sokort

CEMC Graphics Script Tool

封装**气象局地球系统数值预报中心 (CEMC) 数值预报业务系统使用的图片制作脚本。

支持使用 NCL 和 Python 的部分绘图任务,目前已集成的业务系统如下:

  • CMA-GFS 全球预报系统 (cma_gfs)
  • CMA-MESO 区域预报系统 (cma_meso)
  • CMA-TYM 区域台风预报系统 (cma_tym)

安装

从 Github 项目主页下载最新的代码,并使用 pip 安装。

本项目不包含业务系统使用的任何图片库及图形绘制脚本,如果需要使用,请联系 CEMC。

推荐部署在 CMA-PI 高性能计算机或挂载二级存储的服务器上。

额外 Python 包

如果使用 CMA-PI 或二级存储中的数据自动查找功能,请安装下面 Python 包:

其他软件

需要使用到的系统软件:

  • NCL (绘图)
  • Matplotlib (绘图)
  • ImageMagick (图片转格式,裁剪图片)
  • ksh (执行脚本)

请使用操作系统软件管理器或 conda 安装。

配置

本项目使用配置文件设置业务系统绘图脚本库的位置,参看 config 文件夹。

在运行前使用 NWPC_GRAPHICS_CONFIG 环境变量设置主配置文件 config.yaml 的路径, 或者手动调用 load_config() 函数设置。

如果在 CMA-PI 中使用,可以直接使用 tool/cma-pi 下提供的预设配置文件和环境加载脚本。

使用

Jupyter Notebook

启动 Jupyter Notebook,执行下面代码。 绘制并显示 GRAPES GFS 全球预报系统 2021 年 7 月 11 日 00 时次 24 小时的整层可降水量。

from sokort import show_plot

show_plot("cma_gfs", "pwat_sfc_an_aea", "2021071100", "24h")

在 Jupyter Notebook 中运行效果如下图所示

更多 Jupyter Notebook 示例请浏览 example 目录。

命令行程序

本项目提供命令行接口。 下面的命令行代码绘制上面的示例,并调用系统默认的图片浏览器显示图片。

python -m sokort show \
    --system=cma_gfs \
    --plot-type=pwat_sfc_an_aea \
    --start-time=2021071100 \
    --forecast-time=24h

LICENSE

Copyright 2020-2023, perillaroc at cemc-oper。

sokortApache License, Version 2.0 协议授权。

本项目涉及的数值预报业务系统及图片制作脚本版权均属于 CEMC。

sokort's People

Contributors

perillaroc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

netgodz

sokort's Issues

在config文件中设置临时运行目录

当前在 /tmp 中生成临时目录,不方便直接在CMA-PI上使用。
在 config 文件中增加 run_base_dir 条目,设置生成临时目录的根目录。

使用 tempfile 自动生成目录名或者 uuid 手动生成目录名。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.