diff options
author | Nao Pross <np@0hm.ch> | 2022-04-17 23:55:32 +0200 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2022-04-17 23:55:32 +0200 |
commit | 85d45cb2a89143fee1f4ac0e188c574b963645c1 (patch) | |
tree | 4d0857b49e23e664e05a4c2395fa4afc96099cc7 /sph_harm_sandbox.py | |
download | FourierOnS2-85d45cb2a89143fee1f4ac0e188c574b963645c1.tar.gz FourierOnS2-85d45cb2a89143fee1f4ac0e188c574b963645c1.zip |
Add existing code
Diffstat (limited to '')
-rw-r--r-- | sph_harm_sandbox.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sph_harm_sandbox.py b/sph_harm_sandbox.py new file mode 100644 index 0000000..51828bc --- /dev/null +++ b/sph_harm_sandbox.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*-
+"""
+date of creation: Fri Mar 10 03:20:46 2022
+-------------------------------------------------
+@author : Manuel Cattaneo
+@contact: cattaneo.manuel@hotmail.com
+-------------------------------------------------
+
+Description:
+ Programma per capire come cazzo funziona sta SHExpandDHC(.) di merda.
+
+Modules:
+"""
+from scipy.special import sph_harm
+from pyshtools.expand import SHExpandDHC, SHExpandDH
+
+import numpy as np
+"""
+------------------------------------------------------------------------------
+"""
+
+_theta = np.linspace(0, np.pi , 1001)[1:] # theta in ]0, pi]
+_phi = np.linspace(0, 2*np.pi, 1001)[:-1] # phi in [0, 2pi[
+
+theta, phi = np.meshgrid(_theta, _phi)
+
+# n >! m
+m = 2
+n = 4
+y = sph_harm(m, n, theta=phi, phi=theta) # angles inverted due to convention
+
+cilm = np.abs(SHExpandDHC(y))
\ No newline at end of file |