Skip to content

Commit

Permalink
commit changes autoblack
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbastiano committed Aug 2, 2023
1 parent 6e1620c commit 985fa8b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 31 deletions.
6 changes: 2 additions & 4 deletions pyraws/raw/raw_granule.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,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 @@ -1181,9 +1181,7 @@ def show_bands_superimposition(
bands_superimposed_equalized / bands_superimposed_equalized.max()
)

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
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,13 @@ def main():
negative_correlation_found = False
for shift in tqdm(shift_range[0]):
try:
coarse_coregistered_granule = (
stacked_granules.coarse_coregistration(
crop_empty_pixels=False,
bands_shifts=[shift],
downsampling=downsampling,
)
coarse_coregistered_granule = stacked_granules.coarse_coregistration(
crop_empty_pixels=False,
bands_shifts=[shift],
downsampling=downsampling,
)
coarse_coregistered_granule_tensor = (
coarse_coregistered_granule.as_tensor(
downsampling=downsampling
)
coarse_coregistered_granule_tensor = coarse_coregistered_granule.as_tensor(
downsampling=downsampling
)
# coarse_coregistered_granule_tensor=coarse_coregistered_granule_tensor/coarse_coregistered_granule_tensor.max()
by_shifted = coarse_coregistered_granule_tensor[:, :, 1]
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
12 changes: 2 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,7 @@
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3.8",
],
packages=[
"pyraws",
"pyraws.database",
"pyraws.raw",
"pyraws.l1",
"pyraws.utils",
],
packages=["pyraws", "pyraws.database", "pyraws.raw", "pyraws.l1", "pyraws.utils",],
python_requires=">=3.8, <4",
project_urls={
"Source": "https://github.com/ESA-PhiLab/PyRawS",
},
project_urls={"Source": "https://github.com/ESA-PhiLab/PyRawS",},
)

0 comments on commit 985fa8b

Please sign in to comment.