-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
40 lines (26 loc) · 1.28 KB
/
settings.py
File metadata and controls
40 lines (26 loc) · 1.28 KB
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
import numpy as np
from scipy.special import iv, kv
import scipy.interpolate as si
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
print("Importing settings from {}".format(dir_path))
def interpolators_for_bessel_functions():
#The Bessel Function part is sloooooow. Interpolate a look up table instead of calling iv and kv each time
#I've tested this against the true arrays of I0K0 and I1K1. The median difference is 10^(-10) and 10^(-12)
#respectively. Largest difference is 10^-9.
x=np.logspace(-4.0, 2.0, 1000000)
I0K0 = iv(0,x)*kv(0,x)
I1K1 = iv(1,x)*kv(1,x)
interpI0K0 = si.interp1d(x, I0K0, bounds_error=True, assume_sorted=True)
interpI1K1 = si.interp1d(x, I1K1, bounds_error=True, assume_sorted=True)
return interpI0K0, interpI1K1
interpI0K0, interpI1K1=interpolators_for_bessel_functions()
#Settings
oversample=5
seeing=0.5 #In arcseconds
#maximum shift of the centre of our map in pixels
#Making this too large slows down the velfield function. Taking 5 instead of 30 speeds it up by a factor of 4
max_centre_shift=5
#The fraction of the central peak at which we trim away the outskirts of the cube. Any values less than fraction_of_peak*peak_lightprofile_value are
#excluded from the kinematic fitting
fraction_of_peak=0.1