# Beam Blockage Calculation using a DEM - polarvalues error

**URL:** <https://openradar.discourse.group/t/beam-blockage-calculation-using-a-dem-polarvalues-error/359>\
**Category:** General\
**Created:** [November 29, 2023, 3:33pm UTC](https://openradar.discourse.group/t/beam-blockage-calculation-using-a-dem-polarvalues-error/359 "2023-11-29T15:33:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lou](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@lou](https://openradar.discourse.group/u/lou)\
**Post date:** [November 29, 2023, 3:33pm UTC](https://openradar.discourse.group/t/beam-blockage-calculation-using-a-dem-polarvalues-error/359/1 "2023-11-29T15:33:52Z")

</div>

Hello all,

I try to follow the script on [Beam Blockage Calculation using a DEM — wradlib](https://docs.wradlib.org/en/stable/notebooks/beamblockage/beamblockage.html#Preprocessing-the-digitial-elevation-model). I set up my radar as given in the first section.

Then, as I have already downloaded my DEM geotiff-file, I changed the codeblock [7] to

```auto
fpath = "file/to/path/topography.tif"

ds = wrl.io.open_raster(fpath)
rastervalues, rastercoords, crs = wrl.georef.extract_raster_dataset(ds, nodata=-9999.0)

# 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=3, prefilter=False
)

```

Unfortunately, I do get a ValueError in polarvalues:

```auto
ValueError: zero-size array to reduction operation minimum which has no identity 

```

Does someone know from where this comes from?

Best,  
Julian

---

<div class="post-metadata">

**Author:** ![Jagdish\_jena](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Jagdish\_jena](https://openradar.discourse.group/u/Jagdish_jena)\
**Post date:** [December 1, 2023, 6:29am UTC](https://openradar.discourse.group/t/beam-blockage-calculation-using-a-dem-polarvalues-error/359/2 "2023-12-01T06:29:13Z")

</div>

I have also faced this error. try to change the rlimits - (lonmin,latmin,lonmax,latmax) it will fix your error.

---

<div class="post-metadata">

**Author:** ![kmuehlbauer](https://yyz2.discourse-cdn.com/free1/user_avatar/openradar.discourse.group/kmuehlbauer/32/439_2.png) [@kmuehlbauer](https://openradar.discourse.group/u/kmuehlbauer)\
**Post date:** [December 1, 2023, 6:39am UTC](https://openradar.discourse.group/t/beam-blockage-calculation-using-a-dem-polarvalues-error/359/3 "2023-12-01T06:39:11Z")

</div>

Thanks @Jagdish_jena,

> [@Jagdish\_jena](#):
>
> rlimits - (lonmin,latmin,lonmax,latmax)

that was also my first guess. @lou Your rlimits need to correspond to the rastercoords. You might also check the index `ind` values, if it contains useful values.
