Skip to content

Commit

Permalink
black formatted files
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbastiano committed Mar 22, 2024
1 parent b773732 commit 0e2da5e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 16 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 1 addition & 2 deletions pyraws/raw/raw_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"".
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 3 additions & 7 deletions pyraws/raw/raw_granule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pyraws/utils/visualization_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions scripts_and_studies/granules_filtering/granules_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0e2da5e

Please sign in to comment.