diff --git a/.DS_Store b/.DS_Store index f413f58..123a18f 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/pyraws/raw/raw_event.py b/pyraws/raw/raw_event.py index 40dd8cf..b4dc339 100644 --- a/pyraws/raw/raw_event.py +++ b/pyraws/raw/raw_event.py @@ -76,7 +76,7 @@ def __init__( else: self.__useful_granule_bounding_box_dict = {} - self.__device=device + self.__device = device def from_path(self, raw_dir_path, bands_list, verbose=True): """Read specific bands of the Sentinel-2 raw event located at ""raw_dir_path"". @@ -253,7 +253,6 @@ def get_device(self): """ return self.__device - def get_stackable_granules(self): """Returns list of stackable granules couples indices and stacking positions. diff --git a/pyraws/raw/raw_granule.py b/pyraws/raw/raw_granule.py index 01d96d2..a2d260e 100644 --- a/pyraws/raw/raw_granule.py +++ b/pyraws/raw/raw_granule.py @@ -1172,7 +1172,7 @@ def show_bands_superimposition( bands_superimposed_equalized = equalize_tensor(bands_superimposed, n_std) bands_superimposed_equalized = ( bands_superimposed_equalized - / (2**12 - 1) + / (2 ** 12 - 1) * bands_superimposed.max() / bands_superimposed_equalized.max() ) @@ -1182,13 +1182,9 @@ def show_bands_superimposition( bands_superimposed_equalized / bands_superimposed_equalized.max() ) if ax is not None: - ax.imshow( - bands_superimposed_equalized.detach().cpu().numpy(), - ) + ax.imshow(bands_superimposed_equalized.detach().cpu().numpy(),) else: - plt.imshow( - bands_superimposed_equalized.detach().cpu().numpy(), - ) + plt.imshow(bands_superimposed_equalized.detach().cpu().numpy(),) def show_bands( self, diff --git a/pyraws/utils/visualization_utils.py b/pyraws/utils/visualization_utils.py index 813788f..0b49a27 100644 --- a/pyraws/utils/visualization_utils.py +++ b/pyraws/utils/visualization_utils.py @@ -37,7 +37,7 @@ def equalize_tensor(raw_granule_tensor, n_std=2): band[band < band_mean - n_std * band_std] = band_mean - n_std * band_std band[band > band_mean + n_std * band_std] = band_mean + n_std * band_std - band, cdf = image_histogram_equalization(band.numpy(), number_bins=2**16) + band, cdf = image_histogram_equalization(band.numpy(), number_bins=2 ** 16) band = torch.from_numpy(band) # band_clahe = clahe.apply((band.numpy() * CONVERSION ).astype(np.uint8)) # raw_granule_tensor_equalized[:,:,n]= torch.from_numpy(band_clahe/CONVERSION) diff --git a/scripts_and_studies/granules_filtering/granules_filtering.py b/scripts_and_studies/granules_filtering/granules_filtering.py index cbbf35d..a1b7ed2 100644 --- a/scripts_and_studies/granules_filtering/granules_filtering.py +++ b/scripts_and_studies/granules_filtering/granules_filtering.py @@ -288,8 +288,8 @@ def main(): complementary_granule_names_list = [] - complementary_granules_name_bottom = ( - complementary_granules_name.split("_bottom_") + complementary_granules_name_bottom = complementary_granules_name.split( + "_bottom_" ) for name in complementary_granules_name_bottom: diff --git a/scripts_and_studies/runscripts/generate_coregistration_plot.py b/scripts_and_studies/runscripts/generate_coregistration_plot.py index 52e0db3..4821ca8 100644 --- a/scripts_and_studies/runscripts/generate_coregistration_plot.py +++ b/scripts_and_studies/runscripts/generate_coregistration_plot.py @@ -45,10 +45,8 @@ def main(): database="THRAWS", ) - raw_coregistered_granule_1 = ( - raw_event.coarse_coregistration( # granule index to coregister. - granules_idx=[pargs.granule_index] - ) + raw_coregistered_granule_1 = raw_event.coarse_coregistration( # granule index to coregister. + granules_idx=[pargs.granule_index] ) # Perform the corase coregistration of the "Etna_00" event.