snpl.rheo module¶
I/O interfaces and utilities for various rheology data.
- snpl.rheo.load_RheologyAdvantageBinary(fp, encoding='utf-16')[source]¶
Loads a RheologyAdvantage raw data (.rsl) file into a list of
hicsv.hicsv
objects.- Parameters:
fp (str or file-like) – Path or file-like object of the source file.
encoding (str) – Encoding of the unicode strings in the source file. Defaults to utf-16.
- Returns:
A list of
hicsv.hicsv
objects, each representing one step.
Examples
>>> ds = snpl.rheo.load_RheologyAdvantageData("test_data-0001o.rsl") >>> print(ds[0].keys) ['frequency [Hz]', 'time [s]', ... ,'normal force [N]', 'gap [um]']
Note
Currently, (mostly) only the geometry info is available. Additional header info may be obtained in the future update.
- snpl.rheo.load_RheologyAdvantageExported(fp, encoding='shift-jis')[source]¶
Loads a text file exported by RheologyAdvantage software.
Only compatible with the exported files with “full” header info.
- Parameters:
fp (str or file-like) – Path or file-like object of the source text file.
encoding (str) – Encoding of the source file. Defaults to shift-jis.
- Returns:
A list of
hicsv.hicsv
objects, each corresponding to one step in the experiment. Only the steps whose data table appears in the source file will be included. That is, the steps without a table is ignored.
Examples
>>> ds = snpl.rheo.load_RheologyAdvantageExported("test data-0001o exp.txt") >>> for d in ds: >>> d.save(d.h["Step name"] + ".txt") # save available steps, using the step name as the file name
- snpl.rheo.load_TriosExported(fp, encoding='utf-8')[source]¶
Loads a text file exported from Trios software into a list of
hicsv.hicsv
objects.- Parameters:
fp (str or file-like) – Path or file-like object of the source text file.
encoding (str) – Encoding of the source file. Defaults to utf-8.
- Returns:
A list of
hicsv.hicsv
objects, each corresponding to one step in the experiment.
Examples
>>> ds = snpl.rheo.load_RheologyAdvantageExported("exported.txt") >>> ds[0].save("output.txt") # save only the first step
Note
Currently, only tab-delimited text is supported. It is not really tested for files with multiple steps so it may not work as expected.