写在前面
我自己写的工具箱,没有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
Release files for szh_toolbox 0.0.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| szh_toolbox-0.0.18.tar.gz | 14.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| szh_toolbox-0.0.18-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.7 kB
Release files / szh_toolbox-0.0.18.tar.gz
| Download URL | szh_toolbox-0.0.18.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0eae9265e66cef15d8c062e62eb56d783b4f530b22f73df8548ff9f9e66a3ec1
|
|
BLAKE2b-256 checksum How to use checksums |
4a01eda227c28c7003eb9309125ae06589a54e5e0d0fc573bd57854a7b5b915b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|
Release files / szh_toolbox-0.0.18-py3-none-any.whl
| Download URL | szh_toolbox-0.0.18-py3-none-any.whl |
|---|---|
| Size | 17.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1aa702f5702cc2e9fd314d5af4622cd6a8c4fc7a92199569b084c1c27a0019aa
|
|
BLAKE2b-256 checksum How to use checksums |
e384386860542a9dafed82e9508651db3fb6930674918399c82f392009084287
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|