Skip to main content

python reader for satellite product format data (.AWX)

This package provide a user-friendly interface to AWX data, it can read 3 type AWX, that is

  • Product Type 1, geostationary satellite image product
  • Product Type 2, polar orbiting satellite image product
  • Product Type 3, Grid product

README

Install

install from pypi

pip install awx

Quick Start

Basic usage for library

1 Read data, access data values, slicing longitude and latitude and save to netCDF

import os
from awx import Awx

pathfile = r'../data/ANI_VIS_R02_20230217_1000_FY2G.AWX'
ds = Awx(pathfile)

# print file head information
print(ds)

# get satellite observation data in xarray.DataArray format
print(ds.values)

# clip data to given longitude and latitude extent
print(ds.sel(lat=slice(20, 40), lon=slice(100, 130)))

# save data to netcdf4
ds.values.to_netcdf('ANI_VIS_R02_20230217_1000_FY2G.nc')

2 Basic draw data without projection

# draw data use matplotlib

import matplotlib.pyplot as plt
from awx import Awx

fpath = r'./data/ANI_VIS_R02_20230217_1000_FY2G.AWX'
ds = Awx(pathfile=fpath)
print(ds)
dar = ds.values.squeeze()
plt.pcolormesh(dar.lon, dar.lat, dar, cmap='Greys_r')
plt.savefig('ANI_VIS_R02_20230217_1000_FY2G_NoProj.png', dpi=300)
plt.show()

ANI_VIS_R02_20230217_1000_FY2G_NoProj.png

3 Draw data in native projection

# draw data in projection coordination
import os
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from awx import Awx

# fpath = r'./data/ANI_VIS_R02_20230217_1000_FY2G.AWX'  # Mercator
fpath = r'./data/ANI_IR2_R01_20230217_0800_FY2G.AWX'  # lambert
ds = Awx(pathfile=fpath)
print(ds)
dar = ds.values.squeeze()

plt.figure(figsize=(8, 8))

if dar.projection == 1:
    proj = ccrs.LambertConformal(central_longitude=dar.clon / 100,
                                 central_latitude=dar.clat / 100,
                                 standard_parallels=(dar.std_lat1_or_lon / 100.,
                                                     dar.std_lat2 / 100.))
    extent = [dar.x.min(), dar.x.max(), dar.y.min(), dar.y.max()]
elif dar.projection == 2:
    proj = ccrs.Mercator(central_longitude=dar.clon / 100,
                         latitude_true_scale=dar.std_lat1_or_lon / 100.)
    extent = [dar.x.min(), dar.x.max(), dar.y.min(), dar.y.max()]
elif dar.projection == 4:
    proj = ccrs.PlateCarree(central_longitude=dar.clon / 100.)
    extent = [dar.lon.min(), dar.lon.max(), dar.lat.min(), dar.lat.max()]
else:
    raise NotImplementedError()
ax = plt.axes(projection=proj)
ax.set_extent(extent, crs=proj)
ax.coastlines(resolution='110m')
ax.gridlines(draw_labels=True)
ax.pcolormesh(dar.x, dar.y, dar, cmap='Greys_r')
plt.savefig(os.path.splitext(os.path.basename(fpath))[0] + '.png', dpi=300, bbox_inches='tight')
plt.show()

ANI_VIS_R02_20230217_1000_FY2G.png

ANI_IR2_R01_20230217_0800_FY2G.png

Command line procedure

awx_info

Print AWX file head information

Usage:

awx_info AWX_File_Name

Example:

awx_info FY2G_TBB_IR1_OTG_20150729_0000.AWX

awx_to_nc

Convert AWX file to netCDF4 file

Usage:

awx_to_nc AWX_File_Name NetCDF_File_Name

Example:

awx_to_nc FY2G_TBB_IR1_OTG_20150729_0000.AWX FY2G_TBB_IR1_OTG_20150729_0000.nc

Metadata

Release files for awx 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awx 0.1.1
File Size Uploaded Provenance
awx-0.1.1.tar.gz 3.0 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for awx 0.1.1
File Interpreter ABI Platform
awx-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.5 MB

Release files / awx-0.1.1.tar.gz

Download URL awx-0.1.1.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
fdc9c83c6c4ab6ff834f37fe25d9d73552e0ef3fd7b8e19e944d83828b39ba03
BLAKE2b-256 checksum
How to use checksums
8bf4596042ccc8067d383daff419405daaf3e94331462f5b9e5d94cf0bc043f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.12

Release files / awx-0.1.1-py3-none-any.whl

Download URL awx-0.1.1-py3-none-any.whl
Size 4.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
22b6767df58172a077abc16b2ac5d92a8a1d735cfddb71a728a01f6acc402810
BLAKE2b-256 checksum
How to use checksums
a2e823b328efcdc6c63f92afe071eca6b286aa59cd59d154937e0eed697d586a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.12

Security for awx 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page