Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-harmonics
Commits
5a6d52dd
Commit
5a6d52dd
authored
Jul 21, 2025
by
Thorsten Kurth
Browse files
and one more
parent
30f7802b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torch_harmonics/resample.py
torch_harmonics/resample.py
+2
-2
No files found.
torch_harmonics/resample.py
View file @
5a6d52dd
...
@@ -75,9 +75,9 @@ class ResampleS2(nn.Module):
...
@@ -75,9 +75,9 @@ class ResampleS2(nn.Module):
# we need to expand the solution to the poles before interpolating
# we need to expand the solution to the poles before interpolating
self
.
expand_poles
=
(
self
.
lats_out
>
self
.
lats_in
[
-
1
]).
any
()
or
(
self
.
lats_out
<
self
.
lats_in
[
0
]).
any
()
self
.
expand_poles
=
(
self
.
lats_out
>
self
.
lats_in
[
-
1
]).
any
()
or
(
self
.
lats_out
<
self
.
lats_in
[
0
]).
any
()
if
self
.
expand_poles
:
if
self
.
expand_poles
:
self
.
lats_in
=
torch
.
cat
([
torch
.
as_tensor
([
0.
],
dtype
=
torch
.
float64
),
self
.
lats_in
=
torch
.
cat
([
torch
.
as_tensor
([
0.
],
dtype
=
torch
.
float64
,
device
=
self
.
lats_in
.
device
),
self
.
lats_in
,
self
.
lats_in
,
torch
.
as_tensor
([
math
.
pi
],
dtype
=
torch
.
float64
)]).
contiguous
()
torch
.
as_tensor
([
math
.
pi
],
dtype
=
torch
.
float64
,
device
=
self
.
lats_in
.
device
)]).
contiguous
()
# prepare the interpolation by computing indices to the left and right of each output latitude
# prepare the interpolation by computing indices to the left and right of each output latitude
lat_idx
=
torch
.
searchsorted
(
self
.
lats_in
,
self
.
lats_out
,
side
=
"right"
)
-
1
lat_idx
=
torch
.
searchsorted
(
self
.
lats_in
,
self
.
lats_out
,
side
=
"right"
)
-
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment