Class DatasetDescriptor
java.lang.Object
uk.ac.diamond.scisoft.analysis.rpc.flattening.DatasetDescriptor
- All Implemented Interfaces:
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
in Java or an Numpy.ndarray in Python.
invalid reference
Dataset
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionflatten(IRootFlattener rootFlattener) Return the flattened form of this object, possibly using rootFlattener to flatten any contained objects.Return full path to the file to loadgetIndex()Get the index in the loaded data holder to use as the data set if no name is specified.getName()Get the name in the loaded data holder to use as the data set.booleanReturn whether to delete the file when this object is unflattened to a DatasetvoidsetDeleteAfterLoad(boolean deleteAfterLoad) Set to true to delete the file when this object is unflattened to a DatasetvoidsetFilename(String filename) Full path to the file to load.voidSet the index in the loaded data holder to use as the data set if no name is specified.voidSet the name in the loaded data holder to use as the data set.
-
Constructor Details
-
DatasetDescriptor
public DatasetDescriptor()
-
-
Method Details
-
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
Get the index in the loaded data holder to use as the data set if no name is specified.- Returns:
- index
-
getName
Get the name in the loaded data holder to use as the data set.- Returns:
- name
-
setFilename
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
Set the index in the loaded data holder to use as the data set if no name is specified.- Parameters:
index- to load
-
setName
Set the name in the loaded data holder to use as the data set.- Parameters:
name- to load
-
flatten
Description copied from interface:IFlattensReturn the flattened form of this object, possibly using rootFlattener to flatten any contained objects.
-