summaryrefslogtreecommitdiffstats
path: root/sph_harm_sandbox.py
blob: 51828bc14bfd507fb79bacfeb6e4748ca18f43cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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))