Skip to content

Commit 022a9ca

Browse files
Fix polarization vars detection
1 parent a1d891b commit 022a9ca

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

insardev/insardev/BatchCore.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4983,10 +4983,9 @@ def plot_composite(pol1, pol2):
49834983
assert vmin is None and vmax is None, "ERROR: arguments 'quantile' and 'vmin', 'vmax' cannot be used together"
49844984

49854985
sample = next(iter(self.values()))
4986-
# find all variables in the first dataset related to polarizations
4987-
# TODO
4988-
#polarizations = [pol for pol in ['VV','VH','HH','HV'] if pol in sample.data_vars]
4989-
polarizations = list(sample.data_vars)
4986+
# Only plot spatial variables (with y, x dims), skip 1D coords like ref/rep/BPR
4987+
polarizations = [v for v in sample.data_vars
4988+
if sample[v].ndim >= 2 and sample[v].dims[-2:] == ('y', 'x')]
49904989
#print ('polarizations', polarizations)
49914990

49924991
# Handle composite mode

0 commit comments

Comments
 (0)