Commit 29e2767f authored by Eva Börgens's avatar Eva Börgens
Browse files

update docstrings to google format

parent 905b12bc
......@@ -15,7 +15,7 @@ def get_grid_area(lon : np.ndarray, lat : np.ndarray) -> np.ndarray:
""""
Function getting the area weights of a coordinate list
Parameters:
Args:
lon : np.ndarray
array of longitudes
lat : np.ndarray
......@@ -38,7 +38,7 @@ def get_area(lon_ll: float, lat_ll: float, lon_ur: float,lat_ur: float) -> float
""""
returns area of rectangular on sphere, defined by corner points lower left ll and upper right ur
Parameters:
Args:
lon_ll: float
lon of lower left corner
lat_ll: float
......@@ -67,7 +67,7 @@ def cov_function_lat(lat1: float, lat2: float,
Function to compute covariance function between two points according to
publication Boergens et al. 2020
Parameters:
Args:
lat1, lat2: float
Latitude of the two points
d: float
......@@ -79,15 +79,15 @@ def cov_function_lat(lat1: float, lat2: float,
a0: float
anisotropy parameter
ka0_2, ka0_4, ka0_6, ka0_8: float
Legende polynome parameters for a0
Legende polynome Args for a0
a1: float
isotropy shape parameter
ka1_2, ka1_4, ka1_6, ka1_8: float
Legende polynome parameters for a1
Legende polynome Args for a1
c0: float
amplitude parameter
k2,k4, k6, k8: float
Legende polynome parameters for c0
Legende polynome Args for c0
Returns:
float
Covariance
......@@ -118,7 +118,7 @@ def legendre_polynome(n: int, lat: float) -> float:
"""
Computes Legendre Polynome of degree n at given latitude lat
Parameters:
Args:
n: int
lat: float
......@@ -134,7 +134,7 @@ def sum_legendre(n_max: int, leg_weights: np.ndarray, lat:float) -> float:
"""
Computes weighted sum of Legendre Polynomes
Parameters:
Args:
n_max: int
maximum degree of Legendre Polynomes
leg_weights: np.ndarray
......@@ -161,7 +161,7 @@ def yaglom(dist: float,
"""
Function to compute the adapted Yaglom function
Parameters:
Args:
dist: float
spherical distance
theta: float
......@@ -188,7 +188,7 @@ def distance(lon_0: float, lat_0: float, lon_1: float, lat_1: float):
"""
convert geograpic coordinates to spherical distances
Parameters:
Args:
lon_0: float
[degree]
lat_0: float
......@@ -225,7 +225,7 @@ def azimut_angle(lon_0: float, lat_0: float, lon_1: float, lat_1: float):
"""
get azimut angle between geograpic coordinates
Parameters:
Args:
lon_0: float
[degree]
lat_0: float
......@@ -264,7 +264,7 @@ def compute_covariance(region_coords: np.ndarray,
"""
Function to compute the covariances for a region
Parameters:
Args:
region_coords: np.ndarray
coordinates of region, size [n,2]
gridstd: np.ndarray
......@@ -347,7 +347,7 @@ def get_timeseries(grid, lon_grid, lat_grid, region_coords):
"""
Returns mean tws time series of region
Parameters:
Args:
grid: np.ndarray
tws grid, size [t,n,m]
lon_grid: np.ndarray
......
......@@ -8,7 +8,9 @@ from io import test_coordiantes
def arg_parser():
"""
Argument parser of input line
:return: ArgumentParser.arguments
Returns:
ArgumentParser.arguments
"""
parser = ArgumentParser(
......
......@@ -15,7 +15,7 @@ def read_netcdf(filename: str) -> Dict[str, np.ndarray]:
""""
Reads a TWS netcdf file as provided from GravIS
Parameters:
Args:
filename: string
Returns:
......@@ -40,7 +40,7 @@ def read_ascii(filename: str) -> np.ndarray:
""""
Reads an Ascii file with coordinates
Parameters:
Args:
filename: string
Returns:
......@@ -64,7 +64,7 @@ def test_coordiantes(filename: str):
""""
Tests if more than 2 coordinates are given in the file
Parameters:
Args:
filename: string
"""
coords = read_ascii(filename)
......@@ -87,7 +87,7 @@ def same_dist_elems(arr: npt.ArrayLike) -> bool:
""""
Tests if coordinates are evenly spaced
Parameters:
Args:
arr: numpy array
"""
diff = arr[1] - arr[0]
......@@ -107,7 +107,7 @@ def save_results(outname: str,
""""
Saving the results of the regional tws uncerty tools to a NetCDF file
Parameters:
Args:
outname: str
inname: str
results: Dict[str, np.ndarray]
......@@ -168,3 +168,4 @@ def save_results(outname: str,
except PermissionError:
print("Could not open %s for writing results" %outname)
sys.exit()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment