forked from leylaunsal/timedelaycolormaps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdouble_lens
44 lines (34 loc) · 1.33 KB
/
double_lens
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
import numpy as np
import matplotlib.pyplot as plt
alpha = 0
theta = 0
b = 1.5
p1 = 3
p2 = 3
m1 = 1
m2 = 2
# Define the equation
def equation(x, y):
return 0.5 * (((x - b) ** 2 + y ** 2)) - m1*np.log(np.sqrt(x**2 + y**2)) - m2*np.log(np.sqrt((x - p1)**2 + (y - p2)**2)) #- np.log(theta))
# Generate sample data
x = np.linspace(-5, 5, num=100)
y = np.linspace(-5, 5, num=100)
X, Y = np.meshgrid(x, y)
Z = equation(X, Y)
#font
plt.rcParams.update({'font.size': 15})
# Plot color map
plt.figure(figsize=(8, 6))
plt.pcolormesh(X, Y, Z, cmap='rainbow')
plt.colorbar(label='Color Intensity')
plt.title('Color Map of Time Delay From Double Point Lens of Fixed Distance')
plt.xlabel('x1')
plt.ylabel('x2')
plt.plot(p1, p2, marker="o", markersize=10, markerfacecolor="red")
plt.plot(0, 0, marker="o", markersize=10, markerfacecolor="red")
#description = 'y = 1.5'
#plt.text(0, -7, description, fontsize=12, ha='center')
plt.show()
#could either fix the points of multiple lenses, or randomly generate the coordinates for 10 point lenses, and put the masses in a certain range, but it's more probable for it to be smaller within the range
#mass distribution is non trivial--> ex out of 10 lenses, 2 massive ones, 8 smaller ones
#could also add a few (3) contour lines: show contour of a constant time delay: would help differentiate from single to double