diff --git a/src/mintpy/utils/readfile.py b/src/mintpy/utils/readfile.py index 24c1c029c..677a3325d 100644 --- a/src/mintpy/utils/readfile.py +++ b/src/mintpy/utils/readfile.py @@ -699,7 +699,7 @@ def read_binary_file(fname, datasetName=None, box=None, xstep=1, ystep=1): cpx_band = 'magnitude' elif fext in ['.mli', '.rmli']: - byte_order = 'little-endian' + byte_order = 'little-endian' # big-endian # SNAP # BEAM-DIMAP data format diff --git a/src/mintpy/view.py b/src/mintpy/view.py index 569b776fe..e45c6776e 100644 --- a/src/mintpy/view.py +++ b/src/mintpy/view.py @@ -1652,9 +1652,15 @@ def plot(self): no_data_val = readfile.get_no_data_value(self.file) if self.no_data_value is not None: vprint(f'masking pixels with NO_DATA_VALUE of {self.no_data_value}') + # convert integer to floating to enable masking with nan + if np.issubdtype(data.dtype, np.integer): + data = np.array(data, np.float32) data[data == self.no_data_value] = np.nan elif no_data_val is not None and not np.isnan(no_data_val): vprint(f'masking pixels with NO_DATA_VALUE of {no_data_val}') + # convert integer to floating to enable masking with nan + if np.issubdtype(data.dtype, np.integer): + data = np.array(data, np.float32) data[data == no_data_val] = np.nan # update/save mask info