mlreco.iotools.parsers.sparse module¶
-
mlreco.iotools.parsers.sparse.parse_sparse2d(sparse_event_list)[source]¶ A function to retrieve sparse tensor input from larcv::EventSparseTensor2D object
Returns the data in format to pass to SCN
schema: input_data: parser: parse_sparse2d args: sparse_event_list: - sparse2d_pcluster_0 (, 0) - sparse2d_pcluster_1 (, 1) - ...
- Configuration
sparse_event_list (list of larcv::EventSparseTensor2D) – Optionally, give an array of (larcv::EventSparseTensor2D, int) for projection id
- Returns
voxels (np.ndarray(int32)) – Coordinates with shape (N,2)
data (np.ndarray(float32)) – Pixel values/channels with shape (N,C)
-
mlreco.iotools.parsers.sparse.parse_sparse3d(sparse_event_list, features=None, hit_keys=[], nhits_idx=None)[source]¶ A function to retrieve sparse tensor input from larcv::EventSparseTensor3D object
Returns the data in format to pass to DataLoader
schema: input_data: parser: parse_sparse3d args: sparse_event_list: - sparse3d_pcluster_0 - sparse3d_pcluster_1 - ...
- Configuration
sparse_event_list (list of larcv::EventSparseTensor3D) – Can be repeated to load more features (one per feature).
features (int, optional) – Default is None (ignored). If a positive integer is specified, the sparse_event_list will be split in equal lists of length features. Each list will be concatenated along the feature dimension separately. Then all lists are concatenated along the first dimension (voxels). For example, this lets you work with distinct detector volumes whose input data is stored in separate TTrees.`features` is required to be a divider of the sparse_event_list length.
hit_keys (list of int, optional) – Indices among the input features of the _hit_key_ TTrees that can be used to infer the _nhits_ quantity (doublet vs triplet point).
nhits_idx (int, optional) – Index among the input features where the _nhits_ feature (doublet vs triplet) should be inserted.
- Returns
voxels (numpy array(int32) with shape (N,3)) – Coordinates
data (numpy array(float32) with shape (N,C)) – Pixel values/channels, as many channels as specified larcv::EventSparseTensor3D.
-
mlreco.iotools.parsers.sparse.parse_sparse3d_ghost(sparse_event_semantics)[source]¶ A function to retrieve sparse tensor input from larcv::EventSparseTensor3D object
Converts the sematic class to a ghost vs non-ghost label.
schema: ghost_label: parser: parse_sparse3d args: sparse_event_semantics: sparse3d_semantics
- Configuration
sparse_event_semantics (larcv::EventSparseTensor3D)
- Returns
a numpy array with the shape (N,3+1) where 3+1 represents (x,y,z) coordinate and 1 stored ghost labels (channels).
- Return type
np.ndarray