Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- ym = np.linspace(-1.2, 1.2, 201)
- fhubble = 2.4*2.35
- fspy = 2.4*1.2
- xmax = 3.9
- fhubble_tot = 2.4*24
- fspy_tot = 2.4*8
- xhubble = -np.sqrt(fhubble**2 - ym**2) + fhubble
- xspy = -np.sqrt(fspy**2 - ym**2) + fspy
- xmax_h = xhubble.max()
- xmax_s = xspy.max()
- pts1_hubble = [[xmax, xmax_h, 1.00*fhubble], [ 1.2, 1.2, 0.00*1.2]]
- pts2_hubble = [pts1_hubble[0], [-y for y in pts1_hubble[1]]]
- pts3_hubble = [[xmax, xmax_h, 0.67*fhubble], [ 1.2, 1.2, 0.33*1.2]]
- pts4_hubble = [pts3_hubble[0], [-y for y in pts3_hubble[1]]]
- pts1_spy = [[xmax, xmax_s, 1.00*fspy], [ 1.2, 1.2, 0.00*1.2]]
- pts2_spy = [[xmax, xmax_s, 1.00*fspy], [-1.2, -1.2, -0.00*1.2]]
- pts3_spy = [[xmax, xmax_s, 0.86*fspy], [ 1.2, 1.2, 0.14*1.2]]
- pts4_spy = [[xmax, xmax_s, 0.86*fspy], [-1.2, -1.2, -0.14*1.2]]
- #
- pts5_hubble = [pts3_hubble[0] + [pts3_hubble[0][-1]-0.33*fhubble_tot],
- pts3_hubble[1] + [0]]
- pts6_hubble = [pts5_hubble[0], [-y for y in pts5_hubble[1]]]
- pts5_spy = [pts3_spy[0] + [pts3_spy[0][-1]-0.14*fspy_tot],
- pts3_spy[1] + [0]]
- pts6_spy = [pts5_spy[0], [-y for y in pts5_spy[1]] ]
- pts_hubble = [pts1_hubble, pts2_hubble, pts3_hubble, pts4_hubble,
- pts5_hubble, pts6_hubble]
- pts_spy = [pts1_spy, pts2_spy, pts3_spy, pts4_spy,
- pts5_spy, pts6_spy ]
- if True:
- plt.figure()
- plt.plot(xhubble, ym, '-b', linewidth=2)
- plt.plot(xspy, ym, '-r', linewidth=2)
- if True:
- for x, y in pts_hubble[:2] + pts_spy[:2]:
- plt.plot(x[1:], y[1:], '-k', linewidth=1.0)
- plt.plot(np.zeros_like(ym), ym, '-k', linewidth=2)
- if False:
- for x, y in pts_hubble[2:] + pts_spy[2:]:
- plt.plot(x, y, '-k', linewidth=1.0)
- plt.xlim(-0.5, 6.0)
- plt.show()
- if True:
- plt.figure()
- plt.plot(xhubble, ym, '-b', linewidth=2)
- plt.plot(xspy, ym, '-r', linewidth=2)
- if False:
- for x, y in pts_hubble[:2] + pts_spy[:2]:
- plt.plot(x, y, '-k', linewidth=0.5)
- if True:
- for x, y in pts_hubble[2:] + pts_spy[2:]:
- plt.plot(x, y, '-k', linewidth=1.0)
- plt.xlim(-0.5, 4.0)
- plt.show()
- if True:
- plt.figure()
- plt.plot(xhubble, ym, '-b', linewidth=2)
- plt.plot(xspy, ym, '-r', linewidth=2)
- if False:
- for x, y in pts_hubble[:2] + pts_spy[:2]:
- plt.plot(x, y, '-k', linewidth=0.5)
- if True:
- for x, y in pts_hubble[2:] + pts_spy[2:]:
- plt.plot(x, y, '-k', linewidth=1.0)
- plt.xlim(-16., 5.0)
- plt.ylim(-5.0, 5.0)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement