SciFiReaders.readers.microscopy.spm.afm.pifm.PiFMTranslator¶
- class SciFiReaders.readers.microscopy.spm.afm.pifm.PiFMTranslator(file_path, *args, **kwargs)[source]¶
Bases:
sidpy.sid.reader.Reader
Class that writes images, spectrograms, point spectra and associated ancillary data sets to h5 file in pyUSID data structure.
- Parameters
file_path (str) – Path to the file that needs to be read
Notes
This method will check to make sure that the provided file_path is indeed a string and a valid file path.
Consider calling
can_read()
within__init__()
for validating the provided file
- Raises
Methods
Checks whether the provided file can be read by this reader.
Writes a new HDF5 file with the translated data
Sets up the HDF5 file for writing
writes full path, directory, and file name as attributes to class
make_datasets
make_dimensions
- param file_path
Absolute path of the .ibw file
reads the scan parameters and writes them to a dictionary
reads spectrogram, image, and spectra file descriptions and stores all to dictionary where the key:value pairs are filename:[all descriptors]
reads images and saves to dictionary
reads all point spectra and saves to dictionary
reads spectrograms, associated spectral values, and saves them in two dictionaries
Writes the datasets as pyNSID datasets to the HDF5 file
- can_read(*args, **kwargs)¶
Checks whether the provided file can be read by this reader.
This basic function compares the file extension against the
extension
keyword argument. If the extension matches, this function returns True- Parameters
extension (str or iterable of str, Optional. Default = None) – File extension for the input file.
- Returns
file_path – Path to the file that needs to be provided to read() if the provided file was indeed a valid file Else, None
- Return type
:raises NotImplementedError : if this function is called for this or a child: :raises class that does not provide the
extension
keyword argument:Notes
It is recommended to add additional checks as necessary to ensure that the translator can indeed read the given file such as by validating the headers or similar metadata.
- create_h5(append_path='', overwrite=False)[source]¶
Writes a new HDF5 file with the translated data
- append_pathstring (Optional)
h5_file to add these data to, must be a path to the h5_file on disk
- overwritebool (optional, default=False)
If True, will overwrite an existing .h5 file of the same name
- create_hdf5_file(append_path='', overwrite=False)[source]¶
Sets up the HDF5 file for writing
- append_pathstring (Optional)
h5_file to add these data to, must be a path to the h5_file on disk
- overwritebool (optional, default=False)
If True, will overwrite an existing .h5 file of the same name
- read()[source]¶
- Parameters
file_path (String / unicode) – Absolute path of the .ibw file
verbose (Boolean (Optional)) – Whether or not to show print statements for debugging
- Returns
sidpy.Dataset – Image layers are saved as separate Dataset objects
- Return type
List of sidpy.Dataset objects.
- read_file_desc()[source]¶
reads spectrogram, image, and spectra file descriptions and stores all to dictionary where the key:value pairs are filename:[all descriptors]