3. io¶
-
pyIMD.io.read_from_disk.
read_from_dat
(file, delimiter)¶ Method to read data from dat files (i.e from Nanonis software).
Parameters: - file (str) – File path + file name.
- delimiter (str) – Delimiter used in the data file to separate columns
Returns: Returns data structured in a pandas data frame.
Return type: data (pandas data frame)
-
pyIMD.io.read_from_disk.
read_from_file
(file, delimiter, header=0)¶ Method to read data from a file.
Parameters: - file (str) – File path + file name to a .TDMS or .txt file.
- delimiter (str) – Delimiter used in the data file to separate columns
- header (int) – True if file has a header. False otherwise
Returns: Returns data structured in a pandas data frame.
Return type: data (pandas data frame)
-
pyIMD.io.read_from_disk.
read_from_tdms
(file)¶ Method to read data from National Instruments technical data management streaming files (TDMS).
Parameters: file (str) – File path + file name string. Returns: Returns data structured in a pandas data frame. Return type: data (pandas data frame)
-
pyIMD.io.read_from_disk.
read_from_text
(file, delimiter, read_from_row, header=0)¶ Method to read data from text files.
Parameters: - file (str) – File path + file name.
- delimiter (str) – Delimiter used in the data file to separate columns
- read_from_row (int, None) – Row number from where to start reading data to be able to skip heading text rows. Make sure that you keep the Frequency, Amplitude and Phase headers.
- header (bool) – True if file has a header. False otherwise
Returns: Returns data structured in a pandas data frame.
Return type: data (pandas data frame)
-
pyIMD.io.read_from_disk.
read_tdms_metadata
(file)¶ Method to read metadata from National Instruments technical data management streaming files (TDMS).
Parameters: file (str) – File path + file name string. Returns: Returns metadata structured in groups. Return type: data (pandas data frame)
-
pyIMD.io.write_to_disk.
write_concat_data
(directory, delimiter, time_interval)¶ Method to write concatenate data from single dat files (i.e data logger from Nanonis software).
Parameters: - directory (str) – Directory containing files to concatenate.
- delimiter (str) – Delimiter to be used in the data file to separate columns.
- time_interval (int) – Measurement time interval in milliseconds.
Returns: Writes concatenated data to single .csv file.
Return type: file (void)
-
pyIMD.io.write_to_disk.
write_to_disk_as
(file_format, plot_object, file, **kwargs)¶ Method to write figures in various file formats
Parameters: - file_format (str) – File format identifier i.e. png or pdf
- plot_object (ggplot object) – ggplot object
- file (str) – File path + file name of the figure to save
Keyword Arguments: - width (int) – Figure width (optional)
- height (int) – Figure height (optional)
- units ('str`) – Figure units (optional) ‘in’, ‘mm’ or ‘cm’
- resolution (int) – Figure resolution in dots per inch [dpi] (optional)
Returns: Writes figure to disk in the respective file format
Return type: file (void)
-
pyIMD.io.write_to_disk.
write_to_pdf
(plot_object, file, **kwargs)¶ Method to write figures in pdf format to current directory
Parameters: - plot_object (ggplot object) – ggplot object
- file (str) – File path + file name of figure to save
Keyword Arguments: - width (int) – Figure width (optional)
- height (int) – Figure height (optional)
- units ('str`) – Figure units (optional) ‘in’, ‘mm’ or ‘cm’
- resolution (int) – Figure resolution in dots per inch [dpi] (optional)
Returns: Writes figure to disk as pdf
Return type: pdf file (void)
-
pyIMD.io.write_to_disk.
write_to_png
(plot_object, file, **kwargs)¶ Method to write figures in png format to current directory
Parameters: - plot_object (ggplot obj) – ggplot object
- file (str) – File path + file name of the figure to save
Keyword Arguments: - width (int) – Figure width (optional)
- height (int) – Figure height (optional)
- units (str) – Figure units (optional) ‘in’, ‘mm’ or ‘cm’
- resolution (int) – Figure resolution in dots per inch [dpi] (optional)
Returns: Writes figure to disk as png
Return type: png file (void)