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
43e3e720
Commit
43e3e720
authored
Jul 17, 2025
by
Andrea Paris
Committed by
Boris Bonev
Jul 21, 2025
Browse files
updated docstring
parent
c44d4b23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
35 deletions
+15
-35
torch_harmonics/distributed/distributed_convolution.py
torch_harmonics/distributed/distributed_convolution.py
+15
-35
No files found.
torch_harmonics/distributed/distributed_convolution.py
View file @
43e3e720
...
...
@@ -75,49 +75,29 @@ def _split_distributed_convolution_tensor_s2(
out_shape
:
Tuple
[
int
],
):
"""
Precomputes the rotated filters at positions $R^{-1}_j \omega_i = R^{-1}_j R_i
\n
u = Y(-
\t
heta_j)Z(\phi_i - \phi_j)Y(
\t
heta_j)
\n
u$.
Assumes a tensorized grid on the sphere with an equidistant sampling in longitude as described in Ocampo et al.
The output tensor has shape kernel_shape x nlat_out x (nlat_in * nlon_in).
The rotation of the Euler angles uses the YZY convention, which applied to the northpole $(0,0,1)^T$ yields
$$
Y(
\a
lpha) Z(
\b
eta) Y(\gamma) n =
{
\b
egin{bmatrix}
\cos(\gamma)\sin(
\a
lpha) + \cos(
\a
lpha)\cos(
\b
eta)\sin(\gamma)
\\
\sin(
\b
eta)\sin(\gamma)
\\
\cos(
\a
lpha)\cos(\gamma)-\cos(
\b
eta)\sin(
\a
lpha)\sin(\gamma)
\end{bmatrix}}
$$
Splits a pre-computed convolution tensor along the latitude dimension for distributed processing.
This function takes a convolution tensor that was generated by the serial routine and filters
it to only include entries corresponding to the local latitude slice assigned to this process.
The filtering is done based on the polar group rank and the computed split shapes.
Parameters
----------
idx: torch.Tensor
Indices of the pre-computed convolution tensor
vals: torch.Tensor
Values of the pre-computed convolution tensor
in_shape: Tuple[int]
Shape of the input tensor
Shape of the input tensor
(nlat_in, nlon_in)
out_shape: Tuple[int]
Shape of the output tensor
filter_basis: FilterBasis
Filter basis to use
grid_in: str
Grid type for the input tensor
grid_out: str
Grid type for the output tensor
theta_cutoff: float
Theta cutoff for the filter basis
theta_eps: float
Epsilon for the theta cutoff
transpose_normalization: bool
Whether to transpose the normalization
basis_norm_mode: str
Normalization mode for the filter basis
merge_quadrature: bool
Whether to merge the quadrature weights
Shape of the output tensor (nlat_out, nlon_out)
Returns
-------
out_
idx: torch.Tensor
Indices of the output tensor
out_
vals: torch.Tensor
Values of the output tensor
idx: torch.Tensor
Filtered indices corresponding to the local latitude slice
vals: torch.Tensor
Filtered values corresponding to the local latitude slice
"""
assert
len
(
in_shape
)
==
2
...
...
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