forked from seanandrews/D3SB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd3sbModel.py
More file actions
29 lines (21 loc) · 740 Bytes
/
Copy pathd3sbModel.py
File metadata and controls
29 lines (21 loc) · 740 Bytes
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
import numpy as np
import scipy.special as sc
def d3sbModel(theta, uvsamples, bins):
incl = 0.
w = theta
#incl = np.deg2rad(theta[0]) #Projected Inclination
#w = theta[1:] #Ring bin amplitudes
u, v = uvsamples
udeproj = u * np.cos(incl) #Deproject
#vdeproj = v * np.cos(incl) #Deproject
rho = 1e3*np.sqrt(udeproj**2+v**2)
#rho = 1e3*np.sqrt(vdeproj**2+u**2)
rin, b = bins
rbin = np.concatenate([np.array([rin]), b])
wbin = np.append(np.concatenate([np.array([0.0]), w]), 0.)
ww = wbin-np.roll(wbin, -1)
wgt = np.delete(ww, b.size+1)
jarg = np.outer(2.*np.pi*rbin, rho/206264.806427)
jinc = sc.j1(jarg)/jarg
vis = np.dot(2.*np.pi*rbin**2*wgt, jinc)
return vis