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

extend --style scatter to tsview #1157

Merged
merged 1 commit into from
Mar 10, 2024
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
6 changes: 0 additions & 6 deletions src/mintpy/cli/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ def create_parser(subparsers=None):
' reverse = x * -1\n'
' inverse = 1 / x')

# plot data in different styles: image, scatter, contour etc.
parser.add_argument('--style', dest='style', choices={'image', 'scatter'}, default='image',
help='Plot data as image or scatter (default: %(default)s).')
parser.add_argument('--scatter-size', dest='scatter_marker_size', type=float, metavar='SIZE', default=10,
help='Scatter marker size in points**2 (default: %(default)s).')

parser = arg_utils.add_data_disp_argument(parser)
parser = arg_utils.add_dem_argument(parser)
parser = arg_utils.add_figure_argument(parser)
Expand Down
26 changes: 18 additions & 8 deletions src/mintpy/utils/arg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,30 @@ 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,
default=[-1.*math.pi, math.pi], metavar=('MIN', 'MAX'),
help='range of one cycle after wrapping (default: %(default)s).')

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('--alpha', dest='transparency', type=float,
help='Data transparency. \n'
'0.0 - fully transparent, 1.0 - no transparency.')

# flip X/Y-axis
data.add_argument('--flip-lr', dest='flip_lr',
action='store_true', help='flip left-right')
data.add_argument('--flip-ud', dest='flip_ud',
action='store_true', help='flip up-down')
data.add_argument('--noflip', dest='auto_flip', action='store_false',
help='turn off auto flip for radar coordinate file')

# multilook / average for data reduction
data.add_argument('--nmli','--num-multilook','--multilook-num', dest='multilook_num',
type=int, default=1, metavar='NUM',
help='multilook data in X and Y direction with a factor for display '
Expand All @@ -87,9 +93,13 @@ def add_data_disp_argument(parser):
'If multilook is True and multilook_num=1, '
'multilook_num will be estimated automatically.\n'
'Useful when displaying big datasets.')
data.add_argument('--alpha', dest='transparency', type=float,
help='Data transparency. \n'
'0.0 - fully transparent, 1.0 - no transparency.')

# plot data in different styles: image, scatter, contour etc.
parser.add_argument('--style', dest='style', choices={'image', 'scatter'}, default='image',
help='Plot data as image or scatter (default: %(default)s).')
parser.add_argument('--scatter-size', dest='scatter_marker_size', type=float, metavar='SIZE', default=10,
help='Scatter marker size in points**2 (default: %(default)s).')

return parser


Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def plot_slice(ax, data, metadata, inps):
Parameters: ax : matplot.pyplot axes object
data : 2D np.ndarray,
metadata : dictionary, attributes of data
inps : Namespace, optional, input options for display
inps : Namespace, input options for display
Returns: ax : matplot.pyplot axes object
inps : Namespace for input options
im : matplotlib.image.AxesImage object
Expand Down