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