ContactEngineering / SurfaceTopography

Read and analyze surface topographies
https://contactengineering.github.io/SurfaceTopography/
MIT License
17 stars 10 forks source link

About RMS parameter computation and PSD curve analysis #92

Closed Rick224339 closed 3 years ago

Rick224339 commented 3 years ago

In contact.engineering, I find two problems.

First, in RMS parameter computation, I find RMS height and slope can be computed but RMS curvature is missing. Plus, I also suggest scan size and pixel size of the profiles can be also listed in the window where computed RMS parameters of all profiles are presented. This helps copying data of both size of profile and RMS parameter.

Second, in PSD curve analysis, I find the output PSD curves have no data when frequency equals zero. In ideal case, it should be zero at q=0. I think the gap between the first point and q=0 cannot be ignored because Cq values in this region are greater than Cq at higher frequency. In other words, this gap also has some contribution to overall PSD. For example, when computing RMS height of a profile by integrating PSD curves, without considering q=0, RMS height equals 0.7 unit, while RMS height equals 0.8 or close to 0.9 unit if q=0 is involved.

mcrot commented 3 years ago

Hey Rick, I guess I are referring to the web app (https://github.com/ContactEngineering/TopoBank). Concerning the missing RMS curvature, where did you look? For example, the "Roughness Parameters" analysis function result shows such a value: grafik Or do you mean in case of line scan? Here the values are still missing in the "Roughness Parameters" results, but you can find them if you press "open" for the "Curvature Distribution" results: grafik But yes, probably we should also add that for line scans to "Roughness Parameters".

@pastewka , @AntoineSIMTEK could help with the second point?

pastewka commented 3 years ago

Regarding the second point, the PSD at q=0 has no meaning. It depends on the mean value of the topography, which is zero in the webapp since the average value is always subtracted. (In that sense it is correct that the value should be zero, but I wouldn't display this.)

Rick224339 commented 3 years ago

974E675B-D629-4224-BC3F-FD19AE5FEFAD AC96AECB-1226-4075-8014-10B9AB5A8252

For the first point, I refer to line scan. In roughness parameter function, curvature is missing. However, in curvature distribution function, I did not find specific value option. But I see your web app has this option. Is there anything wrong with my side? Plus, the screenshot also indicates it fails to analyze curvature distribution of some of my profiles but I did not understand the reasons.

For the second point, I understand it. I care this point because my analysis involves integrating PSD curves from Cq at q=0 to Cq at q=max. The gap between q=0 and first none zero q influences the final computed results.

Thank you very much for the help.

mcrot commented 3 years ago

@Rick224339, did you press the "Open" button? Currently, the "RMS curvature" values for line scans are only there. I agree we should add that to "Roughness parameters". I've added an issue for that in the repo of the web app: https://github.com/ContactEngineering/TopoBank/issues/660

Because of the reason for failure. Could you post an example for the reason or share your data with me inside the web app?

Rick224339 commented 3 years ago
  1. See 'Open' button. Sorry for not noticing that. Now I can check RMS curvature in this place.
  2. The errors are (two examples):

Traceback (most recent call last): File "/app/topobank/taskapp/tasks.py", line 127, in perform_analysis result = analysis.function.eval(subject, kwargs) File "/app/topobank/analysis/models.py", line 288, in eval return self.get_implementation(subject_type).eval(subject, kwargs) File "/app/topobank/analysis/models.py", line 340, in eval return pyfunc(subject, **kwargs) File "/app/topobank/analysis/functions.py", line 308, in curvature_distribution rms_curv = topography.rms_curvature_from_area() if topography.dim == 2 else topography.rms_curvature_from_profile() File "/opt/conda/lib/python3.7/site-packages/SurfaceTopography/HeightContainer.py", line 85, in getattr ', '.join(self._functions.keys()))) AttributeError: Unkown attribute 'rms_curvature_from_profile' and no analysis or pipeline function of this name registered (class DetrendedUniformTopography). Available functions: mean, min, max, scale, detrend, transpose, translate, to_matrix, to_netcdf, to_nonuniform, make_fft, bandwidth, derivative, fourier_derivative, domain_decompose, plot, fill_undefined_data, mirror_stitch, interpolate_bicubic, interpolate_fourier, window, filter, shortcut, longcut, autocorrelation_from_profile, autocorrelation_from_area, power_spectrum_from_profile, power_spectrum_from_area, rms_height_from_profile, rms_height_from_area, rms_gradient, rms_slope_from_profile, rms_laplacian, rms_curvature_from_area, checkerboard_detrend, variable_bandwidth, scale_dependent_curvature_1D, scale_dependent_curvature_2D, scale_dependent_slope_1D, scale_dependent_slope_2D

Analysis failed for subject 100k_sample1_FIXEDv2p1.asc. Traceback: Traceback (most recent call last): File "/app/topobank/taskapp/tasks.py", line 127, in perform_analysis result = analysis.function.eval(subject, kwargs) File "/app/topobank/analysis/models.py", line 288, in eval return self.get_implementation(subject_type).eval(subject, kwargs) File "/app/topobank/analysis/models.py", line 340, in eval return pyfunc(subject, **kwargs) File "/app/topobank/analysis/functions.py", line 308, in curvature_distribution rms_curv = topography.rms_curvature_from_area() if topography.dim == 2 else topography.rms_curvature_from_profile() File "/opt/conda/lib/python3.7/site-packages/SurfaceTopography/HeightContainer.py", line 85, in getattr ', '.join(self._functions.keys()))) AttributeError: Unkown attribute 'rms_curvature_from_profile' and no analysis or pipeline function of this name registered (class DetrendedUniformTopography). Available functions: mean, min, max, scale, detrend, transpose, translate, to_matrix, to_netcdf, to_nonuniform, make_fft, bandwidth, derivative, fourier_derivative, domain_decompose, plot, fill_undefined_data, mirror_stitch, interpolate_bicubic, interpolate_fourier, window, filter, shortcut, longcut, autocorrelation_from_profile, autocorrelation_from_area, power_spectrum_from_profile, power_spectrum_from_area, rms_height_from_profile, rms_height_from_area, rms_gradient, rms_slope_from_profile, rms_laplacian, rms_curvature_from_area, checkerboard_detrend, variable_bandwidth, scale_dependent_curvature_1D, scale_dependent_curvature_2D, scale_dependent_slope_1D, scale_dependent_slope_2D

mcrot commented 3 years ago

Thanks! This seems to be a bug in case of uniform line scans. Are those failures related to uniform line scans exclusively?

I've opened other issues for this:

Rick224339 commented 3 years ago

It seems this bug exists in both uniform and non uniform cases. For more examples, please see ceramic quarry 1 quarry 2 labeled by floor shoe project which are published surface recently by me. It has 36 profiles in total but in curvature distribution function, it fails to analyze 26 profiles of all.

Thanks for the help.

Rick224339 commented 3 years ago

I also appreciate it if RMS curvature can be listed in roughness parameter function for line scans. Plus, if scan size and pixel size are also listed in the same window with these parameters, this will be helpful and convenient to check the scale dependence of RMS parameters.

pastewka commented 3 years ago

Hi @Rick224339 - note that there is a scale dependent slope plot now in the web app. We will also add a scale-dependent curvature plot in the next release. This will probably help you with the things you are trying to look at.

I agree that scan size and pixel size should also be displayed in this table, as those rms parameters don't make sense by themselves.

mcrot commented 3 years ago

@pastewka , I would retrieve scan size and pixel size by topo.physical_sizes and topo.pixel_size, correct?

pastewka commented 3 years ago

That's correct... Although I am not sure whether NonuniformLineScan has pixel_size. There is a bandwidth function that should exist for all containers and yields the same information.

mcrot commented 3 years ago

Regarding the additional values in the table, I've opened a new issue in Topobank: https://github.com/ContactEngineering/TopoBank/issues/677

Regarding the original issue here, this should be solved by using release 0.94.0 of SurfaceTopography in the web app. This is planned for the next release: https://github.com/ContactEngineering/TopoBank/milestone/29 Closing this.