Skip to content

Commit a14da15

Browse files
authored
MNT: fix deprecated keywords etc for wradlib v 1.4.0 (#31)
1 parent 3290e67 commit a14da15

9 files changed

+38
-34
lines changed

notebooks/classify/wradlib_2d_hmc.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
"fig = pl.figure(figsize=(8, 7))\n",
353353
"cmap = mpl.cm.viridis\n",
354354
"cgax, im = wrl.vis.plot_rhi(bheight/1000., r=r/1000., th=el, \n",
355-
" cg=True, cmap=cmap,\n",
355+
" proj='cg', cmap=cmap,\n",
356356
" ax=111, fig=fig)\n",
357357
"cbar = pl.colorbar(im, fraction=0.046, pad=0.1)\n",
358358
"cbar.set_label('Height [km]')\n",
@@ -396,7 +396,7 @@
396396
"source": [
397397
"fig = pl.figure(figsize=(10,5))\n",
398398
"cgax, im = wrl.vis.plot_rhi(rtemp, r=r/1000., th=el, \n",
399-
" cg=True, cmap=cmap,\n",
399+
" proj='cg', cmap=cmap,\n",
400400
" ax=111, fig=fig)\n",
401401
"cbar = pl.colorbar(im, fraction=0.046, pad=0.1)\n",
402402
"cbar.set_label('Temperature [°C]')\n",
@@ -545,7 +545,7 @@
545545
"for i, c in enumerate(prob):\n",
546546
" cgax, im = wrl.vis.plot_rhi(np.ma.masked_less_equal(c, 0.),\n",
547547
" r=r/1000., th=el,\n",
548-
" cg=True,\n",
548+
" proj='cg',\n",
549549
" ax=gs[i], fig=fig)\n",
550550
" cbar = pl.colorbar(im, fraction=0.046, pad=0.15)\n",
551551
" cbar.set_label('Probability')\n",
@@ -574,7 +574,7 @@
574574
"source": [
575575
"fig = pl.figure(figsize=(10, 8))\n",
576576
"cgax, im = wrl.vis.plot_rhi(hmc_vals[11], ax=111, \n",
577-
" cg=True, \n",
577+
" proj='cg', \n",
578578
" r=r/1000., th=el,\n",
579579
" cmap='cubehelix', fig=fig)\n",
580580
"cbar = pl.colorbar(im, fraction=0.046, pad=0.1)\n",
@@ -616,9 +616,9 @@
616616
"source": [
617617
"fig = pl.figure(figsize=(10,8))\n",
618618
"cgax, im = wrl.vis.plot_rhi(hmc_idx[11], ax=111, \n",
619-
" cg={'angular_spacing': 20.,\n",
620-
" 'radial_spacing': 12.,\n",
621-
" 'latmin': 2.5}, \n",
619+
" proj={'angular_spacing': 20.,\n",
620+
" 'radial_spacing': 12.,\n",
621+
" 'latmin': 2.5}, \n",
622622
" r=r/1000., th=el,\n",
623623
" norm=norm, \n",
624624
" cmap=cmap, \n",

notebooks/classify/wradlib_fuzzy_echo_classify.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
"# Horizontal reflectivity\n",
178178
"ax = plt.subplot(121, aspect=\"equal\")\n",
179179
"ax, pm = wradlib.vis.plot_ppi(np.ma.masked_invalid(dat[\"ref\"]), ax=ax)\n",
180-
"ax = wradlib.vis.plot_ppi_crosshair(site=(0,0), \n",
180+
"ax = wradlib.vis.plot_ppi_crosshair(site=(0,0,0), \n",
181181
" ranges=[80,160,240])\n",
182182
"plt.xlim(-240,240)\n",
183183
"plt.ylim(-240,240)\n",
@@ -191,7 +191,7 @@
191191
"ax, pm = wradlib.vis.plot_ppi(np.ma.masked_array(cmap.astype(np.uint8), \n",
192192
" np.isnan(dat[\"ref\"])),\n",
193193
" ax=ax, cmap=\"bwr\")\n",
194-
"ax = wradlib.vis.plot_ppi_crosshair(site=(0,0),\n",
194+
"ax = wradlib.vis.plot_ppi_crosshair(site=(0,0,0),\n",
195195
" ranges=[80,160,240])\n",
196196
"plt.xlim(-240,240)\n",
197197
"plt.ylim(-240,240)\n",
@@ -220,7 +220,7 @@
220220
"name": "python",
221221
"nbconvert_exporter": "python",
222222
"pygments_lexer": "ipython3",
223-
"version": "3.7.1"
223+
"version": "3.7.3"
224224
},
225225
"livereveal": {
226226
"scroll": true

notebooks/fileio/wradlib_load_rainbow_example.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"outputs": [],
153153
"source": [
154154
"fig = pl.figure(figsize=(8,8))\n",
155-
"cgax, pm = wrl.vis.plot_ppi(data, r=r, az=azi, fig=fig, cg=True)\n",
155+
"cgax, pm = wrl.vis.plot_ppi(data, r=r, az=azi, fig=fig, proj='cg')\n",
156156
"\n",
157157
"title = '{0} {1} {2} {3}\\n{4}E {5}N'.format(sensortype, sensorname, date,\n",
158158
" time, lon, lat)\n",
@@ -184,7 +184,7 @@
184184
"name": "python",
185185
"nbconvert_exporter": "python",
186186
"pygments_lexer": "ipython3",
187-
"version": "3.7.1"
187+
"version": "3.7.3"
188188
},
189189
"toc": {
190190
"colors": {

notebooks/fileio/wradlib_radar_formats.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
"outputs": [],
149149
"source": [
150150
"fig = pl.figure(figsize=(10,8))\n",
151-
"im = wrl.vis.plot_ppi(data, fig=fig, cg=True)"
151+
"im = wrl.vis.plot_ppi(data, fig=fig, proj='cg')"
152152
]
153153
},
154154
{
@@ -373,7 +373,7 @@
373373
"outputs": [],
374374
"source": [
375375
"fig = pl.figure(figsize=(10,8))\n",
376-
"im = wrl.vis.plot_ppi(fcontent['dataset1/data1/data'], fig=fig, cg=True)"
376+
"im = wrl.vis.plot_ppi(fcontent['dataset1/data1/data'], fig=fig, proj='cg')"
377377
]
378378
},
379379
{
@@ -465,7 +465,7 @@
465465
"outputs": [],
466466
"source": [
467467
"fig = pl.figure(figsize=(10,8))\n",
468-
"im = wrl.vis.plot_ppi(data['SCAN0']['ZH']['data'], fig=fig, cg=True)"
468+
"im = wrl.vis.plot_ppi(data['SCAN0']['ZH']['data'], fig=fig, proj='cg')"
469469
]
470470
},
471471
{
@@ -546,7 +546,7 @@
546546
"outputs": [],
547547
"source": [
548548
"fig = pl.figure(figsize=(10,8))\n",
549-
"im = wrl.vis.plot_ppi(fcontent['scan0/moment_3']['data'], fig=fig, cg=True)"
549+
"im = wrl.vis.plot_ppi(fcontent['scan0/moment_3']['data'], fig=fig, proj='cg')"
550550
]
551551
},
552552
{
@@ -849,7 +849,7 @@
849849
"name": "python",
850850
"nbconvert_exporter": "python",
851851
"pygments_lexer": "ipython3",
852-
"version": "3.7.1"
852+
"version": "3.7.3"
853853
},
854854
"livereveal": {
855855
"scroll": true

notebooks/fileio/wradlib_reading_dx.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
"# Plot PPI,\n",
192192
"ax, pm = wrl.vis.plot_ppi(two_scans[0], cmap=\"viridis\")\n",
193193
"# add crosshair,\n",
194-
"ax = wrl.vis.plot_ppi_crosshair((0,0), ranges=[40,80,128])\n",
194+
"ax = wrl.vis.plot_ppi_crosshair((0,0,0), ranges=[40,80,128])\n",
195195
"# add colorbar,\n",
196196
"cbar = pl.colorbar(pm, shrink=0.9)\n",
197197
"cbar.set_label(\"Reflectivity (dBZ)\")\n",
@@ -221,7 +221,7 @@
221221
"# Plot PPI,\n",
222222
"ax, pm = wrl.vis.plot_ppi(one_scan, cmap=\"viridis\", ax=ax, vmin=20, vmax=60)\n",
223223
"# add crosshair,\n",
224-
"ax = wrl.vis.plot_ppi_crosshair((0,0), ranges=[40,80,128])\n",
224+
"ax = wrl.vis.plot_ppi_crosshair((0,0,0), ranges=[40,80,128])\n",
225225
"# add colorbar,\n",
226226
"cbar = pl.colorbar(pm, shrink=0.5)\n",
227227
"cbar.set_label(\"Reflectivity (dBZ)\")\n",
@@ -235,7 +235,7 @@
235235
"# Plot PPI,\n",
236236
"ax, pm = wrl.vis.plot_ppi(two_scans[0], cmap=\"viridis\", ax=ax, vmin=20, vmax=60)\n",
237237
"# add crosshair,\n",
238-
"ax = wrl.vis.plot_ppi_crosshair((0,0), ranges=[40,80,128])\n",
238+
"ax = wrl.vis.plot_ppi_crosshair((0,0,0), ranges=[40,80,128])\n",
239239
"# add colorbar,\n",
240240
"cbar = pl.colorbar(pm, shrink=0.5)\n",
241241
"cbar.set_label(\"Reflectivity (dBZ)\")\n",
@@ -271,7 +271,7 @@
271271
"name": "python",
272272
"nbconvert_exporter": "python",
273273
"pygments_lexer": "ipython3",
274-
"version": "3.7.1"
274+
"version": "3.7.3"
275275
},
276276
"toc": {
277277
"colors": {

notebooks/georeferencing/wradlib_coords_example.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@
119119
"source": [
120120
"coords, proj_radar = georef.spherical_to_xyz(coord[..., 0],\n",
121121
" np.degrees(coord[..., 1]),\n",
122-
" coord[..., 2], sitecoords)\n",
122+
" coord[..., 2], sitecoords,\n",
123+
" squeeze=True)\n",
123124
"test = coords[0, 90, 0:960:60, 0]\n",
124125
"print(test)"
125126
]
@@ -188,7 +189,7 @@
188189
"name": "python",
189190
"nbconvert_exporter": "python",
190191
"pygments_lexer": "ipython3",
191-
"version": "3.7.1"
192+
"version": "3.7.3"
192193
},
193194
"toc": {
194195
"colors": {

notebooks/georeferencing/wradlib_georef_example.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@
8181
"proj_wgs84 = georef.epsg_to_osr(4326)\n",
8282
"polygons = georef.spherical_to_polyvert(r, az, 0, sitecoords, \n",
8383
" proj=proj_wgs84)\n",
84-
"polygons = polygons[..., 0:2]"
84+
"polygons = polygons[..., 0:2]\n",
85+
"polygons.shape"
8586
]
8687
},
8788
{
@@ -99,6 +100,7 @@
99100
"source": [
100101
"cent_coords = georef.spherical_to_centroids(r, az, 0, sitecoords,\n",
101102
" proj=proj_wgs84)\n",
103+
"cent_coords = np.squeeze(cent_coords)\n",
102104
"cent_lon = cent_coords[..., 0]\n",
103105
"cent_lat = cent_coords[..., 1]"
104106
]
@@ -172,7 +174,7 @@
172174
"name": "python",
173175
"nbconvert_exporter": "python",
174176
"pygments_lexer": "ipython3",
175-
"version": "3.7.1"
177+
"version": "3.7.3"
176178
},
177179
"toc": {
178180
"colors": {

notebooks/match3d/wradlib_match_workflow.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,8 @@
450450
"\n",
451451
"# create gr polar grid and calculate aeqd-xyz coordinates\n",
452452
"gr_polargrid = np.meshgrid(r_gr, az_gr)\n",
453-
"gr_xyz, rad = wrl.georef.spherical_to_xyz(gr_polargrid[0], gr_polargrid[1], elev_gr, (lon0_gr, lat0_gr, alt0_gr ))\n",
453+
"gr_xyz, rad = wrl.georef.spherical_to_xyz(gr_polargrid[0], gr_polargrid[1], elev_gr, (lon0_gr, lat0_gr, alt0_gr ), \n",
454+
" squeeze=True)\n",
454455
"print(\"XYZ-Grid-Shape:\", gr_xyz.shape)\n",
455456
"\n",
456457
"# create gr poygon array in aeqd-xyz-coordinates\n",
@@ -1367,7 +1368,7 @@
13671368
"name": "python",
13681369
"nbconvert_exporter": "python",
13691370
"pygments_lexer": "ipython3",
1370-
"version": "3.7.1"
1371+
"version": "3.7.3"
13711372
},
13721373
"toc": {
13731374
"colors": {

notebooks/visualisation/wradlib_plot_curvelinear_grids.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
"outputs": [],
200200
"source": [
201201
"fig = pl.figure(figsize=(10,8))\n",
202-
"ax, pm = wrl.vis.plot_ppi(ma, fig=fig, cg=True)\n",
202+
"ax, pm = wrl.vis.plot_ppi(ma, fig=fig, proj='cg')\n",
203203
"t = pl.title('Simple CG PPI')\n",
204204
"t.set_y(1.05)"
205205
]
@@ -228,7 +228,7 @@
228228
"outputs": [],
229229
"source": [
230230
"fig = pl.figure(figsize=(10,8))\n",
231-
"cgax, pm = wrl.vis.plot_ppi(ma, r=r, az=az, fig=fig, cg=True)\n",
231+
"cgax, pm = wrl.vis.plot_ppi(ma, r=r, az=az, fig=fig, proj='cg')\n",
232232
"\n",
233233
"caax = cgax.parasites[0]\n",
234234
"t = pl.title('Decorated CG PPI')\n",
@@ -257,7 +257,7 @@
257257
"cg={'radial_spacing': 14.,\n",
258258
" 'latmin': 10e3}\n",
259259
"fig = pl.figure(figsize=(10,8))\n",
260-
"cgax, pm = wrl.vis.plot_ppi(ma, r=r, az=az, fig=fig, proj=cg)\n",
260+
"cgax, pm = wrl.vis.plot_ppi(ma, r=r, az=az, fig=fig, proj='cg')\n",
261261
"caax = cgax.parasites[0]\n",
262262
"t = pl.title('Decorated CG PPI')\n",
263263
"t.set_y(1.05)\n",
@@ -560,7 +560,7 @@
560560
"outputs": [],
561561
"source": [
562562
"fig = pl.figure(figsize=(10,8))\n",
563-
"cgax, pm = wrl.vis.plot_rhi(ma1, r=r, th=th, rf=1e3, fig=fig, ax=111, cg=True)\n",
563+
"cgax, pm = wrl.vis.plot_rhi(ma1, r=r, th=th, rf=1e3, fig=fig, ax=111, proj='cg')\n",
564564
"\n",
565565
"caax = cgax.parasites[0]\n",
566566
"t = pl.title('Decorated CG RHI')\n",
@@ -643,7 +643,7 @@
643643
"fig = pl.figure(figsize=(10,8))\n",
644644
"fig.subplots_adjust(wspace=0.2, hspace=0.35)\n",
645645
"for sp in subplots:\n",
646-
" cgax, pm = wrl.vis.plot_rhi(ma1, r, th, rf=1e3, ax=sp, cg=True)\n",
646+
" cgax, pm = wrl.vis.plot_rhi(ma1, r, th, rf=1e3, ax=sp, proj='cg')\n",
647647
" caax.parasites=[0]\n",
648648
" t = pl.title('CG RHI #%(sp)d' %locals())\n",
649649
" t.set_y(1.1)\n",
@@ -687,7 +687,7 @@
687687
"labelpad = [1.25, 1.25, 1.1, 1.25, 1.25]\n",
688688
"fig = pl.figure(figsize=(10,8))\n",
689689
"for i, sp in enumerate(subplots):\n",
690-
" cgax, pm = wrl.vis.plot_rhi(ma1, r, th, rf=1e3, ax=sp, cg=True)\n",
690+
" cgax, pm = wrl.vis.plot_rhi(ma1, r, th, rf=1e3, ax=sp, proj='cg')\n",
691691
" caax = cgax.parasites[0]\n",
692692
" t = pl.title('CG RHI #%(i)d' %locals())\n",
693693
" t.set_y(labelpad[i])\n",
@@ -857,7 +857,7 @@
857857
"name": "python",
858858
"nbconvert_exporter": "python",
859859
"pygments_lexer": "ipython3",
860-
"version": "3.7.1"
860+
"version": "3.7.3"
861861
},
862862
"toc": {
863863
"colors": {

0 commit comments

Comments
 (0)