OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
sort_gring Namespace Reference

Functions

def centroidnp (points)
 
def monotonic (x)
 

Variables

 parser
 
 action
 
 version
 
 type
 
 str
 
 metavar
 
 default
 
 None
 
 help
 
 args = parser.parse_args()
 
 gringpointlongitude = None
 
 gringpointlatitude = None
 
 lines = ifile.readlines()
 
 key
 
 value = args.lon
 
 values = np.array(value.split(',')).astype(float)
 
 points = list(zip(gringpointlongitude, gringpointlatitude))
 
def center = centroidnp(points)
 
 distance = np.atleast_1d(points) - np.atleast_1d(center)
 
 angles = np.arctan2(distance[:,0],distance[:,1])
 
 deg_angles = np.degrees(angles)
 
 idx = np.where(deg_angles < 0)
 
 gringsequence = np.argsort(deg_angles, axis=0)[::-1]
 
 sorted_lon = np.array2string(np.take_along_axis(np.degrees(gringpointlongitude), gringsequence, axis=0), precision=5, separator=',')
 
 sorted_lat = np.array2string(np.take_along_axis(np.degrees(gringpointlatitude), gringsequence, axis=0), precision=5, separator=',')
 

Function Documentation

◆ centroidnp()

def sort_gring.centroidnp (   points)

Definition at line 7 of file sort_gring.py.

◆ monotonic()

def sort_gring.monotonic (   x)

Definition at line 15 of file sort_gring.py.

Variable Documentation

◆ action

action

Definition at line 27 of file sort_gring.py.

◆ angles

angles = np.arctan2(distance[:,0],distance[:,1])

Definition at line 72 of file sort_gring.py.

◆ args

args = parser.parse_args()

Definition at line 33 of file sort_gring.py.

◆ center

def center = centroidnp(points)

Definition at line 68 of file sort_gring.py.

◆ default

default

Definition at line 28 of file sort_gring.py.

◆ deg_angles

deg_angles = np.degrees(angles)

Definition at line 74 of file sort_gring.py.

◆ distance

distance = np.atleast_1d(points) - np.atleast_1d(center)

Definition at line 70 of file sort_gring.py.

◆ gringpointlatitude

gringpointlatitude = None

Definition at line 36 of file sort_gring.py.

◆ gringpointlongitude

gringpointlongitude = None

Definition at line 35 of file sort_gring.py.

◆ gringsequence

gringsequence = np.argsort(deg_angles, axis=0)[::-1]

Definition at line 78 of file sort_gring.py.

◆ help

help

Definition at line 28 of file sort_gring.py.

◆ idx

idx = np.where(deg_angles < 0)

Definition at line 75 of file sort_gring.py.

◆ key

key

Definition at line 44 of file sort_gring.py.

◆ lines

lines = ifile.readlines()

Definition at line 40 of file sort_gring.py.

◆ metavar

metavar

Definition at line 28 of file sort_gring.py.

◆ None

None

Definition at line 28 of file sort_gring.py.

◆ parser

Initial value:
1 = argparse.ArgumentParser(prog='sort_gring',formatter_class=argparse.RawTextHelpFormatter,
2  description='This script sorts GRing points to ensure counter-clockwise order',epilog=)

Definition at line 21 of file sort_gring.py.

◆ points

Definition at line 66 of file sort_gring.py.

◆ sorted_lat

sorted_lat = np.array2string(np.take_along_axis(np.degrees(gringpointlatitude), gringsequence, axis=0), precision=5, separator=',')

Definition at line 86 of file sort_gring.py.

◆ sorted_lon

sorted_lon = np.array2string(np.take_along_axis(np.degrees(gringpointlongitude), gringsequence, axis=0), precision=5, separator=',')

Definition at line 85 of file sort_gring.py.

◆ str

str

Definition at line 28 of file sort_gring.py.

◆ type

type

Definition at line 28 of file sort_gring.py.

◆ value

value = args.lon

Definition at line 44 of file sort_gring.py.

◆ values

values = np.array(value.split(',')).astype(float)

Definition at line 45 of file sort_gring.py.

◆ version

version

Definition at line 27 of file sort_gring.py.