Skip to content

Commit

Permalink
fixed bug in phi0 definition
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlouden committed Aug 20, 2016
1 parent a49199b commit 05169d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions c_src/web.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ double *lightcurve(int n_layers, int n_points, double *t, double tc, double per,
lambda0 = lambda0 + 2*M_PI;
}

phi0 = tan(coords[1]/coords[2]);

phi0 = atan2(coords[1],coords[2]);

map_model(planet,n_layers,lambda0,phi0,u1,u2,brightness_model,brightness_params);

Expand Down
2 changes: 1 addition & 1 deletion spiderman/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def calc_substellar(self,t,coords):
star_z = 0.0-coords[2]
self.calc_phase(t)
lambda0 = (np.pi + self.phase*2*np.pi)
phi0 = np.tan(star_y/star_z)
phi0 = np.arctan2(star_y,star_z)
if(lambda0 > 2*np.pi):
lambda0 = lambda0 - 2*np.pi;
if(lambda0 < -2*np.pi):
Expand Down
5 changes: 4 additions & 1 deletion spiderman/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
from mpl_toolkits.axes_grid1 import make_axes_locatable
import batman

def get_star_png():
return sp.__file__

def plot_planet(spider_params,t,ax=False,min_temp=False,max_temp=False,temp_map=False,min_bright=0):

if ax == False:
Expand Down Expand Up @@ -218,7 +221,7 @@ def make_movie():
phase = phase + np.ceil(phase) + 1

lambda0 = (np.pi + phase*2*np.pi)
phi0 = np.tan(star_y/star_z)
phi0 = np.arctan2(star_y,star_z)
if(lambda0 > 2*np.pi):
lambda0 = lambda0 - 2*np.pi;
if(lambda0 < -2*np.pi):
Expand Down

0 comments on commit 05169d1

Please sign in to comment.