allow for movement of sun along theta
This commit is contained in:
parent
d25458f28a
commit
4151d2489f
1 changed files with 8 additions and 10 deletions
18
torus.py
18
torus.py
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue