-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc_effective_frequency.py
120 lines (110 loc) · 3.99 KB
/
calc_effective_frequency.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Calculate the effective frequencies for a given spectral index
# MP, 17 October 2022
from fastcc import *
import numpy as np
def calc_freq_S(nu,cc,alpha):
return nu / cc**(1/alpha)
def calc_freq_T(nu,cc,alpha):
return nu / cc**(1/(alpha-2.0))
np.set_printoptions(precision=2)
spectra = np.asarray([-2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0])
print('Flux density units')
print(spectra)
print('Planck 2013')
cc = fastcc('P30',spectra,option=1)
print("P30: ", calc_freq_S(28.4,cc,spectra))
cc = fastcc('P44',spectra,option=1)
print("P44: ", calc_freq_S(44.1,cc,spectra))
cc = fastcc('P70',spectra,option=1)
print("P70: ", calc_freq_S(70.4,cc,spectra))
print('Planck 2018')
cc = fastcc('P30',spectra)
print("P30: ", calc_freq_S(28.4,cc,spectra))
cc = fastcc('P44',spectra)
print("P44: ", calc_freq_S(44.1,cc,spectra))
cc = fastcc('P70',spectra)
print("P70: ", calc_freq_S(70.4,cc,spectra))
cc = fastcc('P100',spectra,option=1)
print("P100: ", calc_freq_S(100.0,cc,spectra))
cc = fastcc('P143',spectra,option=1)
print("P143: ", calc_freq_S(143.0,cc,spectra))
cc = fastcc('P217',spectra,option=1)
print("P217: ", calc_freq_S(217.0,cc,spectra))
cc = fastcc('P353',spectra,option=1)
print("P353: ", calc_freq_S(353.0,cc,spectra))
cc = fastcc('P545',spectra,option=1)
print("P545: ", calc_freq_S(545.0,cc,spectra))
cc = fastcc('P857',spectra,option=1)
print("P857: ", calc_freq_S(857.0,cc,spectra))
print('WMAP (Bennet et al. 2012)')
cc = fastcc('WK',spectra,option=1)
print("WK: ", calc_freq_S(22.8,cc,spectra))
cc = fastcc('WKa',spectra,option=1)
print("WKa: ", calc_freq_S(33.0,cc,spectra))
cc = fastcc('WQ',spectra,option=1)
print("WQ: ", calc_freq_S(40.7,cc,spectra))
cc = fastcc('WV',spectra,option=1)
print("WV: ", calc_freq_S(60.7,cc,spectra))
cc = fastcc('WW',spectra,option=1)
print("WW: ", calc_freq_S(93.5,cc,spectra))
print('WMAP (with bandpass shift)')
cc = fastcc('WK',spectra)
print("WK: ", calc_freq_S(22.8,cc,spectra))
cc = fastcc('WKa',spectra)
print("WKa: ", calc_freq_S(33.0,cc,spectra))
cc = fastcc('WQ',spectra)
print("WQ: ", calc_freq_S(40.7,cc,spectra))
cc = fastcc('WV',spectra)
print("WV: ", calc_freq_S(60.7,cc,spectra))
cc = fastcc('WW',spectra)
print("WW: ", calc_freq_S(93.5,cc,spectra))
print('Temperature units')
print(spectra)
print('Planck 2013')
cc = fastcc('P30',spectra,option=1)
print("P30: ", calc_freq_T(28.4,cc,spectra))
cc = fastcc('P44',spectra,option=1)
print("P44: ", calc_freq_T(44.1,cc,spectra))
cc = fastcc('P70',spectra,option=1)
print("P70: ", calc_freq_T(70.4,cc,spectra))
print('Planck 2018')
cc = fastcc('P30',spectra)
print("P30: ", calc_freq_T(28.4,cc,spectra))
cc = fastcc('P44',spectra)
print("P44: ", calc_freq_T(44.1,cc,spectra))
cc = fastcc('P70',spectra)
print("P70: ", calc_freq_T(70.4,cc,spectra))
cc = fastcc('P100',spectra,option=1)
print("P100: ", calc_freq_T(100.0,cc,spectra))
cc = fastcc('P143',spectra,option=1)
print("P143: ", calc_freq_T(143.0,cc,spectra))
cc = fastcc('P217',spectra,option=1)
print("P217: ", calc_freq_T(217.0,cc,spectra))
cc = fastcc('P353',spectra,option=1)
print("P353: ", calc_freq_T(353.0,cc,spectra))
cc = fastcc('P545',spectra,option=1)
print("P545: ", calc_freq_T(545.0,cc,spectra))
cc = fastcc('P857',spectra,option=1)
print("P857: ", calc_freq_T(857.0,cc,spectra))
print('WMAP (Bennet et al. 2012)')
cc = fastcc('WK',spectra,option=1)
print("WK: ", calc_freq_T(22.8,cc,spectra))
cc = fastcc('WKa',spectra,option=1)
print("WKa: ", calc_freq_T(33.0,cc,spectra))
cc = fastcc('WQ',spectra,option=1)
print("WQ: ", calc_freq_T(40.7,cc,spectra))
cc = fastcc('WV',spectra,option=1)
print("WV: ", calc_freq_T(60.7,cc,spectra))
cc = fastcc('WW',spectra,option=1)
print("WW: ", calc_freq_T(93.5,cc,spectra))
print('WMAP (with bandpass shift)')
cc = fastcc('WK',spectra)
print("WK: ", calc_freq_T(22.8,cc,spectra))
cc = fastcc('WKa',spectra)
print("WKa: ", calc_freq_T(33.0,cc,spectra))
cc = fastcc('WQ',spectra)
print("WQ: ", calc_freq_T(40.7,cc,spectra))
cc = fastcc('WV',spectra)
print("WV: ", calc_freq_T(60.7,cc,spectra))
cc = fastcc('WW',spectra)
print("WW: ", calc_freq_T(93.5,cc,spectra))