zero-size array to reduction operation minimum which has no identity

3,457 views
Skip to first unread message

Murilo Fretta

unread,
May 15, 2018, 5:12:43 PM5/15/18
to wradlib-users
Trying to open DEM for beam blockage example and got this error:

#rasterfile = wrl.util.get_wradlib_data_file('Chapecó .tiff')
rasterfile = 'C:\\Users\\User\\Desktop\\TCC\\MDE\\MDE_REG1.tif'

ds = wrl.io.open_raster(rasterfile)
rastervalues, rastercoords, proj = wrl.georef.extract_raster_dataset(ds, nodata=-32768.)

# Clip the region inside our bounding box
ind = wrl.util.find_bbox_indices(rastercoords, rlimits)
rastercoords = rastercoords[ind[1]:ind[3], ind[0]:ind[2], ...]
rastervalues = rastervalues[ind[1]:ind[3], ind[0]:ind[2]]

# Map rastervalues to polar grid points
polarvalues = wrl.ipol.cart_to_irregular_spline(rastercoords, rastervalues,
                                             polcoords, order=2,
                                             prefilter=False)


zero-size array to reduction operation minimum which has no identity

Anyone to help me?

Murilo Fretta

unread,
May 15, 2018, 5:18:41 PM5/15/18
to wradlib-users
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-39-1426a8c61792> in <module>() 13 polarvalues = wrl.ipol.cart_to_irregular_spline(rastercoords, rastervalues, 14 polcoords, order=3, ---> 15 prefilter=False) C:\Anaconda\lib\site-packages\wradlib\ipol.py in cart_to_irregular_spline(cartgrid, values, newgrid, **kwargs) 1182 ny = cartgrid.shape[0] 1183 -> 1184 cxmin = np.min(cartgrid[..., 0]) 1185 cxmax = np.max(cartgrid[..., 0]) 1186 cymin = np.min(cartgrid[..., 1]) C:\Anaconda\lib\site-packages\numpy\core\fromnumeric.py in amin(a, axis, out, keepdims) 2350 2351 return _methods._amin(a, axis=axis, -> 2352 out=out, **kwargs) 2353 2354 C:\Anaconda\lib\site-packages\numpy\core\_methods.py in _amin(a, axis, out, keepdims) 27 28 def _amin(a, axis=None, out=None, keepdims=False): ---> 29 return umr_minimum(a, axis, None, out, keepdims) 30 31 def _sum(a, axis=None, dtype=None, out=None, keepdims=False): ValueError: zero-size array to reduction operation minimum which has no identity

Kai Mühlbauer

unread,
May 16, 2018, 12:54:08 AM5/16/18
to wradli...@googlegroups.com
Hi,

which wradlib version are you using? It seems that the specific error is triggered by recent changes in numpy, which have been resolved in latest wradlib 1.0.

Anyway, I'd like to test this locally. Can you provide the DEM somewhere for download? You might contact me privately for this.

Cheers,
Kai
--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

Kai Muehlbauer

unread,
May 17, 2018, 2:41:34 AM5/17/18
to wradli...@googlegroups.com
Hi Murilo,

Thanks for providing the source DEM.

I can reproduce your error. And it has nothing to do with my first guess
of being numpy an issue.

There are several points which lead to the error you are seeing. The DEM
is in SAD_1969_UTM_Zone_22S projection. This needs to be projected to
WGS84 or the radar polar grid has to be projected to the
SAD_1969_UTM_Zone_22S projection. This is a minor issue and we can deal
with it easily.

The more problematic things are, where we would have to think about a
solution in more depth, that your DEM covers only a part of the radar
viewing range and the radar is located outside the DEM. This breaks the
interpolation algorithm to polar representation of the DEM.

If I understand your use case correctly you just want to explore this
special part of the radar domain with respect to beamblockage and the
like. So we have to find a way to define a synthetic DEM covering the
whole radar domain and add the DEM of interest inside.

Maik, do you see an immediate solution?

Cheers,
Kai



Am 16.05.2018 um 06:54 schrieb Kai Mühlbauer:
> Hi,
>
> which wradlib version are you using? It seems that the specific error is
> triggered by recent changes in numpy, which have been resolved in latest
> wradlib 1.0.
>
> Anyway, I'd like to test this locally. Can you provide the DEM somewhere
> for download? You might contact me privately for this.
>
> Cheers,
> Kai
>
> Am 15. Mai 2018 23:18:41 MESZ schrieb 'Murilo Fretta' via wradlib-users
> <wradli...@googlegroups.com>:
>
> ---------------------------------------------------------------------------ValueErrorTraceback
> (most recent call last) <ipython-input-39-1426a8c61792>in
> <module>()13polarvalues =
> wrl.ipol.cart_to_irregular_spline(rastercoords, rastervalues,
> 14polcoords,order=3,---> 15prefilter=False)
> C:\Anaconda\lib\site-packages\wradlib\ipol.pyin
> cart_to_irregular_spline(cartgrid, values, newgrid, **kwargs)1182ny
> =cartgrid.shape[0]1183-> 1184cxmin =np.min(cartgrid[...,0])1185cxmax
> =np.max(cartgrid[...,0])1186cymin
> =np.min(cartgrid[...,1])C:\Anaconda\lib\site-packages\numpy\core\fromnumeric.pyin
> amin(a, axis, out, keepdims)23502351return _methods._amin(a,
> axis=axis, -> 2352out=out, **kwargs)
> 23532354C:\Anaconda\lib\site-packages\numpy\core\_methods.pyin
> _amin(a, axis, out,
> keepdims)2728def_amin(a,axis=None,out=None,keepdims=False):--->
> 29returnumr_minimum(a,axis,None,out,keepdims)3031def_sum(a,axis=None,dtype=None,out=None,keepdims=False):ValueError:
> zero-size array to reduction operation minimum which has no identity
> Em terça-feira, 15 de maio de 2018 18:12:43 UTC-3, Murilo Fretta
> escreveu:
>
> Trying to open DEM for beam blockage example and got this error:
>
> #rasterfile = wrl.util.get_wradlib_data_file('Chapecó .tiff')
> rasterfile = 'C:\\Users\\User\\Desktop\\TCC\\MDE\\MDE_REG1.tif'
>
> ds = wrl.io.open_raster(rasterfile)
> rastervalues, rastercoords, proj =
> wrl.georef.extract_raster_dataset(ds, nodata=-32768.)
>
> # Clip the region inside our bounding box
> ind = wrl.util.find_bbox_indices(rastercoords, rlimits)
> rastercoords = rastercoords[ind[1]:ind[3], ind[0]:ind[2], ...]
> rastervalues = rastervalues[ind[1]:ind[3], ind[0]:ind[2]]
>
> # Map rastervalues to polar grid points
> polarvalues = wrl.ipol.cart_to_irregular_spline(rastercoords,
> rastervalues,
>                                              polcoords, order=2,
>                                              prefilter=False)
>
>
> zero-size array to reduction operation minimum which has no
> identity
>
> Anyone to help me?
>
>
> --
> Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-user...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Kai Muehlbauer
Meteorological Institute University of Bonn
Auf dem Huegel 20 | +49 228 739083
D-53121 Bonn | kai.mue...@uni-bonn.de
dem_brazil.png

Murilo Fretta

unread,
May 17, 2018, 8:44:55 AM5/17/18
to wradli...@googlegroups.com
Hi Dr. Kai, 

I was wondering if the problem was with the DEM. I tried with a DEM from the GTOP30, not the result as i would expect, some corretions to do, but the script ran.

What about the DEM and the radar área, i sent to you the DEM from West of Santa Catarina State, Chapecó city. In attached files i'm sending the Extreme West, the complement of for the region, Middle West of the state. 

How did you change the projection to plot the image from DEM.

Yes, i'm using the DEM to make plots of Beam Blockage and to finish my study case course.


Thank you for your time Dr. Kai

Best Regards,

Murilo


> For more options, visit https://groups.google.com/d/optout.

--
Kai Muehlbauer
Meteorological Institute University of Bonn
Auf dem Huegel 20       | +49 228 739083
D-53121 Bonn            | kai.mue...@uni-bonn.de
--
You received this message because you are subscribed to the Google Groups "wradlib-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wradlib-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
______________________________________________________________
Murilo Fretta José
(48) 9953-6319
Graduando de Meteorologia - 8a Fase - UFSC
Gerência de Alerta da Defesa Civil de Santa Catarina

                                                                                                      

"Don't let anyone, ever, dull your sparkle"

Kai Muehlbauer

unread,
May 17, 2018, 9:50:09 AM5/17/18
to wradli...@googlegroups.com
Dear Murilo,

thanks for being that polite, but I do not have a doctoral degree. I'm
engineer by profession.

Please have a look at this gist:

https://gist.github.com/wradlib/8a2e10ff6c2f255256e00b8d2fb43254

There I explain, how to combine several SRTM tiles to one geotiff and
how to transform it to another projection using gdal commandline tools.

You would need to download the tiles (link is in the gist) and do the
same. You would need another EPSG code for your area (29182). You can
play with the spatial resolution (in the gist 500x500m).

Once you have created the geotiff for lower brazil you can use it
directly in the beamblockage notebook.

See the attached image.

HTH,
Kai



Am 17.05.2018 um 14:44 schrieb 'Murilo Fretta' via wradlib-users:
> Hi Dr. Kai, 
>
> I was wondering if the problem was with the DEM. I tried with a DEM from
> the GTOP30, not the result as i would expect, some corretions to do, but
> the script ran.
>
> What about the DEM and the radar área, i sent to you the DEM from West
> of Santa Catarina State, Chapecó city. In attached files i'm sending the
> Extreme West, the complement of for the region, Middle West of the state. 
>
> How did you change the projection to plot the image from DEM.
>
> Yes, i'm using the DEM to make plots of Beam Blockage and to finish my
> study case course.
>
>
> Thank you for your time Dr. Kai
>
> Best Regards,
>
> Murilo
> ​
>  MDE_REG2_TIF.zip
> <https://drive.google.com/file/d/1pXWP36eUu0zeuiSeF_zvmIxaD9YOXih4/view?usp=drive_web>
> ​​
>  MDE_REG3_TIF.zip
> <https://drive.google.com/file/d/1UuVnPEsjjIUx1wMwDwIrh4jdhXOjfyBk/view?usp=drive_web>
> > <wradli...@googlegroups.com <mailto:wradli...@googlegroups.com>>:
> > an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>
> > <mailto:wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>>.
> > For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
>
> --
> Kai Muehlbauer
> Meteorological Institute University of Bonn
> Auf dem Huegel 20       | +49 228 739083
> D-53121 Bonn            | kai.mue...@uni-bonn.de
> <mailto:kai.mue...@uni-bonn.de>
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> ________________________________________________________________
> _Murilo Fretta José_
> _(48) 9953-6319_
> Graduando de Meteorologia - 8a Fase - UFSC
> Gerência de Alerta da Defesa Civil de Santa Catarina
>
>                                                                        
>                               
>
> /_"Don't let anyone, ever, dull your sparkle"_/
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-user...@googlegroups.com>.
brazil_beamblockage.png

Murilo Fretta

unread,
May 17, 2018, 9:00:17 PM5/17/18
to wradli...@googlegroups.com
Hi Mr. Kai,

I really appreciate your help, for the tif. tiles it was very sucessful, unfortunely i got this error while trying to read the raster data:

module 'wradlib.io' has no attribute 'read_raster_data'

Thank you!

Best regards

Murilo


>     <mailto:wradlib-users%2Bunsu...@googlegroups.com>>.
>     > For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
>
>     --
>     Kai Muehlbauer
>     Meteorological Institute University of Bonn
>     Auf dem Huegel 20       | +49 228 739083
>     D-53121 Bonn            | kai.mue...@uni-bonn.de
>     <mailto:kai.muehlbauer@uni-bonn.de>
>
>     --
>     You received this message because you are subscribed to the Google
>     Groups "wradlib-users" group.
>     To unsubscribe from this group and stop receiving emails from it,
>     send an email to wradlib-users+unsubscribe@googlegroups.com
>     <mailto:wradlib-users%2Bunsu...@googlegroups.com>.
>     For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
>
>
>
> --
> ________________________________________________________________
> _Murilo Fretta José_
> _(48) 9953-6319_
> Graduando de Meteorologia - 8a Fase - UFSC
> Gerência de Alerta da Defesa Civil de Santa Catarina
>
>                                                                        
>                               
>
> /_"Don't let anyone, ever, dull your sparkle"_/
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send

> For more options, visit https://groups.google.com/d/optout.

--
Kai Muehlbauer
Meteorological Institute University of Bonn
Auf dem Huegel 20       | +49 228 739083
D-53121 Bonn            | kai.mue...@uni-bonn.de

--
You received this message because you are subscribed to the Google Groups "wradlib-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wradlib-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
______________________________________________________________
Murilo Fretta José
(48) 9953-6319
Graduando de Meteorologia - 8a Fase - UFSC
Gerência de Alerta da Defesa Civil de Santa Catarina

                                                                                                      

Murilo Fretta

unread,
May 17, 2018, 11:30:39 PM5/17/18
to wradli...@googlegroups.com
Hi Mr.Kai,

Here we go again!

As i was following the gist steps i did plot de DEM(attached file), how can i set up de xlim and ylim as the lat/lon coords? The values are for the rastercoords and when i tried to change for lat.min(), lon.min() did not work.

Thank you again!

Best Regards,

Murilo


>     > For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
>
>     --
>     Kai Muehlbauer
>     Meteorological Institute University of Bonn
>     Auf dem Huegel 20       | +49 228 739083
>     D-53121 Bonn            | kai.mue...@uni-bonn.de
>     <mailto:kai.muehlbauer@uni-bonn.de>
>
>     --
>     You received this message because you are subscribed to the Google
>     Groups "wradlib-users" group.
>     To unsubscribe from this group and stop receiving emails from it,
>     send an email to wradlib-users+unsubscribe@googlegroups.com

>     For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
>
>
>
> --
> ________________________________________________________________
> _Murilo Fretta José_
> _(48) 9953-6319_
> Graduando de Meteorologia - 8a Fase - UFSC
> Gerência de Alerta da Defesa Civil de Santa Catarina
>
>                                                                        
>                               
>
> /_"Don't let anyone, ever, dull your sparkle"_/
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to wradlib-users+unsubscribe@googlegroups.com
alturadeterreno.png

Kai Muehlbauer

unread,
May 18, 2018, 2:30:52 AM5/18/18
to wradli...@googlegroups.com
Hi Murilo,

The error in the wradlib.io module is due to using the old
'read_raster_data' function which is replaced by
'extract_raster_dataset'. Since you got the terrain plotted, I assume
you already figured that out.

Your geotiff is now in kind of UTM projection. To plot your DEM in wgs84
lonlat coordinates you would need to adapt your reading workflow like this:

# open your geotiff
ds = wrl.io.open_raster(rasterfile)
# create wgs84 projection osr object
wgs84 = wrl.georef.epsg_to_osr(4326)
# spacing is in output units (lonlat)
ds = wrl.georef.reproject_raster_dataset(ds, projection_target=wgs84,
spacing=0.005)
rastervalues, rastercoords, proj = wrl.georef.extract_raster_dataset(ds)

That way you get your DEM reprojected to wgs84 and your rastercoords are
lon/lat coordinates. You can play with the spacing to get more or less
resolution of the output.

HTH,
Kai

Am 18.05.2018 um 05:30 schrieb 'Murilo Fretta' via wradlib-users:
> Hi Mr.Kai,
>
> Here we go again!
>
> As i was following the gist steps i did plot de DEM(attached file), how
> can i set up de xlim and ylim as the lat/lon coords? The values are for
> the rastercoords and when i tried to change for lat.min(), lon.min() did
> not work.
>
> Thank you again!
>
> Best Regards,
>
> Murilo
>
> On Thu, May 17, 2018 at 10:00 PM, Murilo Fretta
> <murilo...@googlemail.com <mailto:murilo...@googlemail.com>> wrote:
>
> Hi Mr. Kai,
>
> I really appreciate your help, for the tif. tiles it was very
> sucessful, unfortunely i got this error while trying to read the
> raster data:
>
> module 'wradlib.io <http://wradlib.io>' has no attribute
> <mailto:kai.mue...@uni-bonn.de>
> <mailto:kai.mue...@uni-bonn.de
> <mailto:wradli...@googlegroups.com>
> <mailto:wradli...@googlegroups.com
> <mailto:wradli...@googlegroups.com>>>:
> >     > an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>
> >     <mailto:wradlib-users%2Bunsu...@googlegroups.com
> <mailto:wradlib-users%252Buns...@googlegroups.com>>
> >     > <mailto:wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>
> >     <mailto:wradlib-users%2Bunsu...@googlegroups.com
> <mailto:wradlib-users%252Buns...@googlegroups.com>>>.
> >     > For more options, visit
> https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
> <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
> >
> >     --
> >     Kai Muehlbauer
> >     Meteorological Institute University of Bonn
> >     Auf dem Huegel 20       | +49 228 739083
> >     D-53121 Bonn            | kai.mue...@uni-bonn.de <mailto:kai.mue...@uni-bonn.de>
> >     <mailto:kai.mue...@uni-bonn.de
> <mailto:kai.mue...@uni-bonn.de>>
> >
> >     --
> >     You received this message because you are subscribed to the Google
> >     Groups "wradlib-users" group.
> >     To unsubscribe from this group and stop receiving emails from it,
> >     send an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>
> >     <mailto:wradlib-users%2Bunsu...@googlegroups.com
> <mailto:wradlib-users%252Buns...@googlegroups.com>>.
> >     <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
> >
> >
> >
> >
> > --
> > ________________________________________________________________
> > _Murilo Fretta José_
> > _(48) 9953-6319_
> > Graduando de Meteorologia - 8a Fase - UFSC
> > Gerência de Alerta da Defesa Civil de Santa Catarina
> >
> >                                                                        
> >                               
> >
> > /_"Don't let anyone, ever, dull your sparkle"_/
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "wradlib-users" group.
> > To unsubscribe from this group and stop receiving emails from
> it, send
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> Kai Muehlbauer
> Meteorological Institute University of Bonn
> Auf dem Huegel 20       | +49 228 739083
> D-53121 Bonn            | kai.mue...@uni-bonn.de
> <mailto:kai.mue...@uni-bonn.de>
>
> --
> You received this message because you are subscribed to the
> Google Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> ________________________________________________________________
> _Murilo Fretta José_
> _(48) 9953-6319_
> Graduando de Meteorologia - 8a Fase - UFSC
> Gerência de Alerta da Defesa Civil de Santa Catarina
>
>                                                                    
>                                   
>
> /_"Don't let anyone, ever, dull your sparkle"_/
>
>
>
>
> --
> ________________________________________________________________
> _Murilo Fretta José_
> _(48) 9953-6319_
> Graduando de Meteorologia - 8a Fase - UFSC
> Gerência de Alerta da Defesa Civil de Santa Catarina
>
>                                                                        
>                               
>
> /_"Don't let anyone, ever, dull your sparkle"_/
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-user...@googlegroups.com>.

Murilo Fretta

unread,
May 20, 2018, 6:31:50 PM5/20/18
to wradli...@googlegroups.com
Hi Mr Kai,

Again, thank you for your help and support, the projection to lat/lon works very fine, but now, when i try to plot the Beam Blockage:

def plot_dem(ax):
    filename =  'C:\\Users\\User\\Desktop\\TCC\\MDE\\mde_radar29182_500.tif'
    ds = wrl.io.open_raster(filename)
    
    # create wgs84 projection osr object
    wgs84 = wrl.georef.epsg_to_osr(4326)
    # spacing is in output units (lonlat)
    ds = wrl.georef.reproject_raster_dataset(ds, projection_target=wgs84, spacing=0.005)
    rastervalues, rastercoords, proj = wrl.georef.extract_raster_dataset(ds, nodata=-32768.)
    
    rastervalues[(rastervalues <= 1) & (rastervalues >= 0)] = 1
    # specify kwargs for plotting, using terrain colormap and LogNorm
    dem = ax.pcolormesh(rastercoords[..., 0], rastercoords[..., 1],
                        rastervalues, cmap=mpl.cm.terrain, norm=LogNorm(),
                        vmin=100, vmax=3000)
    # make some space on the right for colorbar axis
    div1 = make_axes_locatable(axmde)
    cax1 = div1.append_axes("right", size="5%", pad=0.1)
    # add colorbar and title
    # we use LogLocator for colorbar
    cb = pl.gcf().colorbar(dem, cax=cax1, ticks=ticker.LogLocator(subs=range(10)))
    cb.set_label('Altura de terreno[m]')
    ax.set_xlim((rastercoords[..., 0].min(), rastercoords[..., 0].max()))
    ax.set_ylim((rastercoords[..., 1].min(), rastercoords[..., 1].max()))
    
    # Map rastervalues to polar grid points
    polarvalues = wrl.ipol.cart_to_irregular_spline(rastercoords, rastervalues, polcoords, order=3, prefilter=False)

    PBB = wrl.qual.beam_block_frac(polarvalues, alt, beamradius)
    PBB = np.ma.masked_invalid(PBB)
    print(PBB.shape)
    CBB = wrl.qual.cum_beam_block_frac(PBB)
    print(CBB.shape)
fig = pl.figure(figsize=(10,10)) 



I got an error because the polarvalues can not be set! It say that polarvalues is not defined!

ax1, dem = wrl.vis.plot_ppi(polarvalues, 13 ax=ax1, r=r, 14 az=np.degrees(coord[:,0,1]), NameError: name 'polarvalues' is not defined

Best Regards, 
Murilo

>         <mailto:kai.muehlbauer@uni-bonn.de>
>         <mailto:kai.muehlbauer@uni-bonn.de
>         >     > <wradlib-users@googlegroups.com
>         <mailto:wradlib-users@googlegroups.com>
>         <mailto:wradlib-users@googlegroups.com
>         <mailto:wradlib-users@googlegroups.com>>>:
>         >     > an email to wradlib-users+unsubscribe@googlegroups.com
>         <mailto:wradlib-users%2Bunsu...@googlegroups.com>
>         >     <mailto:wradlib-users%2Bunsu...@googlegroups.com
>         <mailto:wradlib-users%252Bunsubscribe@googlegroups.com>>
>         >     > <mailto:wradlib-users+unsub...@googlegroups.com
>         <mailto:wradlib-users%2Bunsu...@googlegroups.com>
>         >     <mailto:wradlib-users%2Bunsu...@googlegroups.com
>         <mailto:wradlib-users%252Bunsubscribe@googlegroups.com>>>.
>         >     > For more options, visit
>         https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>
>         <https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>>.
>         >
>         >     --
>         >     Kai Muehlbauer
>         >     Meteorological Institute University of Bonn
>         >     Auf dem Huegel 20       | +49 228 739083
>         >     D-53121 Bonn            | kai.mue...@uni-bonn.de <mailto:kai.muehlbauer@uni-bonn.de>
>         >     <mailto:kai.muehlbauer@uni-bonn.de
>         <mailto:kai.muehlbauer@uni-bonn.de>>

>         >
>         >     --
>         >     You received this message because you are subscribed to the Google
>         >     Groups "wradlib-users" group.
>         >     To unsubscribe from this group and stop receiving emails from it,
>         >     send an email to wradlib-users+unsubscribe@googlegroups.com
>         <mailto:wradlib-users%2Bunsu...@googlegroups.com>
>         >     <mailto:wradlib-users%2Bunsu...@googlegroups.com
>         <mailto:wradlib-users%252Bunsubscribe@googlegroups.com>>.

>         >     For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>
>         >     <https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>>.
>         >
>         >
>         >
>         >
>         > --
>         > ________________________________________________________________
>         > _Murilo Fretta José_
>         > _(48) 9953-6319_
>         > Graduando de Meteorologia - 8a Fase - UFSC
>         > Gerência de Alerta da Defesa Civil de Santa Catarina
>         >
>         >                                                                        
>         >                               
>         >
>         > /_"Don't let anyone, ever, dull your sparkle"_/
>         >
>         > --
>         > You received this message because you are subscribed to the Google
>         > Groups "wradlib-users" group.
>         > To unsubscribe from this group and stop receiving emails from
>         it, send
>         > an email to wradlib-users+unsubscribe@googlegroups.com
>         <mailto:wradlib-users%2Bunsu...@googlegroups.com>
>         > <mailto:wradlib-users+unsub...@googlegroups.com
>         <mailto:wradlib-users%2Bunsu...@googlegroups.com>>.
>         > For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>.
>
>         --
>         Kai Muehlbauer
>         Meteorological Institute University of Bonn
>         Auf dem Huegel 20       | +49 228 739083
>         D-53121 Bonn            | kai.mue...@uni-bonn.de
>         <mailto:kai.muehlbauer@uni-bonn.de>

>
>         --
>         You received this message because you are subscribed to the
>         Google Groups "wradlib-users" group.
>         To unsubscribe from this group and stop receiving emails from
>         it, send an email to wradlib-users+unsubscribe@googlegroups.com

>         <mailto:wradlib-users%2Bunsu...@googlegroups.com>.
>         For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>.
>
>
>
>
>     --
>     ________________________________________________________________
>     _Murilo Fretta José_
>     _(48) 9953-6319_
>     Graduando de Meteorologia - 8a Fase - UFSC
>     Gerência de Alerta da Defesa Civil de Santa Catarina
>
>                                                                        
>                                       
>
>     /_"Don't let anyone, ever, dull your sparkle"_/
>
>
>
>
> --
> ________________________________________________________________
> _Murilo Fretta José_
> _(48) 9953-6319_
> Graduando de Meteorologia - 8a Fase - UFSC
> Gerência de Alerta da Defesa Civil de Santa Catarina
>
>                                                                        
>                               
>
> /_"Don't let anyone, ever, dull your sparkle"_/
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send

> For more options, visit https://groups.google.com/d/optout.

--
Kai Muehlbauer
Meteorological Institute University of Bonn
Auf dem Huegel 20       | +49 228 739083
D-53121 Bonn            | kai.mue...@uni-bonn.de

--
You received this message because you are subscribed to the Google Groups "wradlib-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wradlib-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
______________________________________________________________
Murilo Fretta José
(48) 9953-6319
Graduando de Meteorologia - 8a Fase - UFSC
Gerência de Alerta da Defesa Civil de Santa Catarina

                                                                                                      

Kai Mühlbauer

unread,
May 21, 2018, 12:03:59 PM5/21/18
to wradli...@googlegroups.com
Hi Murilo,

this is most likely due to the fact, that you set polarvalue array inside the plot_dem function.

You would need to either remove the function at all (just using the code in the main script) or to return the polarvalue array from the function.

Can you attach your complete script so I can be sure?

Cheers,
Kai

Murilo Fretta

unread,
May 22, 2018, 6:53:50 PM5/22/18
to wradli...@googlegroups.com
Hi Mr. Kai,

It's works, i put the array outside of the plot_dem function. Thank you very much.

I don't know if it was because of the merge with the gdal from the DEM of 3 regions, i cannot put the radar beam with DEM plot.

IndexError: index 1 is out of bounds for axis 0 with size 1
Yes for sure, i'm sending to you the script and the files attached(merge gdal DEM tif and the script).


Best regards,

Murilo

On Mon, May 21, 2018 at 1:03 PM, Kai Mühlbauer <kai.mue...@uni-bonn.de> wrote:
Hi Murilo,

this is most likely due to the fact, that you set polarvalue array inside the plot_dem function.

You would need to either remove the function at all (just using the code in the main script) or to return the polarvalue array from the function.

Can you attach your complete script so I can be sure?

Cheers,
Kai
>         >     > <wradli...@googlegroups.com
>         <mailto:wradlib-users@googlegroups.com>
>         <mailto:wradlib-users@googlegroups.com

>         >     > For more options, visit
>         https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>
>         <https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>>.
>         >
>         >     --
>         >     Kai Muehlbauer
>         >     Meteorological Institute University of Bonn
>         >     Auf dem Huegel 20       | +49 228 739083
>         >     D-53121 Bonn            | kai.mue...@uni-bonn.de <mailto:kai.muehlbauer@uni-bonn.de>
>         >     <mailto:kai.muehlbauer@uni-bonn.de
>         <mailto:kai.muehlbauer@uni-bonn.de>>
>         >
>         >     --
>         >     You received this message because you are subscribed to the Google
>         >     Groups "wradlib-users" group.
>         >     To unsubscribe from this group and stop receiving emails from it,
>         >     send an email to wradlib-users+unsubscribe@googlegroups.com

>         >     For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>
>         >     <https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>>.
>         >
>         >
>         >
>         >
>         > --
>         > ________________________________________________________________
>         > _Murilo Fretta José_
>         > _(48) 9953-6319_
>         > Graduando de Meteorologia - 8a Fase - UFSC
>         > Gerência de Alerta da Defesa Civil de Santa Catarina
>         >
>         >                                                                        
>         >                               
>         >
>         > /_"Don't let anyone, ever, dull your sparkle"_/
>         >
>         > --
>         > You received this message because you are subscribed to the Google
>         > Groups "wradlib-users" group.
>         > To unsubscribe from this group and stop receiving emails from
>         it, send
>         > an email to wradlib-users+unsubscribe@googlegroups.com

>         > For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>.
>
>         --
>         Kai Muehlbauer
>         Meteorological Institute University of Bonn
>         Auf dem Huegel 20       | +49 228 739083
>         D-53121 Bonn            | kai.mue...@uni-bonn.de
>         <mailto:kai.muehlbauer@uni-bonn.de>
>
>         --
>         You received this message because you are subscribed to the
>         Google Groups "wradlib-users" group.
>         To unsubscribe from this group and stop receiving emails from
>         it, send an email to wradlib-users+unsubscribe@googlegroups.com

>         For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>.
>
>
>
>
>     --
>     ________________________________________________________________
>     _Murilo Fretta José_
>     _(48) 9953-6319_
>     Graduando de Meteorologia - 8a Fase - UFSC
>     Gerência de Alerta da Defesa Civil de Santa Catarina
>
>                                                                        
>                                       
>
>     /_"Don't let anyone, ever, dull your sparkle"_/
>
>
>
>
> --
> ________________________________________________________________
> _Murilo Fretta José_
> _(48) 9953-6319_
> Graduando de Meteorologia - 8a Fase - UFSC
> Gerência de Alerta da Defesa Civil de Santa Catarina
>
>                                                                        
>                               
>
> /_"Don't let anyone, ever, dull your sparkle"_/
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to wradlib-users+unsubscribe@googlegroups.com
MDE.ipynb
mde_radar29182_500.tif
Reply all
Reply to author
Forward
0 new messages