slippy.surface.read_tst_file¶
- slippy.surface.read_tst_file(filename)[source]¶
Reads a .tst file from a bruker UMT machine
- Parameters
filename (str) – The full path to the .tst file including extension
- Returns
data – The full data including all metadata from the .tst file
- Return type
dict
Notes
The structure of data can be a little confusing at the top level it is a dict with two keys: one for the metadata that applies to the entire file and one for the data from each run of the script.
The metadata is stored in another dict while the data for each run are in a list with the same order as they were run in.
This structure is kept all the way though every time something is ordered a list is used other wise a dictionary is used.
To access data from the first run: >>>first_run=data[‘runs’][0]
To access data from the second step in that run: >>>second_step=first_run[‘steps’][1]
To get the numerical data from that step: >>>num_data=second_step[‘data’]
This doesn’t need to be split: >>>num_data=data[‘runs’][0][‘steps’][1][‘data’]
Gives the same result.
num_data is a dict of lists with keys of the results recorded: >>>num_data[‘Fx’] Gives the force results in the x direction