From 0abdb8a98fbce55863c00254fab7dd42faef18c1 Mon Sep 17 00:00:00 2001 From: guangzhi Date: Fri, 24 Jul 2020 10:06:09 +0800 Subject: [PATCH] a bit more doc string change --- ipart/AR_detector.py | 19 ++++++++++++++++--- ipart/utils/rdp.py | 6 +++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ipart/AR_detector.py b/ipart/AR_detector.py index 63771b7..d2ea1ac 100644 --- a/ipart/AR_detector.py +++ b/ipart/AR_detector.py @@ -699,7 +699,12 @@ def getARData(slab, quslab, qvslab, anoslab, quano, qvano, areas, (indices defined in the matrix of corresponding mask in .) timestr (str): string of time snap. - param_dict (dict): parameter dict defined in Global preamble. + param_dict (dict): a dict containing parameters controlling the + detection process. Keys of the dict: + 'thres_low', 'min_area', 'max_area', 'max_isoq', 'max_isoq_hard', + 'min_lat', 'max_lat', 'min_length', 'min_length_hard', 'rdp_thres', + 'fill_radius', 'single_dome', 'max_ph_ratio', 'edge_eps'. + See the doc string of findARs() for more. Returns: labels (cdms.TransientVariable): (n * m) 2D int map showing all ARs @@ -1199,7 +1204,11 @@ def findARAxis(quslab, qvslab, armask_list, costhetas, sinthetas, param_dict, sinthetas (cdms.TransientVariable): (n * m) 2D slab of grid cell shape: sin=dy/sqrt(dx^2+dy^2). param_dict (dict): a dict containing parameters controlling the - detection process. See the doc string of findARs() for more. + detection process. Keys of the dict: + 'thres_low', 'min_area', 'max_area', 'max_isoq', 'max_isoq_hard', + 'min_lat', 'max_lat', 'min_length', 'min_length_hard', 'rdp_thres', + 'fill_radius', 'single_dome', 'max_ph_ratio', 'edge_eps'. + See the doc string of findARs() for more. Keyword Args: verbose (bool): print some messages or not. @@ -1311,7 +1320,11 @@ def _findARs(anoslab, areas, param_dict): Args: anoslab (cdms.TransientVariable): (n * m) 2D anomalous IVT slab, in kg/m/s. areas (cdms.TransientVariable): (n * m) 2D grid cell area slab, in km^2. - param_dict (dict): parameter dict controlling the detection process. + param_dict (dict): a dict containing parameters controlling the + detection process. Keys of the dict: + 'thres_low', 'min_area', 'max_area', 'max_isoq', 'max_isoq_hard', + 'min_lat', 'max_lat', 'min_length', 'min_length_hard', 'rdp_thres', + 'fill_radius', 'single_dome', 'max_ph_ratio', 'edge_eps'. See the doc string of findARs() for more. Returns: diff --git a/ipart/utils/rdp.py b/ipart/utils/rdp.py index de4cda2..197d7ea 100644 --- a/ipart/utils/rdp.py +++ b/ipart/utils/rdp.py @@ -8,19 +8,19 @@ import numpy as np def distance(a, b): - '''Eularian distance between 2 points + '''Euclidean distance between 2 points Args: a (tuple): (x, y) coordinates of point A. b (tuple): (x, y) coordinates of point B. Returns: - result (float): Eularian distance between 2 points + result (float): Euclidean distance between 2 points ''' return sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) def point_line_distance(point, start, end): - '''Eularian distance between a point and a line + '''Euclidean distance between a point and a line Args: point (tuple): (x, y) coordinates of a point.