Skip to content

Commit 6e78d4f

Browse files
committed
Re-order args so that positional input still works
1 parent 583ddfd commit 6e78d4f

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lts_array/classes/lts_data_class.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, window_length, window_overlap, alpha):
1717
self.window_overlap = window_overlap
1818
self.alpha = alpha
1919

20-
def build_data_arrays(self, st, latlist, lonlist, rij=None, remove_elements=None):
20+
def build_data_arrays(self, st, latlist, lonlist, remove_elements=None, rij=None):
2121
""" Collect basic data from stream file. Project lat/lon into r_ij coordinates.
2222
2323
Alternatively, if ``rij`` is provided, ``latlist`` and ``lonlist`` are not used
@@ -27,11 +27,11 @@ def build_data_arrays(self, st, latlist, lonlist, rij=None, remove_elements=None
2727
st (stream): An obspy stream object.
2828
latlist (list): A list of latitude points.
2929
lonlist (list): A list of longitude points.
30+
remove_elements (list): A list of elements to remove before processing. Python numbering is used, so "[0]" removes the first element.
3031
rij (array or None): A NumPy array with the first row corresponding to
3132
cartesian "X" - coordinates and the second row corresponding to
3233
cartesian "Y" - coordinates, in units of km. If this is provided then
3334
``latlist`` and ``lonlist`` are ignored.
34-
remove_elements (list): A list of elements to remove before processing. Python numbering is used, so "[0]" removes the first element.
3535
"""
3636
# Check that all traces have the same length
3737
if len(set([len(tr) for tr in st])) != 1:

lts_array/ltsva.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
warnings.simplefilter(action='ignore', category=FutureWarning)
77

88

9-
def ltsva(st, lat_list, lon_list, window_length, window_overlap, alpha=1.0, rij=None, plot_array_coordinates=False, remove_elements=None):
9+
def ltsva(st, lat_list, lon_list, window_length, window_overlap, alpha=1.0, plot_array_coordinates=False, remove_elements=None, rij=None):
1010
r""" Process infrasound or seismic array data with least trimmed squares (LTS).
1111
1212
Args:
@@ -17,12 +17,12 @@ def ltsva(st, lat_list, lon_list, window_length, window_overlap, alpha=1.0, rij=
1717
window_overlap (float): Window overlap in the range (0.0 - 1.0).
1818
alpha (float): Fraction of data for LTS subsetting [0.5 - 1.0].
1919
Choose 1.0 for ordinary least squares (default).
20+
plot_array_coordinates (bool): Plot array coordinates? Defaults to False.
21+
remove_elements (list): (Optional) Remove element number(s) from ``st``, ``lat_list``, and ``lon_list`` before processing. Here numbering refers to the Python index (e.g. [0] = remove 1st element in stream).
2022
rij (array or None): A NumPy array with the first row corresponding to cartesian
2123
"X" - coordinates and the second row corresponding to cartesian "Y" -
2224
coordinates, in units of km. If this is provided then ``lat_list`` and
2325
``lon_list`` are ignored.
24-
plot_array_coordinates (bool): Plot array coordinates? Defaults to False.
25-
remove_elements (list): (Optional) Remove element number(s) from ``st``, ``lat_list``, and ``lon_list`` before processing. Here numbering refers to the Python index (e.g. [0] = remove 1st element in stream).
2626
2727
Returns:
2828
(tuple):

0 commit comments

Comments
 (0)