Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/pysolid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import os

import numpy as np
from skimage.transform import resize


################################## Earth tides - grid mode ###################################
Expand All @@ -42,6 +41,7 @@ def calc_solid_earth_tides_grid(dt_obj, atr, step_size=1e3, display=False, verbo
Examples: atr = readfile.read_attribute('geo_velocity.h5')
tide_e, tide_n, tide_u = calc_solid_earth_tides_grid('20180219', atr)
"""
from skimage.transform import resize
try:
from pysolid.solid import solid_grid
except ImportError:
Expand Down
7 changes: 5 additions & 2 deletions src/pysolid/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import os

import numpy as np
from matplotlib import pyplot as plt, ticker, dates as mdates
from scipy import signal


## Tidal constituents
Expand Down Expand Up @@ -205,6 +203,8 @@ def calc_solid_earth_tides_point_per_day(lat, lon, date_str, step_sec=60):
def plot_solid_earth_tides_point(dt_out, tide_e, tide_n, tide_u, lalo=None,
out_fig=None, save=False, display=True):
"""Plot the solid Earth tides at one point."""
from matplotlib import pyplot as plt, dates as mdates

# plot
fig, axs = plt.subplots(nrows=3, ncols=1, figsize=[6, 4], sharex=True)
for ax, data, label in zip(axs.flatten(),
Expand Down Expand Up @@ -247,6 +247,9 @@ def plot_power_spectral_density4tides(tide_ts, sample_spacing, out_fig=None, fig
"""Plot the power spectral density (PSD) of tides time-series.
Note: for accurate PSD analysis, a long time-series, e.g. one year, is recommended.
"""
from matplotlib import pyplot as plt, ticker
from scipy import signal

## calc PSD
freq, psd = signal.periodogram(tide_ts, fs=1/sample_spacing, scaling='density')
# get rid of zero in the first element
Expand Down
1 change: 1 addition & 0 deletions src/pysolid/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# release history
Tag = collections.namedtuple('Tag', 'version date')
release_history = (
Tag('0.2.4', '2022-10-24'),
Tag('0.2.3', '2022-10-23'),
Tag('0.2.2', '2022-07-20'),
Tag('0.2.1', '2022-01-05'),
Expand Down