Skip to content

Commit 19878e8

Browse files
committed
Smaller pkl files
1 parent d2c5420 commit 19878e8

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

make_eddy_track_AVISO.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
Scroll down to line ~640 to get started
3131
===============================================================================
3232
"""
33-
#from matplotlib import use as mpl_use
34-
#mpl_use('Agg')
33+
from matplotlib import use as mpl_use
34+
mpl_use('Agg')
3535
import sys
3636
import glob as glob
3737
from py_eddy_tracker_classes import plt, np, dt, Dataset, time, \
@@ -526,7 +526,7 @@ def __getstate__(self):
526526
#print '--- removing unwanted attributes'
527527
pops = ('Mx', 'My', '_f', '_angle', '_dx', '_dy', '_gof', '_lon',
528528
'_lat', '_pm', '_pn', '_umask', '_vmask', 'eke', 'u', 'v',
529-
'mask')
529+
'mask', 'pad', 'vpad', 'upad')
530530
result = self.__dict__.copy()
531531
for pop in pops:
532532
result.pop(pop)
@@ -1181,7 +1181,9 @@ def set_interp_coeffs(self, sla, uspd):
11811181

11821182
with open("".join((SAVE_DIR, 'C_eddy_%s.pkl' % ymd_str)), 'wb') as save_pickle:
11831183
pickle.dump(C_eddy, save_pickle, 2)
1184-
1184+
1185+
print 'EXIT here'
1186+
exit()
11851187
## Unpickle
11861188
#with open('C_eddy.pkl', 'rb') as load_pickle:
11871189
#C_eddy = pickle.load(load_pickle)

make_eddy_track_CLS.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,16 @@
4444
TRACK_DURATION_MIN = 28
4545

4646
#DATA_DIR = '/data/OCE_ETU/MSA/emason/Global_DT10/'
47-
DATA_DIR = '/Users/emason/mercurial_projects/py-eddy-tracker-cls/py-eddy-tracker-cls/outputs/'
47+
#DATA_DIR = '/Users/emason/mercurial_projects/py-eddy-tracker-cls/py-eddy-tracker-cls/outputs/'
48+
DATA_DIR = '/home/emason/Downloads/'
4849

49-
A_PKL_FILES = 'A_eddy_????????.pkl'
50-
#C_PKL_FILES = 'C_eddy_????????.pkl'
50+
#A_PKL_FILES = 'A_eddy_????????.pkl'
51+
C_PKL_FILES = 'C_eddy_????????.pkl'
5152

52-
PKL_FILES = glob.glob(DATA_DIR + A_PKL_FILES)
53-
PKL_FILES.sort()
54-
#C_PKL_FILES = glob.glob(DATA_DIR + C_PKL_FILES)
53+
#PKL_FILES = glob.glob(DATA_DIR + A_PKL_FILES)
54+
PKL_FILES = glob.glob(DATA_DIR + C_PKL_FILES)
5555

56+
PKL_FILES.sort()
5657
for active, PKL_FILE in enumerate(PKL_FILES):
5758

5859
print PKL_FILE
@@ -65,7 +66,6 @@
6566
eddy = pickle.load(the_pickle)
6667
print '--- loaded %s' % PKL_FILE
6768

68-
#print 'eddy.index', eddy.index
6969
eddy.savedir = DATA_DIR + eddy.savedir.rpartition('/')[-1]
7070

7171
eddy.TRACK_DURATION_MIN = TRACK_DURATION_MIN
@@ -107,8 +107,6 @@
107107

108108
if not first_record:
109109

110-
#print eddy.new_time_tmp[0]
111-
112110
eddy.write2netcdf(eddy.new_time_tmp[0])
113111
# tracklist is modified by write2netcdf, so
114112
# place update just after
@@ -117,11 +115,8 @@
117115
ch_index = np.copy(eddy.ch_index)
118116
index = np.copy(eddy.index)
119117

120-
#print '______________________eddy.index', eddy.index
121-
#print '______________________eddy.ncind', eddy.ncind
122118

123119
old_lon = eddy.old_lon
124-
#print '______________________eddy.old_lon', eddy.old_lon
125120
old_lat = eddy.old_lat
126121
old_amp = eddy.old_amp
127122
old_uavg = eddy.old_uavg

make_eddy_tracker_list_obj.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ def __getstate__(self):
354354
"""
355355
#print '--- removing unwanted attributes'
356356
pops = ('uspd', 'uspd_coeffs', 'sla_coeffs', 'points',
357-
'circlon', 'circlat', 'sla', 'slacopy')
357+
'circlon', 'circlat', 'sla', 'slacopy', 'swirl',
358+
'mask_eff', 'mask_eff_sum', 'mask_eff_1d')
358359
result = self.__dict__.copy()
359360
for pop in pops:
360361
result.pop(pop)

0 commit comments

Comments
 (0)