createc.DAT_IMG

class createc.DAT_IMG(file_path=None, file_binary=None, file_name=None)

Read .dat file and generate meta data and images as numpy arrays.

There are two options for input:

option 1: one arg, i.e. the full path to the .dat file

option 2: two named args

  1. the binary content of the file together

  2. the file_name as a string

Parameters:
  • file_path (str) – the full path to the .dat file

  • file_binary (bin) – the binary content of the file together

  • file_name (str) – the file_name as a string

Returns:

dat_img – dat_file_object with meta data and image numpy arrays. Meta data is a dict, one can expand the dict at will. Images are a list of numpy arrays.

Return type:

DAT_IMG

__init__(file_path=None, file_binary=None, file_name=None)

Methods

__init__([file_path, file_binary, file_name])

meta_keys()

Print all available keys in meta

Attributes

datetime

Return datetime objext of the file using the file name

nom_size

Return the nominal size of image in angstrom in namedtuple (x, y) assuming no pre-termination while scanning.

offset

Return offset relatvie to the whole range in angstrom in the format of namedtuple (x, y)

size

Return the true size of image in angstrom in namedtuple (x, y)

timestamp

Same as datetime, but it converts to seconds since 1970, 1, 1.