Open sannant opened 3 years ago
I noticed this because I wondered why the WebApp rms-slope of the contact-challenge surface was around 0.7 instead of 1.
The rms_gradient computed with Topography.rms_slope
is indeed almost 1, as it should be.
I think it should be easy to implement another RMS value using Topography.rms_slope
.
Where did you see the value 0.7 instead of 1? Do you think, this is a bug?
I think 0.7 is correct
The rms_gradient is
sqrt(mean(dh_dx**2 + dh_dy**2))
The rms-slope is sqrt(mean(dh_dx**2))
On a scan where the slope is 0 in the x direction (a kind of scratched surface), the rms-gradient equals the rms-slope.
But in general, the rms-gradient is higher.
As I calculate the rms-slope like you have written, I wonder why I get 1 instead of 0.7.
Could this be related to the change of the API for derivations in SurfaceTopography version 0.92. As Lars writes in "https://github.com/ComputationalMechanics/SurfaceTopography/issues/60":
Derivative now excludes the boundary values for nonperiodic topographies
Hmm. The topography should be considered as periodic actually
Moment it is actually simpler then I thought. For an isotropic surface sqrt(mean(dh_dx2 + dh_dy2)) = sqrt(mean(dh_dx2) + mean(dh_dx2))) = sqrt(2) sqrt(mean(dh_dx**2))
0.7 * np.sqrt(2) = 0.98
Currently, the webapp reports the rms_slopes in the x and y directions separately for 3D Topographies. I definitely agree that this is the best thing to do for AFM data.
For the sake of completeness it would be nice to also include the RMS gradient. The RMS gradient is
Topography.rms_slope
. Maybe would should actually rename this functionrms_gradient