Skip to content

Commit feae339

Browse files
authored
add version tag for 1.6.0 (#1190)
+ version: add version tag for 1.6.0 + utils.transect_yx/lalo(): update comment for example usage
1 parent 4d34412 commit feae339

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

src/mintpy/utils/utils.py

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -264,23 +264,25 @@ def transect_yx(z, atr, start_yx, end_yx, interpolation='nearest'):
264264
"""Extract 2D matrix (z) value along the line [x0,y0;x1,y1]
265265
Link: http://stackoverflow.com/questions/7878398/how-to-extract-an-arbitrary-line-of-values-from-a-numpy-array
266266
267-
Parameters: z : (np.array) 2D data matrix
268-
atr : (dict) attribute
267+
Parameters: z : (np.ndarray) 2D data matrix
268+
atr : (dict) attribute
269269
start_yx : (list) y,x coordinate of start point
270-
end_yx : (list) y,x coordinate of end point
270+
end_yx : (list) y,x coordinate of end point
271271
interpolation : str, sampling/interpolation method, including:
272272
'nearest' - nearest neighbour
273273
'linear' - linear spline interpolation (order of 1)
274274
'cubic' - cubic spline interpolation (order of 3)
275275
'quintic' - quintic spline interpolation (order of 5)
276276
277-
Returns: transect: (dict) containing 1D matrix:
278-
'X' - 1D np.array for X/column coordinates in float32
279-
'Y' - 1D np.array for Y/row. coordinates in float32
280-
'value' - 1D np.array for z value in float32
277+
Returns: transect : (dict) containing 1D matrix:
278+
'X' - 1D np.array for X/column coordinates in float32
279+
'Y' - 1D np.array for Y/row coordinates in float32
280+
'value' - 1D np.array for z value in float32
281281
'distance' - 1D np.array for distance in float32
282282
283-
Example: transect = transect_yx(dem, demRsc, [10,15], [100,115])
283+
Example: from mintpy.utils import readfile, utils as ut
284+
dem, atr = readfile.read('srtm1.dem.wgs84')
285+
txn = transect_yx(dem, atr, [10,15], [100,115])
284286
"""
285287
interpolation = interpolation.lower()
286288
[y0, x0] = start_yx
@@ -359,7 +361,28 @@ def transect_yx(z, atr, start_yx, end_yx, interpolation='nearest'):
359361

360362

361363
def transect_lalo(z, atr, start_lalo, end_lalo, interpolation='nearest'):
362-
"""Extract 2D matrix (z) value along the line [start_lalo, end_lalo]"""
364+
"""Extract 2D matrix (z) value along the line [start_lalo, end_lalo]
365+
366+
Parameters: z : (np.ndarray) 2D data matrix
367+
atr : (dict) attribute
368+
start_yx : (list) y,x coordinate of start point
369+
end_yx : (list) y,x coordinate of end point
370+
interpolation : str, sampling/interpolation method, including:
371+
'nearest' - nearest neighbour
372+
'linear' - linear spline interpolation (order of 1)
373+
'cubic' - cubic spline interpolation (order of 3)
374+
'quintic' - quintic spline interpolation (order of 5)
375+
376+
Returns: transect : (dict) containing 1D matrix:
377+
'X' - 1D np.array for X/column coordinates in float32
378+
'Y' - 1D np.array for Y/row coordinates in float32
379+
'value' - 1D np.array for z value in float32
380+
'distance' - 1D np.array for distance in float32
381+
382+
Example: from mintpy.utils import readfile, utils as ut
383+
vel, atr = readfile.read('geo_velocity_msk.h5')
384+
txn = transect_yx(vel, atr, [30.0, 110.0], [30.2, 111.3])
385+
"""
363386
coord = coordinate(atr)
364387
[y0, y1], [x0, x1] = coord.lalo2yx([start_lalo[0], end_lalo[0]],
365388
[start_lalo[1], end_lalo[1]])

src/mintpy/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
###########################################################################
99
Tag = collections.namedtuple('Tag', 'version date')
1010
release_history = (
11+
Tag('1.6.0', '2024-05-09'),
1112
Tag('1.5.3', '2023-11-23'),
1213
Tag('1.5.2', '2023-08-09'),
1314
Tag('1.5.1', '2023-01-03'),

0 commit comments

Comments
 (0)