Skip to content

Commit

Permalink
tsview: bugfix for cartopy feature (#767)
Browse files Browse the repository at this point in the history
+ tsview.py: bugfix for cartopy feature while initializing projection

+ timeseries2velocity.read_inps2model(): add print_msg

+ objects/sensor.SEN: fix antenna and PRF parameters

+ smallbaselineApp.py:_read_template(): align the print out "copy for backup" msg
  • Loading branch information
yunjunz authored May 2, 2022
1 parent bbb2ce2 commit 0718be9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
9 changes: 5 additions & 4 deletions mintpy/objects/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,15 @@ def get_unavco_mission_name(meta_dict):
# azfact = azResolution / azPixelSize = 1.46
# rgfact = rgResolution / rgPixelSize = 1.33
# reference:
# 1. Table 2 and Fig. 5d in Jung et al. (2014)
# 2. Table 7-5 in https://sentinel.esa.int/documents/247904/1877131/Sentinel-1-Product-Definition
# 1. Table 2 & Fig. 5d in Jung et al. (2014)
# 2. Table 3-1 & 7-5 in https://sentinel.esa.int/documents/247904/1877131/Sentinel-1-Product-Definition
SEN = {
'carrier_frequency' : 5.405e9, # Hz
'altitude' : 705e3, # m, mean value
'antenna_length' : 45.0, # m
'antenna_length' : 12.3, # m
'antenna_width' : 0.82, # m
'doppler_bandwidth' : 380, # Hz
'pulse_repetition_frequency' : 522, # Hz
'pulse_repetition_frequency' : 1717.13, # Hz, based on real data; 1000-3000 (programmable)
'chirp_bandwidth' : 56.50e6, # Hz
'sampling_frequency' : 64.35e6, # Hz
'azimuth_pixel_size' : 14.1, # m
Expand Down
9 changes: 7 additions & 2 deletions mintpy/smallbaselineApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ def _read_template(self):
self.templateFile = ut.update_template_file(self.templateFile, self.customTemplate)

# 2) backup custome/default template file in inputs/pic folder
flen = len(os.path.basename(self.templateFile))
if self.customTemplateFile:
flen = max(flen, len(os.path.basename(self.customTemplateFile)))

for backup_dirname in ['inputs', 'pic']:
backup_dir = os.path.join(self.workDir, backup_dirname)
# create directory
Expand All @@ -306,8 +310,9 @@ def _read_template(self):
check_readable=False,
print_msg=False) == 'run':
shutil.copy2(tfile, backup_dir)
print('copy {} to {:<8} directory for backup.'.format(os.path.basename(tfile),
os.path.basename(backup_dir)))
print('copy {f:<{l}} to {d:<8} directory for backup.'.format(f=os.path.basename(tfile),
l=flen,
d=os.path.basename(backup_dir)))

# 3) read default template file
print('read default template file:', self.templateFile)
Expand Down
9 changes: 5 additions & 4 deletions mintpy/timeseries2velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def read_date_info(inps):
return inps


def read_inps2model(inps, date_list=None):
def read_inps2model(inps, date_list=None, print_msg=True):
"""get model info from inps"""
# check model date limits
if not date_list:
Expand Down Expand Up @@ -408,9 +408,10 @@ def read_inps2model(inps, date_list=None):
model['log'] = inps.logDict

# msg
print('estimate deformation model with the following assumed time functions:')
for key, value in model.items():
print(' {:<10} : {}'.format(key, value))
if print_msg:
print('estimate deformation model with the following assumed time functions:')
for key, value in model.items():
print(' {:<10} : {}'.format(key, value))

if 'polynomial' not in model.keys():
raise ValueError('linear/polynomial model is NOT included! Are you sure?!')
Expand Down
4 changes: 2 additions & 2 deletions mintpy/tsview.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def read_init_info(inps):
inps.cbar_label += '[{}]'.format(inps.disp_unit_img)

## fit a suite of time func to the time series
inps.model, inps.num_param = ts2vel.read_inps2model(inps, date_list=inps.date_list)
inps.model, inps.num_param = ts2vel.read_inps2model(inps, date_list=inps.date_list, print_msg=inps.print_msg)

# dense TS for plotting
inps.date_list_fit = ptime.get_date_range(inps.date_list[0], inps.date_list[-1])
Expand Down Expand Up @@ -788,7 +788,7 @@ def plot(self):
disp_slider=True,
print_msg=self.print_msg)
subplot_kw = dict(projection=self.map_proj_obj) if self.map_proj_obj is not None else {}
self.fig_img, self.ax_img = plt.subplots(figsize=self.figsize_img, **subplot_kw)
self.fig_img, self.ax_img = plt.subplots(figsize=self.figsize_img, subplot_kw=subplot_kw)

# Figure 1 - Axes 1 - Displacement Map
img_data = np.array(self.ts_data[0][self.idx, :, :])
Expand Down

0 comments on commit 0718be9

Please sign in to comment.