Open mcrot opened 5 years ago
@pastewka I think we need some more discussion here.
1) The value of the slope
variable is also used to build the histogram, so the question is still whether how we define the slopes. Can't we just create three different distributions for x
, y
and for absolut gradients ?
2) The mean_slope
value is also used for the gaussian. Should we have gaussians for x
and
y
directions instead? And can't we then calculate the theoretical distribution for the absolute gradient from them?
Yes this would be possible. Do you want to show x and y gradient in one plot but as separate lines? I guess that would be clearer...
Yes, distributions for x
and y
in one plot as separate lines.
The distribution for the absolute gradient is probably better placed in a second plot
because of the completely different meaning of the x
axis.
Btw. do we have topography data for one surface including line scans and maps? That would be nice in order to compare the distributions and to see whether the results are consistent - this is a requirement if I understood correctly.
@pastewka I think the calculation of the absolute gradient would be easier and more accurate if np.gradient()
was used in Pyco, please see my proposal here.
Then np.gradient(topography.heights(), dx, dy)
does a similar thing as topography.derivative(n=1)
(except handling of periodic boundaries), but then the absolute gradient is easily determined by np.sqrt(slope_x**2+slope_y**2)
. What do you think?
Why can't you use the present derivative
function?
The current calculation of mean slope seems to be wrong:
The factor
np.sqrt(2)
is related to line scans to make the slope distribution comparable to those of maps, buttopography.dim==2
is already a map.