Plot of radar reflectivity from AUS2200 with a black and white terrain underneath.ΒΆ
Plots terrain height in black and white by reading in the AUS2200 terrain data and then overlays a plot of radar reflectivity (DBz) for a single time.
[9]:
import xarray as xr
import numpy as np
import datetime
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import cmocean.cm as cmo
import os, datetime
from sys import exit, argv
import matplotlib.pyplot as plt
%matplotlib inline
[10]:
from dask.distributed import Client
from glob import glob
import xarray as xr
[11]:
flist=sorted(glob('/g/data/v45/cc6171/experiments/ECL-2016_smallshift/netcdf/u-cs142/2016060*T*Z/aus2200/d0198/RA3/um/umnsa_spec_*.nc'))
[ ]:
client=Client()
[13]:
client
[13]:
Client
Client-77e94147-636a-11ef-8840-000007d7fe80
| Connection method: Cluster object | Cluster type: distributed.LocalCluster |
| Dashboard: /proxy/34795/status |
Cluster Info
LocalCluster
19fd44b2
| Dashboard: /proxy/34795/status | Workers: 13 |
| Total threads: 52 | Total memory: 248.00 GiB |
| Status: running | Using processes: True |
Scheduler Info
Scheduler
Scheduler-7d8603db-a247-48e9-b51d-a7b1b2fadd0d
| Comm: tcp://127.0.0.1:45241 | Workers: 13 |
| Dashboard: /proxy/34795/status | Total threads: 52 |
| Started: Just now | Total memory: 248.00 GiB |
Workers
Worker: 0
| Comm: tcp://127.0.0.1:39307 | Total threads: 4 |
| Dashboard: /proxy/38625/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:40987 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-_b1v_7li | |
Worker: 1
| Comm: tcp://127.0.0.1:44277 | Total threads: 4 |
| Dashboard: /proxy/46269/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:40913 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-9un2qo_e | |
Worker: 2
| Comm: tcp://127.0.0.1:40411 | Total threads: 4 |
| Dashboard: /proxy/45235/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:41899 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-jd82hl0p | |
Worker: 3
| Comm: tcp://127.0.0.1:34933 | Total threads: 4 |
| Dashboard: /proxy/38061/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:38419 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-d379jgc5 | |
Worker: 4
| Comm: tcp://127.0.0.1:37355 | Total threads: 4 |
| Dashboard: /proxy/39933/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:40871 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-yahxd8ln | |
Worker: 5
| Comm: tcp://127.0.0.1:33881 | Total threads: 4 |
| Dashboard: /proxy/43149/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:36219 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-1ramuokf | |
Worker: 6
| Comm: tcp://127.0.0.1:40061 | Total threads: 4 |
| Dashboard: /proxy/40809/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:34707 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-wgpu9m8o | |
Worker: 7
| Comm: tcp://127.0.0.1:34835 | Total threads: 4 |
| Dashboard: /proxy/39603/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:42437 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-5k_pjljj | |
Worker: 8
| Comm: tcp://127.0.0.1:34775 | Total threads: 4 |
| Dashboard: /proxy/42139/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:36751 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-lv5eory9 | |
Worker: 9
| Comm: tcp://127.0.0.1:37033 | Total threads: 4 |
| Dashboard: /proxy/40825/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:42299 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-o_j5tskf | |
Worker: 10
| Comm: tcp://127.0.0.1:42773 | Total threads: 4 |
| Dashboard: /proxy/41671/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:39621 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-zneq49un | |
Worker: 11
| Comm: tcp://127.0.0.1:46845 | Total threads: 4 |
| Dashboard: /proxy/41861/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:33449 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-uyy1eq9o | |
Worker: 12
| Comm: tcp://127.0.0.1:41341 | Total threads: 4 |
| Dashboard: /proxy/43645/status | Memory: 19.08 GiB |
| Nanny: tcp://127.0.0.1:39263 | |
| Local directory: /jobfs/123733380.gadi-pbs/dask-worker-space/worker-utmlrlmi | |
[14]:
ds = xr.open_mfdataset(flist,parallel=True,preprocess=lambda x: x['fld_s04i111'])
dbz=ds['fld_s04i111']
#try opening a second dataset containing landmask for plotting coasts
datafile2 = '/g/data/v45/cc6171/experiments/ECL-2016_smallshift/netcdf/u-cs142/20160603T0000Z/aus2200/d0198/RA3/um/umnsaa_pa000.nc'
#bring in landmask from second file
landmask = ds2.fld_s00i030
#bring in topography from second file
topo = ds2.fld_s00i033
#
x = ds.lat
y = ds.lon
# TERRAIN PLOT UNDERNEATH
vmn = -500
vmx = 1500
interval = 100
tcks = np.arange(vmn,vmx+interval,interval)
lvl = np.arange(vmn,vmx+interval,interval)
colormap = cm.gray
fig,ax=plt.subplots(1,1)
cp = ax.contourf(y,x,topo[1,:,:],cmap=colormap,levels=lvl,vmin=vmn,vmax=vmx,extend='max')
#END TERRAIN PLOT
vmn = 0
vmx = 70
interval = 5
tcks = np.arange(vmn,vmx+interval,interval)
lvl = np.arange(vmn,vmx+interval,interval)
colormap = cm.hsv_r
cp = ax.contourf(y,x,dbz[100,:,:],cmap=colormap,levels=lvl,vmin=vmn,vmax=vmx,extend='max')
plt.rcParams['lines.linewidth'] = 0.1
cp2 = ax.contour(y,x,landmask[1,:,:],colors='k')
cbar_ax = fig.add_axes([0.25, 0.01, 0.5, 0.04])
cbar = fig.colorbar(cp, cax=cbar_ax, orientation='horizontal', label= 'Dbz', ticks=tcks, shrink=0.8)
plt.show()
[ ]: