Skip to main content

我自己的工具箱

Project description

写在前面

我自己写的工具箱,没有api文档的,想看函数功能就直接看函数定义时的注释吧,还挺详细的

python代码功能

# 示例1,读取WRF变量计算天顶角
from szh_toolbox import get_zenith_angle
WRFfile = 'wrfout_d01_2021-07-22_04:00:00'
Longitude = getwrfvar(WRFfile, 'XLONG')
Latitude = getwrfvar(WRFfile, 'XLAT')
z2 = get_zenith_angle(123,0,35786,Longitude, Latitude)
# 示例2,实现namelist文件和python对象的相互转化
import szh_toolbox.namelist as nl
# config是python字典对象
config = nl.load("data/namelist.input")
print(nl.dump(config))
# 示例3,实现shell脚本中变量定义赋值的替换
from szh_toolbox import ShellScriptVariable
# 类功能展示
ssv = ShellScriptVariable('data/myshell.sh')
ssv.show()
ssv.update('a', '这是A', 0)
ssv.update('d', '"这是 D"')
ssv.show()
ssv.save('data/myshell2.sh')
# 一行代码替换变量
ShellScriptVariable.modify('data/myshell.sh', 'a', '这是A', 'data/myshell3.sh')

命令行工具

也就是可以直接在命令行里执行的代码

# 直接打印namelist.wps文件定义的区域的范围
st-wps
st-wps namelist.wps
# 下载noaa的数据比如ATMS L1
st-noaa -h
st-noaa orderId -o savepath

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

szh_toolbox-0.0.10.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

szh_toolbox-0.0.10-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file szh_toolbox-0.0.10.tar.gz.

File metadata

  • Download URL: szh_toolbox-0.0.10.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for szh_toolbox-0.0.10.tar.gz
Algorithm Hash digest
SHA256 8ed7c1e71396e11283ecdbbdad5e7d1cdccb32212415dc6f7b0b7e83ac811e24
MD5 076d9bede5f92366f12276c058146e11
BLAKE2b-256 2e9dd5804e535bfdebfb22790724cf89ae5d560b9b30e99df1047d73b90e6382

See more details on using hashes here.

File details

Details for the file szh_toolbox-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for szh_toolbox-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 49c53a694fc885b73cf0cf5580fb33f34f6366263b091516f15d2ddfd082803a
MD5 8fc04d9db6126eaea9a4da5babd783d1
BLAKE2b-256 5ff9b7d5944bcad091eed4336ed869916b40764eac27786ddb359ab077567ec3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page