Skip to main content

AWX Satellite Data Reader

Project description

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

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

awx-0.1.1.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

awx-0.1.1-py3-none-any.whl (4.5 MB view details)

Uploaded Python 3

File details

Details for the file awx-0.1.1.tar.gz.

File metadata

  • Download URL: awx-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for awx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fdc9c83c6c4ab6ff834f37fe25d9d73552e0ef3fd7b8e19e944d83828b39ba03
MD5 948da6171d5ce49f329fb054bb14e0ac
BLAKE2b-256 8bf4596042ccc8067d383daff419405daaf3e94331462f5b9e5d94cf0bc043f5

See more details on using hashes here.

File details

Details for the file awx-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: awx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for awx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 22b6767df58172a077abc16b2ac5d92a8a1d735cfddb71a728a01f6acc402810
MD5 b76325529f96f0640792c2511ae8c3e8
BLAKE2b-256 a2e823b328efcdc6c63f92afe071eca6b286aa59cd59d154937e0eed697d586a

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