My problem is the following:

I have a 3D dataset where (x,y) are the cartesian coordinates of a grid and (z) is the intensity/frequency of each point in the grid, named (f).

I want to convert this 3D dataset (x,y,f) into a 2D (x,y) dataset, where I'll create new data points in the (x,y) grid according to the intensity of the signal.

For example, I have the following graph and dataset:  

This is some form of a "heat map" where the coordinate (z) is the intensity of the signal

![](https://i.stack.imgur.com/serxt.png)

I want to convert this 3D dataset into a 2D one where new data points will be created according to the intensity of a previous data point. For example, if the intensity for (x=1, y=1) is 20, I want to create 20 data points at (x=1,y=1) with intensity 1.