hyperspy.io_plugins.blockfile module

hyperspy.io_plugins.blockfile.file_writer(filename, signal, **kwds)

Write signal to blockfile.

Parameters
  • file (str) – Filename of the file to write to

  • signal (instance of hyperspy Signal2D) – The signal to save.

  • endianess (str) – ‘<’ (default) or ‘>’ determining how the bits are written to the file

  • intensity_scaling (str or 2-Tuple of float/int) – If the signal datatype is not uint8 this argument provides intensity linear scaling strategies. If ‘dtype’, the entire dtype range is mapped to 0-255, if ‘minmax’ the range between the minimum and maximum intensity is mapped to 0-255, if ‘crop’ the range between 0-255 is conserved without overflow, if a tuple of values the values between this range is mapped to 0-255. If None (default) no rescaling is performed and overflow is permitted.

  • navigator_signal (str or Signal2D) – A blo file also saves a virtual bright field image for navigation. This option determines what kind of data is stored for this image. The default option “navigator” uses the navigator image if it was previously calculated, else it is calculated here which can take some time for large datasets. Alternatively, a Signal2D of the right shape may also be provided. If set to None, a zero array is stored in the file.

hyperspy.io_plugins.blockfile.get_default_header(endianess='<')

Returns a header pre-populated with default values.