sasdata.file_converter.nxcansas_writer module

NXcanSAS 1/2D data reader for writing HDF5 formatted NXcanSAS files.

class sasdata.file_converter.nxcansas_writer.NXcanSASWriter

Bases: object

A class for writing in NXcanSAS data files. Any number of data sets may be written to the file. Currently 1D and 2D SAS data sets are supported

NXcanSAS spec: http://download.nexusformat.org/sphinx/classes/contributed_definitions/NXcanSAS.html

Dependencies:

The NXcanSAS writer requires h5py => v2.5.0 or later.

write(dataset, filename)

Write an array of Data1d or Data2D objects to an NXcanSAS file, as one SASEntry with multiple SASData elements. The metadata of the first elememt in the array will be written as the SASentry metadata (detector, instrument, sample, etc).

Parameters:
  • dataset – A list of Data1D or Data2D objects to write

  • filename – Where to write the NXcanSAS file