BiteAWX
国家卫星气象中心AWX格式文件读取库。
安装
pip install BiteAWX
第三方包依赖包括
numpy; xarray; pyproj; pillow; netCDF4
功能
- 查看各级头信息
- 读取原始数据块为numpy数组
- 读取为定标/未定标xarray数组
- 修改定标表
- 另存为netCDF4文件,可选是否定标、压缩
- 另存为图片
使用方式
from BiteAWX import AWX
path_awx = './test_data/ANI_IR2_R01_20230217_0800_FY2G.AWX'
awx = AWX(path_awx)
# 读取原始数据为np.ndarray
array = awx.values
# 读取原始数据为xarray.DataArray
da = awx.DataArray()
# 读取定标后为xarray.DataArray
da = awx.DataArray(calibrate=True)
# 查看定标表
calibration = awx.calibration
# 修改定标表
import numpy as np
calibration = np.arange(len(calibration)) * calibration[1]
awx.calibration = calibration
# 读取新定标后为xarray.DataArray
da = awx.DataArray(calibrate=True)
# 查看各级头信息
print(awx.head1, '\n')
print(awx.head2, '\n')
print(awx.head3)
# 另存为nerCDF4文件
# Windows下路径中不得有中文
awx.to_netcdf() # 在原AWX文件绝对路径后加`.nc`保存定标后数据
awx.to_netcdf(path='where/what.nc') # 指定路径和文件名
awx.to_netcdf(calibrate=False) # 不定标,定标表将存为`calibration`维度变量
awx.to_netcdf(complevel=1) # 压缩,complevel取值范围0-9,默认为0不压缩
# 另存为图片
awx.to_pic() # 在原AWX文件绝对路径后加`.jpg`保存
awx.to_pic(path='where/what.jpg') # 指定路径和文件名
注意
- 已测试数据有限,可能存在Bug,欢迎提issue
- 不要过于信任MICAPS4的显示范围,它的投影参数可能有问题
- 投影信息存储遵循CF-Conventions,所以暂时没有强制提供经纬度网格
- 暂不支持离散场产品数据的提取,但应当可以读取各级头信息
- 要素名称从三级头信息的sat2004文件名提取,否则默认为
Unknown
TODO
- 详细文档
- 增加强制提供经纬度网格的选项
- 增加作为xarray的backend
- 支持离散场产品数据
- 支持手动定义要素名
Metadata
Release files for BiteAWX 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| BiteAWX-1.0.0.tar.gz | 21.4 kB | Without provenance | Details for BiteAWX-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| BiteAWX-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for BiteAWX-1.0.0-py3-none-any.whl |
Total release size: 42.1 kB
Release files / BiteAWX-1.0.0.tar.gz
| Download URL | BiteAWX-1.0.0.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
527a545d05af209e1f1d9c6624c71c05df78ac9ad26ea58f25811979f1c69284
|
|
BLAKE2b-256 checksum How to use checksums |
e596f13df3dc70f6b6856cbae68368047cea40a50ae61b30e983ba5af00723ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.7
|
Release files / BiteAWX-1.0.0-py3-none-any.whl
| Download URL | BiteAWX-1.0.0-py3-none-any.whl |
|---|---|
| Size | 20.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8c93f872c506581660b5488f3124a0ca2ef97b627d357482a400a0cdd89221a
|
|
BLAKE2b-256 checksum How to use checksums |
ca3fff4128d2930ea3082a7ef7156226cd24cd9ae5111a17e19b325efebcd971
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.7
|
Security for BiteAWX 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.