Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions JUST_PythonPackage_EGhaderpour/ALLSSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ def ALLSSA(t, f, P = 1, Omega = [], ind = [], level = 0.01,

t0 = t - t[0] # For the sake of computational efficiency

tic = time.clock()
tic = time.time()
Results = ALLSSA(t0, f, P = P, Omega = Omega, ind = args.ind, level = args.level,
trend = args.trend, slope = args.slope, decimal = args.decimal)
toc = time.clock()
toc = time.time()
print("Computational Time: ", round(toc-tic,2), "s")
freq = Results[5]
print("The ALLSSA estimated cyclic frequencies:", freq)
Expand Down
8 changes: 4 additions & 4 deletions JUST_PythonPackage_EGhaderpour/JUSTdecompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,18 +384,18 @@ def PlotDecompose (t, f, P, trend, seasonal, remainder,
elif Dim[1] == Dim[0] + 2: P = tfP[:,2:]
else: P = 1

if args.Numtime > 0: tt = np.linspace(t[0], t[len(t)-1], args.Numtime)
if args.Numtime > 0: tt = np.linspace(t[0], t[len(t)-1], int(args.Numtime))
else: tt = []

if args.Ufreq > 0 and args.Numfreq > 0:
Omega = np.linspace(args.Lfreq, args.Ufreq, args.Numfreq)
else: Omega = []

tic = time.clock()
tic = time.time()
Results = JUSTdecompose(t, f, P = P, tt = tt, size = args.size, step = args.step,
season = args.season, Omega = Omega, ind = args.ind,
level = args.level)
toc = time.clock()
toc = time.time()
print("Computational Time: ", round(toc-tic,2), "s")

# Save the results as .csv
Expand All @@ -417,4 +417,4 @@ def PlotDecompose (t, f, P, trend, seasonal, remainder,





10 changes: 5 additions & 5 deletions JUST_PythonPackage_EGhaderpour/LSWA.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,22 +306,22 @@ def PlotSpectrogram (t, f, tt, Omega, spectrogram, stoch_surf, amp_spectrogram,
else: Ltim = args.Ltime
if args.Utime == 0: Utim = t[len(t)-1]
else: Utim = args.Utime
tt = np.linspace(Ltim, Utim, args.Numtime)
tt = np.linspace(Ltim, Utim,int(args.Numtime))
else: tt = []

if args.Ufreq > 0 and args.Numfreq > 0:
Omega = np.linspace(args.Lfreq, args.Ufreq, args.Numfreq)
Omega = np.linspace(args.Lfreq, args.Ufreq,int(args.Numfreq))
else: Omega = []

t0 = t - t[0] # For the sake of computational efficiency
if len(tt) > 0: tt0 = tt - t[0] # For the sake of computational efficiency
else: tt0 = []

tic = time.clock()
tic = time.time()
Results = LSWA(t0, f, P = P, tt = tt0, rate = args.rate, Omega = Omega, ind = args.ind,
level = args.level, trend = args.trend, slope = args.slope, freq = args.freq,
L1 = args.L1, L0 = args.L0, morlet = args.morlet)
toc = time.clock()
toc = time.time()
print("Computational Time: ", round(toc-tic,2), "s")
# Select larger window size parameters (e.g., L0 = 5) if you got the following error:
# 'The size of the time series (segment) is too small!'
Expand All @@ -345,4 +345,4 @@ def PlotSpectrogram (t, f, tt, Omega, spectrogram, stoch_surf, amp_spectrogram,
amp_spectrogram, args.display)