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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ git clone https://github.com/insarlab/PySolid.git
# option 1: use conda to install dependencies into an existing, activated environment
conda install -c conda-forge fortran-compiler --file PySolid/requirements.txt

# option 2: use conda to create a new environment named "pysolid"
conda env create -f PySolid/environment.yml
# option 2: use conda to install dependencies into a new environment, e.g. named "pysolid"
conda create --name pysolid fortran-compiler --file PySolid/requirements.txt
conda activate pysolid

# option 3: have a Fortran compiler already installed and use pip to install the rest dependencies
Expand Down
17 changes: 0 additions & 17 deletions environment.yml

This file was deleted.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ dependencies = [
"numpy",
"scipy",
"matplotlib",
"scikit-image",
]
dynamic = ["version"]

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
numpy
scipy
matplotlib
scikit-image
# for packaging and installation
#fortran-compiler # Fortran compiler across platforms through conda-forge channel
pip
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def readme():
"numpy",
"scipy",
"matplotlib",
"scikit-image",
],

# package discovery
Expand Down
13 changes: 8 additions & 5 deletions src/pysolid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import os

import numpy as np
from skimage.transform import resize
from scipy import ndimage


################################## Earth tides - grid mode ###################################
Expand Down Expand Up @@ -79,13 +79,16 @@ def calc_solid_earth_tides_grid(dt_obj, atr, step_size=1e3, display=False, verbo
lon0, lon_step, width)

# resample to the input size
# via scipy.ndimage.zoom or skimage.transform.resize
if num_step > 1:
in_shape = tide_e.shape
out_shape = (int(atr['LENGTH']), int(atr['WIDTH']))
vprint('PYSOLID: resize data to the shape of {} using order-1 spline interpolation'.format(out_shape))
kwargs = dict(order=1, mode='edge', anti_aliasing=True, preserve_range=True)
tide_e = resize(tide_e, out_shape, **kwargs)
tide_n = resize(tide_n, out_shape, **kwargs)
tide_u = resize(tide_u, out_shape, **kwargs)

enu = np.stack([tide_e, tide_n, tide_u])
zoom_factors = [1, *np.divide(out_shape, in_shape)]
kwargs = dict(order=1, mode="nearest", grid_mode=True)
tide_e, tide_n, tide_u = ndimage.zoom(enu, zoom_factors, **kwargs)

# plot
if display:
Expand Down