From 85d45cb2a89143fee1f4ac0e188c574b963645c1 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sun, 17 Apr 2022 23:55:32 +0200 Subject: Add existing code --- sph_harm_sandbox.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sph_harm_sandbox.py (limited to 'sph_harm_sandbox.py') 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 -- cgit v1.2.1