
PySolid
The Python based solid Earth tides (PySolid) is a thin Python wrapper of the solid.for program (by Dennis Milbert based on dehanttideinelMJD.f from V. Dehant, S. Mathews, J. Gipson and C. Bruyninx) to calculate solid Earth tides in east, north and up directions (section 7.1.1 in the 2010 IERS Conventions). Solid Earth tides introduce large offsets in SAR observations and long spatial wavelength ramps in InSAR observations, as shown in the Sentinel-1 data with regular acquisitions and large swaths (Yunjun et al., 2022).
This is research code provided to you "as is" with NO WARRANTIES OF CORRECTNESS. Use at your own risk.
1. Install
PySolid is available on the conda-forge channel and the main archive of the Debian GNU/Linux OS. The released version can be installed via conda as:
# run "conda update pysolid" to update the installed version
conda install -c conda-forge pysolid
or via apt (or other package managers) for Debian-derivative OS users, including Ubuntu, as:
apt install python3-pysolid
Or build from source:
PySolid relies on a few Python modules as described in requirements.txt and NumPy's f2py to build the Fortran source code. You could use conda to install all the dependencies, including the Fortran compiler, or use your own installed Fortran compiler and pip to install the rest.
a. Download source code
git clone https://github.com/insarlab/PySolid.git
b. Install dependencies
conda install -c conda-forge fortran-compiler --file PySolid/requirements.txt --file PySolid/tests/requirements.txt
conda create --name pysolid fortran-compiler --file PySolid/requirements.txt --file PySolid/tests/requirements.txt
conda activate pysolid
python -m pip install -r PySolid/requirements.txt -r PySolid/tests/requirements.txt
c. Install PySolid
python -m pip install ./PySolid
python -m pip install -e ./PySolid
cd PySolid/src/pysolid
f2py -c -m solid solid.for
export PYTHONPATH=${PYTHONPATH}:<path-to-folder>/PySolid/src
d. Test the installation
To test the installation, run the following:
python -c "import pysolid; print(pysolid.__version__)"
python PySolid/tests/grid.py
python PySolid/tests/point.py
2. Usage
PySolid could compute solid Earth tides in two modes: point and grid. Both modes produce displacement in east, north and up directions.
- Point mode: compute 1D tides time-series at a specific point for a given time period
- Grid mode: compute 2D tides grid at a specific time for a given spatial grid
2.1 Point Mode [notebook]
import datetime as dt
import pysolid
lat, lon = 34.0, -118.0
step_sec = 60 * 5
dt0 = dt.datetime(2020, 1, 1, 4, 0, 0)
dt1 = dt.datetime(2021, 1, 1, 2, 0, 0)
dt_out, tide_e, tide_n, tide_u = pysolid.calc_solid_earth_tides_point(
lat, lon, dt0, dt1,
step_sec=step_sec,
display=False,
verbose=False,
)
pysolid.plot_power_spectral_density4tides(tide_u, sample_spacing=step_sec)
import datetime as dt
import numpy as np
import pysolid
dt_obj = dt.datetime(2020, 12, 25, 14, 7, 44)
meta = {
'LENGTH' : 500,
'WIDTH' : 450,
'X_FIRST': -126,
'Y_FIRST': 43,
'X_STEP' : 0.000925926 * 30,
'Y_STEP' : -0.000925926 * 30,
}
tide_e, tide_n, tide_u = pysolid.calc_solid_earth_tides_grid(
dt_obj, meta,
display=False,
verbose=True,
)
inc_angle = np.deg2rad(34)
az_angle = np.deg2rad(-102)
tide_los = ( tide_e * np.sin(inc_angle) * np.sin(az_angle) * -1
+ tide_n * np.sin(inc_angle) * np.cos(az_angle)
+ tide_u * np.cos(inc_angle))
3. Citing this work
- Yunjun, Z., Fattahi, H., Pi, X., Rosen, P., Simons, M., Agram, P., & Aoki, Y. (2022). Range Geolocation Accuracy of C-/L-band SAR and its Implications for Operational Stack Coregistration. IEEE Trans. Geosci. Remote Sens., 60, 5227219. [ doi | arxiv | data | notebook ]
- Milbert, D. (2018), "solid: Solid Earth Tide", [Online]. Available: http://geodesyworld.github.io/SOFTS/solid.htm. Accessd on: 2020-09-06.