nabu.resources.dataset_tomoscan
source module nabu.resources.dataset_tomoscan
Datasets parsing classes that use the tomoscan library . Used for Nexus-NXTomo and EDF scans.
Classes
-
TomoscanDataset — A base class for scans that use tomoscan behind the scenes.
-
EDFDataset — EDF Dataset analyzer for legacy ESRF acquisitions
-
NXTomoDataset — NXTomo dataset analyzer
Functions
source enum ImageKey(*args, **kwds)
Bases : Enum
Attributes
-
ALIGNMENT
-
PROJECTION
-
FLAT_FIELD
-
DARK_FIELD
-
INVALID
source class TomoscanDataset(location, extra_options=None)
Bases : Dataset
A base class for scans that use tomoscan behind the scenes.
Methods
-
check_defined_attribute — Utility function to check that a given attribute is defined.
source method TomoscanDataset.check_defined_attribute(name, error_msg=None)
Utility function to check that a given attribute is defined.
Raises
-
ValueError
source class EDFDataset(location, extra_options=None)
Bases : TomoscanDataset
EDF Dataset analyzer for legacy ESRF acquisitions
Attributes
-
hdf5_entry — Return the HDF5 entry of the current dataset. Not applicable for EDF (return None)
Methods
source property EDFDataset.hdf5_entry
Return the HDF5 entry of the current dataset. Not applicable for EDF (return None)
source method EDFDataset.get_reduced_flats(**reader_kwargs)
Raises
-
FileNotFoundError
source method EDFDataset.get_reduced_darks(**reader_kwargs)
Raises
-
FileNotFoundError
source property EDFDataset.files
source method EDFDataset.get_reader(**kwargs)
source method EDFDataset.get_excluded_projections_indices(including_other_frames_types=True)
Raises
-
NotImplementedError
source method EDFDataset.get_frames_indices(frame_type)
source class NXTomoDataset(location, extra_options=None)
Bases : TomoscanDataset
NXTomo dataset analyzer
Attributes
-
hdf5_entry — Return the HDF5 entry of the current dataset
Methods
-
get_data_slices — Return indices in the data volume where images correspond to a given kind.
-
frames_slices — Return a list of slice objects corresponding to the data corresponding to "frame_type". For example, if the dataset flats are located at indices [1, 2, ..., 99], then frame_slices("flats") will return [slice(0, 100)].
source property NXTomoDataset.z_translation
source property NXTomoDataset.x_translation
source property NXTomoDataset.dataset_hdf5_url
source property NXTomoDataset.hdf5_entry
Return the HDF5 entry of the current dataset
source method NXTomoDataset.get_data_slices(what)
Return indices in the data volume where images correspond to a given kind.
Parameters
-
what : str — Which keys to get. Can be "projections", "flats", "darks"
Returns
-
slices : list of slice — A list where each item is a slice.
source method NXTomoDataset.get_reduced_flats(method='median', force_reload=False, **reader_kwargs)
source method NXTomoDataset.get_reduced_darks(method='mean', force_reload=False, **reader_kwargs)
source method NXTomoDataset.frames_slices(frame_type)
Return a list of slice objects corresponding to the data corresponding to "frame_type". For example, if the dataset flats are located at indices [1, 2, ..., 99], then frame_slices("flats") will return [slice(0, 100)].
source method NXTomoDataset.get_reader(**kwargs)
source property NXTomoDataset.scan_basename
source property NXTomoDataset.scan_dirname
source method NXTomoDataset.get_alignment_projections(image_sub_region=None, return_in_radians=None)
source method NXTomoDataset.get_index_from_angle(angle, image_key=0, return_found_angle=False)
source method NXTomoDataset.get_image_at_angle(angle_rad, frame_type='projection', sub_region=None, return_angle_and_index=False)
source method NXTomoDataset.get_frame(idx)
source method NXTomoDataset.get_frames_indices(frame_type)
source method NXTomoDataset.index_to_proj_number(proj_index)
source method NXTomoDataset.get_excluded_projections_indices(including_other_frames_types=True)