Skip to content
Snippets Groups Projects
Commit b6358136 authored by Greg Quinn's avatar Greg Quinn
Browse files

show_cv.py: allow plotting multiple VIIRS granules

parent 9b5d90b8
No related branches found
No related tags found
No related merge requests found
......@@ -10,22 +10,24 @@ def main():
f = h5py.File(sys.argv[1], 'r')
g = f['All_Data']['CrIS-SDR-GEO_All']
lat = g['Latitude'][:,:,4]
lon = g['Longitude'][:,:,4]
lat = g['Latitude'][2:-2,:,4]
lon = g['Longitude'][2:-2,:,4]
b = Basemap(projection='ortho', lon_0=mid(lon), lat_0=mid(lat))
b.plot(*b(mask(outline(lon)), mask(outline(lat))))
b.plot(*b(mask(outline(lon)), mask(outline(lat))), color='b')
f = h5py.File(sys.argv[2], 'r')
g = f['All_Data']['VIIRS-MOD-GEO-TC_All']
lat = g['Latitude'][:]
lon = g['Longitude'][:]
b.plot(*b(mask(outline(lon)), mask(outline(lat))))
for gmtco_file in sys.argv[2:]:
f = h5py.File(gmtco_file, 'r')
g = f['All_Data']['VIIRS-MOD-GEO-TC_All']
lat = g['Latitude'][:]
lon = g['Longitude'][:]
b.plot(*b(mask(outline(lon)), mask(outline(lat))), color='g')
b.drawcoastlines()
b.drawmapboundary()
plt.show()
def mid(a):
idx = tuple(np.array(a.shape) / 2)
return a[idx]
......@@ -35,7 +37,8 @@ def outline(a):
def mask(a):
return np.ma.masked_array(a, a == -9999.0)
return np.ma.masked_array(a, a < -200.0)
if __name__ == '__main__':
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment