Skip to content

Commit a329446

Browse files
authored
Update auxiliary functions
"_" at the beginning of auxiliary functions.
1 parent 317b7d2 commit a329446

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

OceanLab/eof.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def my_eof_interp(M,nmodes,errmin=1e-15,repmax=None):
130130
# PERFORM COMPLEX EOF
131131
#=========================================
132132
def ceof(lon, lat, data, nkp = 10):
133-
''' Complex (Hilbert) EOF
133+
''' Complex (Hilbert) EOF to detect propagating features: waves, meanders, etc.
134134
Note: the mean field in each coordinate is subtracted within the function.
135135
Do not subtract the time-mean field before inputing.
136136
NaN values are removed in the algorithm.
@@ -157,7 +157,7 @@ def ceof(lon, lat, data, nkp = 10):
157157
==============================================================================
158158
'''
159159
# Organizing the data as time vs space
160-
data_ceof = org_data_ceof(lon, lat, data)
160+
data_ceof = _org_data_ceof(lon, lat, data)
161161
# We need to remove the mean field (i.e., the trend) in each coordinate to
162162
# evaluate the variability
163163
data_ceof = data_ceof - data_ceof.mean('time')
@@ -193,7 +193,7 @@ def ceof(lon, lat, data, nkp = 10):
193193
per = per[:nkp].copy()
194194
pcs = np.dot(data_hilbert,loadings)
195195

196-
sp_amp, sp_phase, t_amp, t_phase = amplitude_phase(load, pcs)
196+
sp_amp, sp_phase, t_amp, t_phase = _amplitude_phase(load, pcs)
197197
sp_amp = sp_amp.reshape((len(lat),len(lon), nkp))
198198
sp_phase = sp_phase.reshape((len(lat),len(lon), nkp))
199199

@@ -208,14 +208,14 @@ def ceof(lon, lat, data, nkp = 10):
208208

209209
return ds
210210

211-
def org_data_ceof(lon, lat, data):
211+
def _org_data_ceof(lon, lat, data):
212212
dims = ["time", "lat", "lon"]
213213
datxarray = xr.Dataset({"data_latlon": (dims, data)},
214214
coords={'lat':(dims[1], lat), 'lon':(dims[2], lon)})
215215
data_ceof = datxarray.stack(lat_lon=("lat", "lon")).data_latlon
216216
return data_ceof
217217

218-
def amplitude_phase(evecs, amp):
218+
def _amplitude_phase(evecs, amp):
219219
''' Complex (Hilbert) EOF
220220
First written in MATLAB and found in the webpage below
221221
(https://www.jsg.utexas.edu/fu/files/GEO391-W11-CEOF.pdf)

0 commit comments

Comments
 (0)