# How to weigh the size of a spatial event with respect to the number of its hotspots?

This is probably a map algebra problem. I have a 2D map with values ranging `0.0` to `1.0` spread all over it. The algorithm that produces them is an application of the fractional Brownian motion. The map measures `101x101` pixels or cells.

My problem: I want to find in the map the regions (or islands) which values exceed a given threshold, e.g. `0.3` (we can call them the hotspots). I then want to calculate the number of pixels or cells that fall within the boundaries of that island. Given that there might be more than one island, I could end up with:

1. Situation 1: 1 island with, say, `1000` pixels or cells;
2. Situation 2: 2 islands with `500` pixels or cells each;

Since I must be able to distinguish between the various situations, I was thinking of somehow weighing the total number of cells with respect to the number of islands. How could I do this, other than considering the average number of cells (which I see as a trivial solution)?

I am asking this since if I were to evaluate the impact of those hotspots on a system that is embedded in the map, there might be huge differences between having one big hotspot located in the center of the map and having multiple, although smaller, hotspots scattered all over the place.

Below is a visual example of what I mean by islands or regions.

• You want to do this in any particular software? Commented Nov 21, 2015 at 13:34
• I am working in Python. Commented Nov 21, 2015 at 13:52
• would love to figure this out in postgis raster....!!! got any sample data you could post? Commented Nov 21, 2015 at 17:33
• I have a bunch of csv files I can send over... would it work? Commented Nov 22, 2015 at 11:21
• @FC84 I would greatly appreciate it - I'm really trying to figure out PostGIS Raster and this looks like a great workflow to test it out... thank you! (sorry for the delay - holiday week off!) Commented Nov 28, 2015 at 20:41