hyperspy.misc.io package

Submodules

hyperspy.misc.io.tools module

hyperspy.misc.io.tools.append2pathname(filename, to_append)

Append a string to a path name

Parameters:
  • filename (str) –
  • to_append (str) –
hyperspy.misc.io.tools.dump_dictionary(file, dic, string='root', node_separator='.', value_separator=' = ')
hyperspy.misc.io.tools.ensure_directory(path)

Check if the path exists and if it does not create the directory

hyperspy.misc.io.tools.incremental_filename(filename, i=1)

If a file with the same file name exists, returns a new filename that does not exists.

The new file name is created by appending -n (where n is an integer) to path name

Parameters:
  • filename (str) –
  • i (int) – The number to be appended.
hyperspy.misc.io.tools.overwrite(fname)

If file exists ‘fname’, ask for overwriting and return True or False, else return True.

hyperspy.misc.io.ttols module

Created on Thu Jun 6 12:10:39 2013

@author: fjd29

hyperspy.misc.io.utils_readfile module

hyperspy.misc.io.utils_readfile.read_boolean(f, endian)

Read a 1-Byte charater from file f with a given endianness (byte order). endian can be either ‘big’ or ‘little’.

hyperspy.misc.io.utils_readfile.read_byte(f, endian)

Read a 1-Byte charater from file f with a given endianness (byte order). endian can be either ‘big’ or ‘little’.

hyperspy.misc.io.utils_readfile.read_char(f, endian)

Read a 1-Byte charater from file f with a given endianness (byte order). endian can be either ‘big’ or ‘little’.

hyperspy.misc.io.utils_readfile.read_double(f, endian)

Read a 8-Byte floating point from file f with a given endianness (byte order). endian can be either ‘big’ or ‘little’.

hyperspy.misc.io.utils_readfile.read_float(f, endian)

Read a 4-Byte floating point from file f with a given endianness (byte order). endian can be either ‘big’ or ‘little’.

hyperspy.misc.io.utils_readfile.read_long(f, endian)

Read a 4-Byte integer from file f with a given endianness (byte order). endian can be either ‘big’ or ‘little’.

hyperspy.misc.io.utils_readfile.read_short(f, endian)

Read a 2-Byte integer from file f with a given endianness (byte order). endian can be either ‘big’ or ‘little’.

hyperspy.misc.io.utils_readfile.read_ulong(f, endian)

Read a 4-Byte integer from file f with a given endianness (byte order). endian can be either ‘big’ or ‘little’.

hyperspy.misc.io.utils_readfile.read_ushort(f, endian)

Read a 2-Byte integer from file f with a given endianness (byte order). endian can be either ‘big’ or ‘little’.

Module contents