Inspect
Inspecting Experimental Data
Class for inspecting HDF5 cluster data, checking for NaNs, adding track counts, and visualizing clusters.
Parameters
number_to_viz: (int) Number of events to visualize. num_tracks: (int) Number of tracks to filter for visualization.
Return
None
Source code in scripts/data_inspect.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
__init__(number_to_viz, num_tracks)
Initialize the Inspect object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
number_to_viz
|
int
|
Number of events to visualize. |
required |
num_tracks
|
int
|
Number of tracks to filter for visualization. |
required |
Source code in scripts/data_inspect.py
add_attr_tracks(group, file_est)
Add a new attribute 'tracks' to each dataset in the HDF5 group from parquet files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
Group
|
HDF5 group object. |
required |
est_path
|
str
|
Path to the parquet file with estimate classification. |
required |
Returns:
| Type | Description |
|---|---|
|
h5py.Group: Modified HDF5 group with new 'tracks' attribute. |
Source code in scripts/data_inspect.py
check_nans(group)
Check for NaN values in each dataset of the HDF5 group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
Group
|
HDF5 group object. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if any NaNs are found, False otherwise. |
Source code in scripts/data_inspect.py
h5_keys_extract(file_h5)
Extract the first group from an HDF5 file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_h5
|
File
|
HDF5 file object. |
required |
Returns:
| Type | Description |
|---|---|
|
h5py.Group: The first HDF5 group in the file. |
Source code in scripts/data_inspect.py
viz_cluster(group)
Visualize clusters in the HDF5 group and save to a PDF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
Group
|
HDF5 group object. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |