Skip to content

Commit

Permalink
allow overview in browse_ifg
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstanie committed Dec 1, 2023
1 parent c40e552 commit 4f8ca03
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/sweets/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def browse_ifgs(
layout="box",
axes: Optional[plt.Axes] = None,
ref_unw: Optional[tuple[float, float]] = None,
overview: Optional[int] = None,
subsample_factor: Union[int, tuple[int, int]] = 1,
):
"""Browse interferograms in a sweets directory.
Expand Down Expand Up @@ -171,6 +172,8 @@ def browse_ifgs(
ref_unw : Optional[tuple[int, int]]
Reference point for all .unw files.
If not passed, subtracts the mean of each file.
overview : int, optional
Load an overview of the image instead of full res.
subsample_factor : int or tuple[int, int]
Amount to downsample when loading images.
"""
Expand Down Expand Up @@ -229,10 +232,14 @@ def apply_ref(unw):
fig = axes[0].figure

# imgs = np.stack([io.load_gdal(f) for f in file_list])
img = io.load_gdal(file_list[0], subsample_factor=subsample_factor)
img = io.load_gdal(
file_list[0], subsample_factor=subsample_factor, overview=overview
)
phase = np.angle(img)
if cor_list is not None:
cor = io.load_gdal(cor_list[0], subsample_factor=subsample_factor)
cor = io.load_gdal(
cor_list[0], subsample_factor=subsample_factor, overview=overview
)
else:
cor = np.abs(img)
titles = [f.stem for f in file_list] # type: ignore
Expand Down Expand Up @@ -380,7 +387,7 @@ def _make_dismph_colors():

try:
plt.get_cmap("dismph")
except:
except ValueError:
DISMPH = LinearSegmentedColormap.from_list("dismph", _make_dismph_colors().T / 256)
plt.register_cmap(cmap=DISMPH)

Expand Down

0 comments on commit 4f8ca03

Please sign in to comment.