diff options
Diffstat (limited to 'sph_harm_sandbox.py')
-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 |