Skip to content

Commit

Permalink
added plotting script
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlouden committed Aug 15, 2016
1 parent 625a106 commit e31c665
Show file tree
Hide file tree
Showing 6 changed files with 414 additions and 158 deletions.
8 changes: 4 additions & 4 deletions c_src/generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void map_model(double **planet,int n_layers,double lambda0, double phi0, double
planet[k][17] = 0.0;
}
if(brightness_model == 1){
double point_T = brightness_params[0];
double point_T = brightness_params[1];
planet[k][17] = point_T;
planet[k][16] = bb_flux(l1,l2,point_T,n_bb_seg);
}
Expand Down Expand Up @@ -112,9 +112,9 @@ void map_model(double **planet,int n_layers,double lambda0, double phi0, double
}

if(brightness_model == 4){
double xi =brightness_params[0];
double T_n =brightness_params[1];
double delta_T =brightness_params[2];
double xi =brightness_params[1];
double T_n =brightness_params[2];
double delta_T =brightness_params[3];
double point_T = zhang_2016(la,lo,xi,T_n,delta_T);
planet[k][17] = point_T;
planet[k][16] = bb_flux(l1,l2,point_T,n_bb_seg);
Expand Down
3 changes: 2 additions & 1 deletion spiderman/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from spiderman.params import *
from spiderman.web import *
from spiderman.plot import *

__all__ = ["web","params","_web"]
__all__ = ["web","params","_web","plot"]
23 changes: 23 additions & 0 deletions spiderman/params.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import numpy as np
class ModelParams(object):

def __init__(self,brightness_model='xi'):
Expand Down Expand Up @@ -62,3 +63,25 @@ def format_bright_params(self):
if (self.brightness_type == 4):
brightness_params = [self.T_s,self.xi,self.T_n,self.delta_T]
return brightness_params

def calc_phase(self,t):
phase = ((t-self.t0)/self.per)
if(phase > 1):
phase = phase - np.floor(phase)
if(phase < 0):
phase = phase + np.ceil(phase) + 1
self.phase = phase

def calc_substellar(self,t,coords):
star_x = 0.0-coords[0]
star_y = 0.0-coords[1]
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)
if(lambda0 > 2*np.pi):
lambda0 = lambda0 - 2*np.pi;
if(lambda0 < -2*np.pi):
lambda0 = lambda0 + 2*np.pi;
self.lambda0 = lambda0
self.phi0 = phi0

0 comments on commit e31c665

Please sign in to comment.