Skip to content

Commit 6196f45

Browse files
authored
Merge pull request #354 from xylar/remove_unneeded_coastal_tools_args
Remove unneeded arguments from coastal_tools funcs
2 parents 95e6998 + 1d4c493 commit 6196f45

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

conda_package/docs/ocean/coastal_tools.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ Next, the distance to the coastal contours is computed using
116116
:py:func:`mpas_tools.ocean.coastal_tools.distance_to_coast()` with the
117117
following values from ``params``:
118118

119-
* ``'origin'`` - A lon and lat point---no longer used in the code
120119
* ``'nn_search'`` - Whether to use the ``'flann'`` or ``'kdtree'`` algorithm,
121120
with the ``'flann'`` strongly recommended.
122121
* ``'smooth_coastline'`` - The number of neighboring cells along the coastline

conda_package/mpas_tools/ocean/coastal_tools.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ def coastal_refined_mesh(params, cell_width=None, lon_grd=None, lat_grd=None):
317317
coastlines,
318318
lon_grd,
319319
lat_grd,
320-
params["origin"],
321320
params["nn_search"],
322321
params["smooth_coastline"],
323322
params["plot_option"],
@@ -336,8 +335,6 @@ def coastal_refined_mesh(params, cell_width=None, lon_grd=None, lat_grd=None):
336335
params["restrict_box"],
337336
params["plot_option"],
338337
params["plot_box"],
339-
lon_grd,
340-
lat_grd,
341338
coastlines,
342339
call_count)
343340

@@ -609,8 +606,8 @@ def extract_coastlines(nc_file, nc_vars, region_box, z_contour=0, n_longest=10,
609606
##############################################################
610607

611608

612-
def distance_to_coast(coastlines, lon_grd, lat_grd, origin, nn_search,
613-
smooth_window, plot_option=False, plot_box=[], call=None):
609+
def distance_to_coast(coastlines, lon_grd, lat_grd, nn_search, smooth_window,
610+
plot_option=False, plot_box=[], call=None):
614611
# {{{
615612
"""
616613
Extracts a set of coastline contours
@@ -627,9 +624,6 @@ def distance_to_coast(coastlines, lon_grd, lat_grd, origin, nn_search,
627624
lat_grd : ndarray
628625
A 1D array of latitudes in degrees in the range from -90 to 90
629626
630-
origin : ndarray
631-
A lon/lat point defining the origin, not currently used by the code
632-
633627
nn_search : {'kdtree', 'flann'}
634628
The algorithm to use for the nearest neightbor search. 'flann' is
635629
strongly recommended, as it is faster and more memory efficient in our
@@ -740,8 +734,7 @@ def distance_to_coast(coastlines, lon_grd, lat_grd, origin, nn_search,
740734

741735
def compute_cell_width(D, cell_width, lon, lat, dx_min, trans_start,
742736
trans_width, restrict_box, plot_option=False,
743-
plot_box=[], lon_grd=[], lat_grd=[], coastlines=[],
744-
call=None): # {{{
737+
plot_box=[], coastlines=[], call=None): # {{{
745738
"""
746739
Blend cell widths from the input field with the new resolution in the
747740
refined region determined by the distance to the coastline contour.
@@ -787,14 +780,6 @@ def compute_cell_width(D, cell_width, lon, lat, dx_min, trans_start,
787780
plot_box : list of float, optional
788781
The extent of the plot if ``plot_option=True``
789782
790-
lon_grd : ndarray
791-
A 1D array of longitudes in degrees in the range from -180 to 180 used
792-
in plotting if ``plot_option=True`` (the same as ``lon``)
793-
794-
lat_grd : ndarray
795-
A 1D array of latitudes in degrees in the range from -90 to 90 used
796-
in plotting if ``plot_option=True`` (the same as ``lat``)
797-
798783
coastlines : ndarray
799784
An n x 2 array of (longitude, latitude) points along the coastline
800785
contours returned from ``extract_coastlines()`` used in plotting if
@@ -854,7 +839,7 @@ def compute_cell_width(D, cell_width, lon, lat, dx_min, trans_start,
854839

855840
# Find coordinates and data inside plotting box
856841
lon_plot, lat_plot, cell_width_plot = get_data_inside_box(
857-
lon_grd, lat_grd, cell_width / km, plot_box)
842+
lon, lat, cell_width / km, plot_box)
858843

859844
# Plot cell width
860845
fig = plt.figure()

0 commit comments

Comments
 (0)