Skip to content

Commit 7eb829e

Browse files
committed
Last commit before handover
1 parent ff5ba45 commit 7eb829e

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

make_eddy_track_AVISO.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ def pcol_2dxy(self, x, y):
799799
#date_str, date_end = 19980107, 19991110 #
800800
#date_str, date_end = 20081107, 20100110 #
801801
#date_str, date_end = 19921014, 20120718 #
802-
date_str, date_end = 20020101, 20020110 #
802+
#date_str, date_end = 20020101, 20020131 #
803803
date_str, date_end = 20020101, 20020630 #
804804

805805
# Choose type of diagnostic: either q-parameter ('Q') or sea level anomaly ('sla')
@@ -921,10 +921,10 @@ def pcol_2dxy(self, x, y):
921921
latmin = 30.
922922
latmax = 38.
923923

924-
#lonmin = .15 # big test
925-
#lonmax = 359.15
926-
#latmin = -70.
927-
#latmax = 70.
924+
lonmin = .15 # big test
925+
lonmax = 359.15
926+
latmin = -70.
927+
latmax = 70.
928928

929929

930930
elif the_domain in 'MedSea':

make_eddy_tracker_list_obj.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def haversine_distance_vector(lon1, lat1, lon2, lat2):
4848
lat1 = np.asfortranarray(lat1.copy())
4949
lon2 = np.asfortranarray(lon2.copy())
5050
lat2 = np.asfortranarray(lat2.copy())
51-
dist = np.asfortranarray(np.empty(lon1.shape))
51+
dist = np.asfortranarray(np.empty_like(lon1))
5252
hav.haversine_distvec(lon1, lat1, lon2, lat2, dist)
5353
return dist
5454

@@ -958,25 +958,25 @@ def write2netcdf(self, rtime):
958958
# Update old_lon and old_lat...
959959
#print '0000000000000000000000000000000000000000000000000000'
960960
#print 'self.new_lon[lasti:]',self.new_lon[lasti:]
961-
self.old_lon = list(self.new_lon[lasti:])
961+
self.old_lon = list(self.new_lon[lasti:])
962962
#print 'self.old_lon',self.old_lon
963963
#print '0000000000000000000000000000000000000000000000000000'
964-
self.old_lat = self.new_lat[lasti:]
964+
self.old_lat = self.new_lat[lasti:]
965965
self.old_radii_s = self.new_radii_s[lasti:]
966966
self.old_radii_e = self.new_radii_e[lasti:]
967-
self.old_amp = self.new_amp[lasti:]
968-
self.old_Uavg = self.new_Uavg[lasti:]
969-
self.old_teke = self.new_teke[lasti:]
967+
self.old_amp = self.new_amp[lasti:]
968+
self.old_Uavg = self.new_Uavg[lasti:]
969+
self.old_teke = self.new_teke[lasti:]
970970
#self.old_bounds = self.new_bounds[lasti:]
971971

972-
self.new_lon = [] #np.array([])
973-
self.new_lat = []
972+
self.new_lon = [] #np.array([])
973+
self.new_lat = []
974974
self.new_radii_s = []
975975
self.new_radii_e = []
976-
self.new_amp = []
977-
self.new_Uavg = []
978-
self.new_teke = []
979-
self.new_time = []
976+
self.new_amp = []
977+
self.new_Uavg = []
978+
self.new_teke = []
979+
self.new_time = []
980980
#self.new_bounds = np.atleast_2d(np.empty(4, dtype=np.int16))
981981

982982
if 'ROMS' in self.datatype:

py_eddy_tracker_classes.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,11 @@ def fit_circle(xvec, yvec):
401401
npts = xvec.size
402402
xmean = xvec.mean()
403403
ymean = yvec.mean()
404-
xsc = ne.evaluate('xvec - xmean')
405-
ysc = ne.evaluate('yvec - ymean')
404+
xsc = xvec - xmean
405+
ysc = yvec - ymean
406406

407-
scale = np.max((np.sqrt(xsc**2 + ysc**2).max(), np.finfo(float).eps))
407+
scale = np.array([np.sqrt(xsc**2 + ysc**2).max(),
408+
np.finfo(float).eps]).max()
408409
xsc /= scale
409410
ysc /= scale
410411

@@ -422,19 +423,18 @@ def fit_circle(xvec, yvec):
422423
ccx = p[0] # center X-position of fitted circle
423424
ccy = p[1] # center Y-position of fitted circle
424425
r = p[2] # radius of fitted circle
425-
carea = np.pi
426-
carea = ne.evaluate('carea * r**2') # area of fitted circle
426+
carea = r**2 * np.pi # area of fitted circle
427427

428428
# Shape test
429429
# Area and centroid of closed contour/polygon
430430
xvec1 = xvec[:npts-1]
431431
yvec1 = yvec[1:npts]
432432
xvec2 = xvec[1:npts]
433433
yvec2 = yvec[:npts-1]
434-
tmp = ne.evaluate('(xvec1 * yvec1) - (xvec2 * yvec2)')
434+
tmp = (xvec1 * yvec1) - (xvec2 * yvec2)
435435
polar = ne.evaluate('sum(tmp, axis=None)')
436-
polar = ne.evaluate('0.5 * polar')
437-
parea = ne.evaluate('abs(polar)')
436+
polar *= 0.5
437+
parea = np.abs(polar)
438438

439439
# Find distance between circle center and contour points_inside_poly
440440
dist_poly = np.sqrt((xvec - ccx)**2 + (yvec - ccy)**2)
@@ -1763,4 +1763,4 @@ def get_circle(x0, y0, r, npts):
17631763
cx = x0 + r * np.cos(theta)
17641764
cy = y0 + r * np.sin(theta)
17651765
return cx, cy
1766-
1766+

0 commit comments

Comments
 (0)