python - Plotting satellite swath data using pyresample -
i trying plot full swath orbit of ascat ocean wind vectors , wvc quality flags using pyresample module. link ascat netcdf files can found here: ftp://podaac-ftp.jpl.nasa.gov/alldata/ascat/preview/l2/metop_a/12km/ documentation have read on module, not describe on how can find information within file satisfy geometry area definition. example code here below on plotting swath of satellite data
from netcdf4 import dataset import numpy np pyresample import image, geometry import pyresample pr
i extract lons, lats, & wvc_quality_flag netcdf file
area_id = 'ease_sh' name = 'antarctic ease grid' proj_id = 'ease_sh' proj4_args = 'proj=laea, lat_0=-90, lon_0=0, a=6371228.0, units=m' x_size = 425 y_size = 425 area_extent = (-5326849.0625,-5326849.0625,5326849.0625,5326849.0625) proj_dict = {'a': '6371228.0', 'units': 'm', 'lon_0': '0', 'proj': 'laea', 'lat_0': '-90'} area_def = geometry.areadefinition(area_id, name, proj_id, proj_dict, x_size,y_size, area_extent) swath_def = geometry.swathdefinition(lons=lon, lats=lat) result = pr.kd_tree.resample_nearest(swath_def, wvc_quality_flag, area_def, radius_of_influence=20000, fill_value=none) pr.plot.save_quicklook('/tmp/tb37v_pc.png', area_def, result, num_meridians=0, num_parallels=0, label='flags') attributeerror: 'module' object has no attribute 'plot'
first, error pyresample module not have attribute plot when documentation says , "area_def" never defined anywhere in ascat netcdf file. pyresample not plausible these type of files or not looking in proper place definitions within metadata of ascat file? clarification on module help! again!
there 2 questions here. first one, plot
submodule.
plot
submodule, , can imported here other submodules:
from pyresample import image, geometry, plot
second, target area definition defined on fly in block:
area_id = 'ease_sh' name = 'antarctic ease grid' proj_id = 'ease_sh' proj4_args = 'proj=laea, lat_0=-90, lon_0=0, a=6371228.0, units=m' x_size = 425 y_size = 425 area_extent = (-5326849.0625,-5326849.0625,5326849.0625,5326849.0625) proj_dict = {'a': '6371228.0', 'units': 'm', 'lon_0': '0', 'proj': 'laea', 'lat_0': '-90'} area_def = geometry.areadefinition(area_id, name, proj_id, proj_dict, x_size, y_size, area_extent)
the source swath definition defined as:
swath_def = geometry.swathdefinition(lons=lon, lats=lat)
and assume lon
, lat
arrays have been acquired prior resampling.
ps. yes, pyresample meant these kind of tasks. don't need meta data files swath data, longitudes , latitudes array sufficient.
Comments
Post a Comment