sm4reader.m and the .mat format
sm4reader.m accepts a file ID of an .sm4 file in the active directory in MATLAB* and returns outfile and formatoutfile.
[formatoutfile, outfile] = sm4reader(fileID)
This function can be used directly using the above call in the command line, but is designed to be used by the other functions in this suite. In order to make it usable, make sure it is stored in a proper MATLAB path.*
*For details on how to add user functions / folders to MATLAB paths, making your own startup.m may be useful.
outfile is a translation of the .sm4 file into a structure with roughly the informational layout as the original .sm4 file. outfile is mostly used for debugging and looking for information that hasn't yet been translated into the formatoutfile; therefor for most purposes this can be ignored.
formatoutfile contains all the information we are interested in so far; the number of fields changes as time goes on and we decide identify more information to be included. The format was chosen to be as clear as possible. It has up to three main structures.
Later on this page is a list of the file types and fields currently included in formatoutfile. The fields are meant to have obvious, descriptive titles; hopefully you agree.
[top]
[formatoutfile, outfile] = sm4reader(fileID)
This function can be used directly using the above call in the command line, but is designed to be used by the other functions in this suite. In order to make it usable, make sure it is stored in a proper MATLAB path.*
*For details on how to add user functions / folders to MATLAB paths, making your own startup.m may be useful.
outfile is a translation of the .sm4 file into a structure with roughly the informational layout as the original .sm4 file. outfile is mostly used for debugging and looking for information that hasn't yet been translated into the formatoutfile; therefor for most purposes this can be ignored.
formatoutfile contains all the information we are interested in so far; the number of fields changes as time goes on and we decide identify more information to be included. The format was chosen to be as clear as possible. It has up to three main structures.
- formatoutfile.Spatial contains information on spatial scans such as topography, current, dF, etc.. including the data and relevant parameters (e.g. bias set point, number of scan lines).
- formatoutfile.Spectral contains information of the y vs. x variety, so far scanning tunneling spectroscopy (I-V, dI/dV curves), frequency sweeps, and Z spectroscopy.
- formatoutfile.PLL contains the information of the phase-locked loop used during frequency modulation atomic force microscopy operation.
Later on this page is a list of the file types and fields currently included in formatoutfile. The fields are meant to have obvious, descriptive titles; hopefully you agree.
[top]
There are many possible types of scans and measurements the RHK scope can take. Below is the scan types we have tested and accounted for in the formatting/conversion, as well as what files we know aren't being converted and don't want them to be.
Types of scans tested and supported
Purposely skipped files
[top]
Types of scans tested and supported
- Spatial STM scans -- Topography, Current, LIA Current channels
- Spatial AFM scans -- Topography, dF, PLL Amplitude, PLL Phase, Current channels, the PLL's parameters
- Scanning tunneling spectroscopy -- (repeated) point curves, line measurements, IV and dIdV channels
- Other spectroscopy -- V, Z spectroscopy
Purposely skipped files
- Memoscope data
[top]
General fields
formatoutfile.Spatial
STM-specific fields
formatoutfile.Spatial
AFM-specific fields
formatoutfile.Spatial
[top]
formatoutfile.Spatial
- .TopoData a cell containing the topographical data
- .TopoUnit the unit for TopoData
- .CurrentData a cell containing the spatial current data (may or may not be on during AFM scan)
- .CurrentUnit the unit for CurrentData (may or may not be on during AFM scan)
- .points number of point measurements per line
- .lines number of scan lines per image measurement
- .width width of the scan area
- .height height of the scan area
- .widthheightUnit the unit associated with the width and height parameters
- .xoffset the global x location of the center of the scan
- .yoffset the global y location of the center of the scan
- .xyoffsetUnit the unit describing the x and y offsets
STM-specific fields
formatoutfile.Spatial
- .LIACurrentData a cell containing all the lock-in amplifier channel spatial current data
- .LIACurrentUnit the unit for LIACurrentData
- .bias sample bias applied during the scan
- .biasUnit the unit of the bias
- .current the current setpoint of the measurement
- .currentUnit the unit of the current setpoint
AFM-specific fields
formatoutfile.Spatial
- .PLLAmplitudeData a cell containing the spatial phase-locked loop amplitude data
- .PLLAmplitudeUnit PLL amplitude unit
- .PLLPhaseData a cell containing the spatial phase-locked loop phase data
- .PLLPhaseUnit PLL phase unit
- .dFData a cell containing the spatial phase-locked loop frequency shift (dF) data
- .dFUnit dF unit
- .dFsetpoint the dF setpoint used to engage the surface
- .dFsetpointUnit the unit of the dF setpoint
- .PLLDriveData a cell containing the spatial phase-locked loop drive data
- .PLLDriveUnit the unit for the PLL drive
[top]
General fields
formatoutfile.Spectral
The fields below are recorded but don't contain info for our measurements
Scanning tunneling spectroscopy-specific fields
formatoutfile.Spectral
[top]
formatoutfile.Spectral
- .points the number of data points in the series
- .scans the number of measurements at that point, or along that line
- .bias the sample bias applied during the engage of the measurement
- .biasUnit the unit for bias
- .current the current setpoint applied during the engage of the measurement
- .currentUnit the current unit
- .xdata the x-axis data, this is calculated
- .xdataUnit the unit for the x-data
- .xCoord global x position of the location of the measurement; in a line this is a cell
- .yCoord global y position of the location of the measurement; in a line this is a cell
- .xyCoordUnit the coordinate unit
- .type designates what type of scan it is, point for point STS, line for line STS, frequency for frequency sweep, Vspec for V spectroscopy, Zspec for z spectroscopy.
The fields below are recorded but don't contain info for our measurements
- .startTime
- .dx
- .dy
- .xCumulative
- .yCumulative
Scanning tunneling spectroscopy-specific fields
formatoutfile.Spectral
- .dIdV_Point_Data a cell containing single point dIdV measurements
- .IV_Point_Data a cell containing single point IV measurements
- .dIdV_Line_Data a cell containing line dIdV measurements
- .IV_Line_Data a cell containing line IV measurements
[top]
PLL fields
General fields
formatoutfile.PLL
[top]
General fields
formatoutfile.PLL
- .DriveAmplitude the drive applied to the probe causing it to oscillate
- .DriveAmplitudeUnit the drive applied unit
- .DriveRefFrequency the reference oscillation frequency of the probe
- .DriveRefFrequencyUnit the reference frequency unit
- .LockinFrequencyOffset the offset of the lock-in
- .LockinFrequencyOffsetUnit the unit of the offset
- .LockinHarmonicFactor -----
- .LockinPhaseOffset the offset of the phase lock-in
- .LockinPhaseUnit the lock-in phase offset unit
- .PIGain frequency feedback PI gain
- .PIGainUnit frequency feedback PI Gain unit
- .PIntCutOffFreq -----
- .PIntCutOffFreqUnit -----
- .LowerBound -----
- .UpperBound -----
- .PIOutputUnit -----
- .DissPIGain amplitude (dissipative) feedback PI Gain
- .DissPIGainUnit amplitude (dissipative) feedback PI Gain Unit
- .DissIntCutOffFreq -----
- .DissIntCutOffFreqUnit -----
- .DissLowerBound -----
- .DissUpperBound -----
- .DissPIOutputUnit -----
[top]