From 83441ec62015d8c1aa96d02f07131130e7e78865 Mon Sep 17 00:00:00 2001 From: Gabriele Meoni Date: Fri, 1 Mar 2024 10:50:47 +0100 Subject: [PATCH] Adding getter for raw_event device. --- pyraws/raw/raw_event.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pyraws/raw/raw_event.py b/pyraws/raw/raw_event.py index 5d1e749..40dd8cf 100644 --- a/pyraws/raw/raw_event.py +++ b/pyraws/raw/raw_event.py @@ -220,7 +220,7 @@ def get_bands_list(self): return self.__bands_names def get_bounding_box_dict(self): - """Get bounding box dictionaries. + """Bounding box dictionaries getter. Returns: dict: Returns {useful granules : bounding box dictionary} @@ -228,7 +228,7 @@ def get_bounding_box_dict(self): return self.__useful_granule_bounding_box_dict def get_event_class(self): - """Get event class. + """Event class getter. Returns: dict: Returns {useful granules : bounding box dictionary} @@ -236,13 +236,24 @@ def get_event_class(self): return self.__event_class def get_granule(self, granule_idx): - """It returns the granule addressed by granule_idx. + """Returns the granule addressed by granule_idx. Args: granule_idx (int): granule index. + Returns: + raw_granule: raw granule matching the corresponding index. """ return self.__granules_collection[granule_idx] + def get_device(self): + """Returns the used device. + + Returns: + torch.device: used torch device. + """ + return self.__device + + def get_stackable_granules(self): """Returns list of stackable granules couples indices and stacking positions.