Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add view --interpolation option #1029

Merged
merged 4 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mintpy/cli/modify_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def read_input_index_list(idxList, stackFile=None):
print('Unrecoganized input: '+idx)
idxListOut = sorted(set(idxListOut))

# remove index not existed in the input ifgram stack file
# remove index not existing in the input ifgram stack file
if stackFile:
obj = ifgramStack(stackFile)
obj.open(print_msg=False)
Expand Down
4 changes: 2 additions & 2 deletions src/mintpy/cli/prep_gamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
2) secondary .par file, e.g. 130129_4rlks.amp.par
3) interferogram .off file, e.g. 130118-130129_4rlks.off

Other metadata files are recommended and can be generated from the above 3 if not existed, more specifically:
Other metadata files are recommended and can be generated from the above 3 if not existing, more specifically:
4) baseline files, e.g. 130118-130129_4rlks.baseline and 130118-130129_4rlks.base_perp,
which can be generated from file 1-3 with Gamma command base_orbit and base_perp.
5) corner files, e.g. 130118_4rlks.amp.corner_full and 130118_4rlks.amp.corner,
which can be generated from file 1 with Gamma command SLC_corners.

This script will read all these files (generate 4 and 5 if not existed), merge them into one, convert their name from
This script will read all these files (generate 4 and 5 if not existing), merge them into one, convert their name from
Gamma style to ROI_PAC style, and write to an metadata file, same name as input binary data file with suffix .rsc,
e.g. diff_filt_HDR_130118-130129_4rlks.unw.rsc

Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/modify_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def onclick(event):
date12_click.append(date12)
ax.plot([datesNum[mIdx], datesNum[sIdx]], [pbase[mIdx], pbase[sIdx]], 'r', lw=4)
else:
print(date12+' is not existed in input file')
print(date12+' does not exist in input file')
plt.draw()

fig.canvas.mpl_connect('button_press_event', onclick)
Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/objects/stackDict.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def write2hdf5(self, outputFile='geometryRadar.h5', access_mode='w', box=None, x
compression=compression)

###############################
# Generate Dataset if not existed in binary file: incidenceAngle, slantRangeDistance
# Generate Dataset if it doesn't exist as a binary file: incidenceAngle, slantRangeDistance
for dsName in [i for i in ['incidenceAngle', 'slantRangeDistance'] if i not in self.dsNames]:
# Calculate data
data = None
Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/prep_gamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_perp_baseline(m_par_file, s_par_file, off_file, atr_dict={}):

def get_lalo_ref(m_par_file, atr_dict={}):
"""Extract LAT/LON_REF1/2/3/4 from corner file, e.g. 130118_4rlks.amp.corner.
If it's not existed, call Gamma script - SLC_corners - to generate it from SLC par file
If it does not exist, call Gamma script - SLC_corners - to generate it from SLC par file
e.g. 130118_4rlks.amp.par

Parameters: m_par_file - str, path, reference date parameter file, i.e. 130118_4rlks.amp.par
Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/simulation/iono.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def read_sub_tec(tec_file, version=2.1, print_msg=True):

def check_date_list_against_reference(date_list, dset_list, date_list_ref, fill_value=np.nan):
"""Check input date/dset_list against the reference date list:
1. remove dates that are not existed in the reference date list
1. remove dates that are not existing in the reference date list
2. fill data of the missing dates
"""
# remove dates not in date_list_ref
Expand Down
5 changes: 5 additions & 0 deletions src/mintpy/utils/arg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ def add_data_disp_argument(parser):
data.add_argument('--nd','--no-data-val','--no-data-value', dest='no_data_value', type=float,
help='Specify the no-data-value to be ignored and masked.')

data.add_argument('--interp','--interpolation', dest='interpolation', default='nearest',
help='matplotlib interpolation method for imshow, e.g.:\n'
'none, antialiased, nearest, bilinear, bicubic, spline16, sinc, etc. Check more at:\n'
'https://matplotlib.org/stable/gallery/images_contours_and_fields/'
'interpolation_methods.html')
data.add_argument('--wrap', action='store_true',
help='re-wrap data to display data in fringes.')
data.add_argument('--wrap-range', dest='wrap_range', type=float, nargs=2,
Expand Down
4 changes: 2 additions & 2 deletions src/mintpy/utils/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,15 +781,15 @@ def select_pairs_star(date_list, m_date=None, pbase_list=[], date_format='YYMMDD
date8_list = sorted(ptime.yyyymmdd(date_list))
date6_list = ptime.yymmdd(date8_list)

# Select reference date if not existed
# Select reference date if not chosen
if not m_date:
m_date = select_reference_date(date8_list, pbase_list)
print('auto select reference date: '+m_date)

# Check input reference date
m_date8 = ptime.yyyymmdd(m_date)
if m_date8 not in date8_list:
print('Input reference date is not existed in date list!')
print('Input reference date does not exist in date list!')
print(f'Input reference date: {m_date8}')
print(f'Input date list: {date8_list}')
m_date8 = None
Expand Down
6 changes: 3 additions & 3 deletions src/mintpy/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def plot_slice(ax, data, metadata, inps):
inps.disp_ref_pixel = False

im = ax.imshow(data, cmap=inps.colormap, vmin=inps.vlim[0], vmax=inps.vlim[1],
extent=extent, origin='upper', interpolation='nearest',
extent=extent, origin='upper', interpolation=inps.interpolation,
alpha=inps.transparency, animated=inps.animation, zorder=1)

# Draw faultline using GMT lonlat file
Expand Down Expand Up @@ -625,7 +625,7 @@ def format_coord(x, y):
extent = (inps.pix_box[0]-0.5, inps.pix_box[2]-0.5,
inps.pix_box[3]-0.5, inps.pix_box[1]-0.5)
im = ax.imshow(data, cmap=inps.colormap, vmin=inps.vlim[0], vmax=inps.vlim[1],
extent=extent, interpolation='nearest', alpha=inps.transparency, zorder=1)
extent=extent, interpolation=inps.interpolation, alpha=inps.transparency, zorder=1)
ax.tick_params(labelsize=inps.font_size)

# Plot Seed Point
Expand Down Expand Up @@ -1166,7 +1166,7 @@ def plot_subplot4figure(i, inps, ax, data, metadata):
inps.pix_box[3]-0.5, inps.pix_box[1]-0.5)

im = ax.imshow(data, cmap=inps.colormap, vmin=vlim[0], vmax=vlim[1],
interpolation='nearest', alpha=inps.transparency,
interpolation=inps.interpolation, alpha=inps.transparency,
extent=extent, zorder=1)

# Plot Seed Point
Expand Down