scippneutron.io.xye.load_xye#

scippneutron.io.xye.load_xye(fname, *, dim, unit, coord_unit, coord=None)[source]#

Read a data array from an XYE file.

See scippneutron.io.xye.save_xye() for a description of the file format.

Since XYE files are lossy, some metadata must be provided manually when calling this function.

Parameters:
  • fname (str | Path | TextIOBase) – Name or file handle of the input file.

  • dim (str) – Dimension of the returned data.

  • unit (Unit | str | None) – Unit of the returned data array.

  • coord_unit (Unit | str | None) – Unit of the coordinate of the returned data array.

  • coord (Optional[str], default: None) – Coordinate name of the returned data. Defaults to the value of dim.

Returns:

da – Data array read from the file.

See also

scippneutron.io.xye.save_xye

Function to write XYE files.