This code takes the roughness of a surface, finds its power spectral density, and fits a power law to its PSD data.
This README file will be used as a set of steps.
- After measuring the roughness of a surface, save the data as an matrix in IDL.
- Take a slice of the data. (Ex: slice = XY[0:8250,1000])
- Take the PSD of the data. (Ex: PSD = fft_powerspectrum(slice))
- Convert that slice and PSD to a .txt file. They should then be in your home directory. (Ex. IDL> restore, 'si_pds' IDL> file = 'slice.txt' IDL> get_lun, unit IDL> openw, unit, file IDL> printf, unit, slice IDL> close, unit IDL> free_lun, unit)
- (Since I was using windows, this is how I downloaded the files locally)
Download the files in windows by opening a cmd window and inputting the following with you credentials.
pscp.exe [email protected]:slice.txt C:\Put\Directory\You\Want\It\In
- Make sure all the .m files and data are in the same directory.
- Open roughness_analysis.m and change the surface slice data and PSD data with your own.
- Change the initial prediction of k and n to your liking.
- Make sure the x and y axes are consistent. (recall that the last point in the FFT and PSD should be half of the sampling frequency)
- You might have to change the starting point of the fit to get rid of influence from outliers.
- Replace any titles and labels with your own
- Assuming your surface is isotropic, review your k2d and n2d.
- As described above, take a matrix of the roughness data and download it onto your computer.
- Make sure all the .m files and data are in the same directory.
- Replace the roughness data in two_d_roughness_analysis.m with your own.
- When you call psd_2D_calculation in two_d_roughness_analysis.m, replace with your own parameters as described in psd_2D_calculation.m.
- Change the initial prediciton of k and n to your liking.
- Change the initial prediction of k2d and n2d to your liking.
- Make sure the x and y axes are consistent. (recall that the last point in the FFT and PSD should be half of the sampling frequency)
- You might have to change the starting point of the fit to get rid of influence from outliers.
- Replace any titles and labels with your own.
- Review your k2d and n2d.