Unverified Commit 1063926f authored by Boris Bonev's avatar Boris Bonev Committed by GitHub
Browse files

changing defuault grid to equiangular in all SHT routines for consistency (#59)

parent 663bea1f
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
## Versioning ## Versioning
### v0.7.3
* Changing default grid in all SHT routines to `equiangular`
### v0.7.2 ### v0.7.2
* Added resampling modules for convenience * Added resampling modules for convenience
......
...@@ -53,7 +53,7 @@ class DistributedRealSHT(nn.Module): ...@@ -53,7 +53,7 @@ class DistributedRealSHT(nn.Module):
[2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math. [2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math.
""" """
def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="lobatto", norm="ortho", csphase=True): def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="equiangular", norm="ortho", csphase=True):
""" """
Distribtued SHT layer. Expects the last 3 dimensions of the input tensor to be channels, latitude, longitude. Distribtued SHT layer. Expects the last 3 dimensions of the input tensor to be channels, latitude, longitude.
...@@ -178,7 +178,7 @@ class DistributedInverseRealSHT(nn.Module): ...@@ -178,7 +178,7 @@ class DistributedInverseRealSHT(nn.Module):
[2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math. [2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math.
""" """
def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="lobatto", norm="ortho", csphase=True): def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="equiangular", norm="ortho", csphase=True):
super().__init__() super().__init__()
...@@ -288,7 +288,7 @@ class DistributedRealVectorSHT(nn.Module): ...@@ -288,7 +288,7 @@ class DistributedRealVectorSHT(nn.Module):
[2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math. [2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math.
""" """
def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="lobatto", norm="ortho", csphase=True): def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="equiangular", norm="ortho", csphase=True):
""" """
Initializes the vector SHT Layer, precomputing the necessary quadrature weights Initializes the vector SHT Layer, precomputing the necessary quadrature weights
...@@ -432,7 +432,7 @@ class DistributedInverseRealVectorSHT(nn.Module): ...@@ -432,7 +432,7 @@ class DistributedInverseRealVectorSHT(nn.Module):
[1] Schaeffer, N. Efficient spherical harmonic transforms aimed at pseudospectral numerical simulations, G3: Geochemistry, Geophysics, Geosystems. [1] Schaeffer, N. Efficient spherical harmonic transforms aimed at pseudospectral numerical simulations, G3: Geochemistry, Geophysics, Geosystems.
[2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math. [2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math.
""" """
def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="lobatto", norm="ortho", csphase=True): def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="equiangular", norm="ortho", csphase=True):
super().__init__() super().__init__()
......
...@@ -43,7 +43,7 @@ class SphereSolver(nn.Module): ...@@ -43,7 +43,7 @@ class SphereSolver(nn.Module):
- Allen-Cahn eq - Allen-Cahn eq
""" """
def __init__(self, nlat, nlon, dt, lmax=None, mmax=None, grid='legendre-gauss', radius=1.0, coeff=0.001): def __init__(self, nlat, nlon, dt, lmax=None, mmax=None, grid="equiangular", radius=1.0, coeff=0.001):
super().__init__() super().__init__()
# time stepping param # time stepping param
......
...@@ -43,7 +43,7 @@ class ShallowWaterSolver(nn.Module): ...@@ -43,7 +43,7 @@ class ShallowWaterSolver(nn.Module):
SWE solver class. Interface inspired bu pyspharm and SHTns SWE solver class. Interface inspired bu pyspharm and SHTns
""" """
def __init__(self, nlat, nlon, dt, lmax=None, mmax=None, grid='legendre-gauss', radius=6.37122E6, \ def __init__(self, nlat, nlon, dt, lmax=None, mmax=None, grid="equiangular", radius=6.37122E6, \
omega=7.292E-5, gravity=9.80616, havg=10.e3, hamp=120.): omega=7.292E-5, gravity=9.80616, havg=10.e3, hamp=120.):
super().__init__() super().__init__()
......
...@@ -48,7 +48,7 @@ class RealSHT(nn.Module): ...@@ -48,7 +48,7 @@ class RealSHT(nn.Module):
[2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math. [2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math.
""" """
def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="lobatto", norm="ortho", csphase=True): def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="equiangular", norm="ortho", csphase=True):
r""" r"""
Initializes the SHT Layer, precomputing the necessary quadrature weights Initializes the SHT Layer, precomputing the necessary quadrature weights
...@@ -141,7 +141,7 @@ class InverseRealSHT(nn.Module): ...@@ -141,7 +141,7 @@ class InverseRealSHT(nn.Module):
[2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math. [2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math.
""" """
def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="lobatto", norm="ortho", csphase=True): def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="equiangular", norm="ortho", csphase=True):
super().__init__() super().__init__()
...@@ -214,7 +214,7 @@ class RealVectorSHT(nn.Module): ...@@ -214,7 +214,7 @@ class RealVectorSHT(nn.Module):
[2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math. [2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math.
""" """
def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="lobatto", norm="ortho", csphase=True): def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="equiangular", norm="ortho", csphase=True):
r""" r"""
Initializes the vector SHT Layer, precomputing the necessary quadrature weights Initializes the vector SHT Layer, precomputing the necessary quadrature weights
...@@ -321,7 +321,7 @@ class InverseRealVectorSHT(nn.Module): ...@@ -321,7 +321,7 @@ class InverseRealVectorSHT(nn.Module):
[1] Schaeffer, N. Efficient spherical harmonic transforms aimed at pseudospectral numerical simulations, G3: Geochemistry, Geophysics, Geosystems. [1] Schaeffer, N. Efficient spherical harmonic transforms aimed at pseudospectral numerical simulations, G3: Geochemistry, Geophysics, Geosystems.
[2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math. [2] Wang, B., Wang, L., Xie, Z.; Accurate calculation of spherical and vector spherical harmonic expansions via spectral element grids; Adv Comput Math.
""" """
def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="lobatto", norm="ortho", csphase=True): def __init__(self, nlat, nlon, lmax=None, mmax=None, grid="equiangular", norm="ortho", csphase=True):
super().__init__() super().__init__()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment