Class DatasetDescriptor

java.lang.Object
uk.ac.diamond.scisoft.analysis.rpc.flattening.DatasetDescriptor
All Implemented Interfaces:
IFlattens

public class DatasetDescriptor extends Object implements IFlattens
Use this class to describe a data set that already resides on disk and can be loaded using the file loaders. This object is flattened to a flattened representation that is unflattened by DatasetHelper.

The unflattened form of this type is an

invalid reference
Dataset
in Java or an Numpy.ndarray in Python.

When unflattened in Java the filename can be any file that Analysis understands with its file loaders as the filename is passed to

invalid reference
LoaderFactory
.

When unflattened in Python the filename must be an .npy fileformat that numpy.load can process. .npz file formats are not officially supported.

See Also:
  • Constructor Details

    • DatasetDescriptor

      public DatasetDescriptor()
  • Method Details

    • getFilename

      public String getFilename()
      Return full path to the file to load
      Returns:
      file name
    • isDeleteAfterLoad

      public boolean isDeleteAfterLoad()
      Return whether to delete the file when this object is unflattened to a Dataset
      Returns:
      whether to delete
    • getIndex

      public Integer getIndex()
      Get the index in the loaded data holder to use as the data set if no name is specified.
      Returns:
      index
    • getName

      public String getName()
      Get the name in the loaded data holder to use as the data set.
      Returns:
      name
    • setFilename

      public void setFilename(String filename)
      Full path to the file to load.
      Parameters:
      filename - of the file to load.
    • setDeleteAfterLoad

      public void setDeleteAfterLoad(boolean deleteAfterLoad)
      Set to true to delete the file when this object is unflattened to a Dataset
      Parameters:
      deleteAfterLoad -
    • setIndex

      public void setIndex(Integer index)
      Set the index in the loaded data holder to use as the data set if no name is specified.
      Parameters:
      index - to load
    • setName

      public void setName(String name)
      Set the name in the loaded data holder to use as the data set.
      Parameters:
      name - to load
    • flatten

      public Object flatten(IRootFlattener rootFlattener)
      Description copied from interface: IFlattens
      Return the flattened form of this object, possibly using rootFlattener to flatten any contained objects.
      Specified by:
      flatten in interface IFlattens
      Parameters:
      rootFlattener -
      Returns:
      the flattened form of this object