allow for movement of sun along theta

This commit is contained in:
Daniel Mevec 2023-02-11 22:38:51 +01:00
parent d25458f28a
commit 4151d2489f

View file

@ -226,14 +226,13 @@ class NoInamge():
def _sunpath_top(self, n=1000):
phi = np.linspace(0, np.pi, n)
x = self.torus.r_maj + self.torus.r_maj*np.cos(phi)
y = np.zeros_like(phi)
_, theta = self.torus.sun_r
x = (self.torus.r_maj + self.torus.r_maj*np.cos(phi)) * np.cos(theta)
y = (self.torus.r_maj + self.torus.r_maj*np.cos(phi)) * np.sin(theta)
return np.array([x, y])
def _sunpos_top(self):
phi, theta = self.torus.sun_r
x = self.torus.r_maj - self.torus.r_maj*np.cos(phi)
y = 0
x, y, _ = self.torus.sun
return x, y
def _crossection(self, n=1000):
@ -249,15 +248,14 @@ class NoInamge():
def _sunpath_side(self, n=1000):
phi = np.linspace(0, 2*np.pi, n)
x = self.torus.r_maj + self.torus.r_maj*np.cos(phi)
_, theta = self.torus.sun_r
x = (self.torus.r_maj + self.torus.r_maj*np.cos(phi)) * np.cos(theta)
y = self.torus.r_maj*np.sin(phi)
return np.array([x, y+self._offset_side()])
def _sunpos_side(self):
phi, theta = self.torus.sun_r
x = self.torus.r_maj - self.torus.r_maj*np.cos(phi)
y = self.torus.r_maj*np.sin(phi)
return x, y+self._offset_side()
x, _, z = self.torus.sun
return x, z+self._offset_side()
def redraw_plot(self, line, func):
x, y = func()