io

javelin.io.load_HDF5_to_xarray(filename)[source]

Load HDF file into an xarray DataArray using pandas HDFStore

requries pytables

javelin.io.numpy_to_vti(array, origin, spacing, filename)[source]

This function write a VtkImageData vti file from a numpy array.

Parameters:
  • array (numpy.ndarray) – input array
  • origin (array like object of values) – the origin of the array
  • spacing (array like object of values) – the step in each dimension
  • filename (str) – output filename (.vti)
javelin.io.read_mantid_MDHisto(filename)[source]

Read the saved MDHisto from from Mantid and returns an xarray.DataArray object

javelin.io.read_stru(filename, starting_cell=(1, 1, 1))[source]

Read in a .stru file saved from DISCUS into a javelin Structure

If the line ncell is not present in the file all the atoms will be read into a single cell.

javelin.io.read_stru_to_ase(filename)[source]

This function read the legacy DISCUS stru file format into a ASE Atoms object.

Parameters:filename (str) – filename of DISCUS stru file
Returns:ASE Atoms object
Return type:ase.Atoms
javelin.io.save_mantid_MDHisto(dataArray, filename)[source]

Save a file that can be read in using Mantid’s LoadMD

javelin.io.save_xarray_to_HDF5(dataArray, filename, complib=None)[source]

Save the xarray DataArray to HDF file using pandas HDFStore

attrs will be saved as metadata via pickle

requries pytables

complib : {‘zlib’, ‘bzip2’, ‘lzo’, ‘blosc’, None}, default None