Skip to content

Instantly share code, notes, and snippets.

@kiichi
Last active May 8, 2016 16:21
Show Gist options
  • Select an option

  • Save kiichi/f72eb66ae247559f5cb42ce20b68f7db to your computer and use it in GitHub Desktop.

Select an option

Save kiichi/f72eb66ae247559f5cb42ce20b68f7db to your computer and use it in GitHub Desktop.
PyArt Examples
import pyart
import numpy as np
radar = pyart.io.read_nexrad_level3("data/SI.kokx/sn.last")
for i in range(0,radar.nrays):
row = radar.fields['reflectivity']['data'][i]
#get index of unmask items
idx=np.where(~row.mask)
dbz = row[idx]
lat = radar.gate_latitude['data'][i][idx]
lng = radar.gate_longitude['data'][i][idx]
data = np.dstack((lat,lng,dbz))[0]
print data
'''
>>> data
masked_array(data =
[[ 40.8474248 -72.86893844 -20. ]
[ 40.83863715 -72.87140667 -16. ]
[ 40.82984946 -72.87387424 -12. ]
[ 40.82106174 -72.87634115 -16. ]
[ 40.81227399 -72.8788074 -8. ]
[ 40.80348621 -72.88127299 -16. ]
[ 40.79469839 -72.88373793 -12. ]
[ 40.78591054 -72.8862022 -12. ]
[ 40.77712266 -72.88866582 -8. ]
[ 40.76833474 -72.89112878 -12. ]
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment