grid_definition¶
Detector-specific grid layouts: lookup tables, shapes, and scatter into tensors.
Each GridDefinition is bound to a Detector.
ImageRepresentation
calls GridDefinition.forward() to place pixel rows into image tensor(s).
- class graphnet.models.data_representation.images.mappings.grid_definition.GridDefinition(*args, **kwargs)[source]¶
Bases:
ModelDetector-specific orthonormal image grid(s).
Holds tensor shapes and tables that map pixel keys to voxel indices.
Construct GridDefinition.
- Parameters:
detector (
Detector) – Geometry this grid is defined for (CNN grids are detector-specific).pixel_feature_names (
List[str]) – Column names expected on each pixel row, including keys listed inmap_pixels_by.args (Any)
kwargs (Any)
- Raises:
ValueError – If
detectoris not an instance of one of the detectors listed incompatible_detectors.- Return type:
object
- abstract property compatible_detectors: List[Type[Detector]]¶
Detector classes this grid can be built for.
- abstract property map_pixels_by: List[str]¶
Feature columns that join pixel rows to
mappings().
- abstractmethod mappings()[source]¶
DataFrame(s) keyed by
map_pixels_bywith voxel index columns.- Return type:
List[DataFrame]
- abstractmethod forward(data, data_feature_names)[source]¶
Scatter pixel features into shaped tensors (see subclasses).
- Return type:
Data- Parameters:
data (Data)
data_feature_names (List[str])
- abstract property shape: List[List[int]]¶
Return the shape of the output images as a list of tuples.
In the dimensions (F,D,H,W) where F is the number of features per pixel. And D,H,W are the dimension of the image
- class graphnet.models.data_representation.images.mappings.grid_definition.IC86GridDefinition(*args, **kwargs)[source]¶
Bases:
GridDefinitionIceCube-86 CNN grid (main array + DeepCore) layouts and lookup table.
Construct IC86GridDefinition.
- Parameters:
detector (
Detector) –IceCube86instance (grid is fixed to that geometry).dtype (
dtype) – data type used for node features. e.g. ´torch.float´string_label (
str, default:'string') – Name of the feature corresponding to the DOM string number. Values Integers between 1 - 86dom_number_label (
str, default:'dom_number') – Name of the feature corresponding to the DOM number (1 - 60). Values Integers between 1 - 60 where 1 is the dom with the highest z coordinate.pixel_feature_names (
List[str]) – Names of each column in expected input data that will be built into a image.include_main_array (
bool, default:True) – If True, the main array will be included.include_lower_dc (
bool, default:True) – If True, the lower DeepCore will be included.include_upper_dc (
bool, default:True) – If True, the upper DeepCore will be included.args (Any)
kwargs (Any)
- Raises:
ValueError – If no array type is included.
- Return type:
object
NOTE: Expects input data to be DOMs with aggregated features.
- property map_pixels_by: List[str]¶
String and DOM identifiers used for voxel lookup.
- mappings()[source]¶
Return the single combined lookup table for all sub-images.
- Return type:
List[DataFrame]
- forward(data, data_feature_names)[source]¶
Scatter pixel rows into IceCube-86 image tensor(s).
- Return type:
Data- Parameters:
data (Data)
data_feature_names (List[str])
- property shape: List[List[int]]¶
Return the shape of the output images as a list of tuples.
- class graphnet.models.data_representation.images.mappings.grid_definition.ExamplePrometheusGridDefinition(*args, **kwargs)[source]¶
Bases:
GridDefinitionExample single-image grid for Prometheus-style layouts.
Construct grid.
- Parameters:
detector (
Detector) – TypicallyORCA150in the example scripts.dtype (
dtype) – data type used for node features. e.g. ´torch.float´string_label (
str, default:'sensor_string_id') – Name of the feature corresponding to the sensor string number.sensor_number_label (
str, default:'sensor_id') – Name of the feature corresponding to the sensor numberpixel_feature_names (
List[str]) – Names of each column in expected input data that will be built into a image.args (Any)
kwargs (Any)
- Raises:
ValueError – If no array type is included.
- Return type:
object
NOTE: Expects input data to be sensors with aggregated features.
- property compatible_detectors: List[Type[Detector]]¶
Example grid is built for the ORCA150 geometry.
- property map_pixels_by: List[str]¶
String and sensor identifiers used for voxel lookup.
- mappings()[source]¶
Return the embedded lookup table for the example layout.
- Return type:
List[DataFrame]
- forward(data, data_feature_names)[source]¶
Scatter pixel rows into the example 3D image tensor.
- Return type:
Data- Parameters:
data (Data)
data_feature_names (List[str])
- property shape: List[List[int]]¶
Return the shape of the output images as a list of tuples.