Skip to content

Commit

Permalink
fixed bug in two sides model
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlouden committed Jan 30, 2017
1 parent b1d6406 commit 90788bf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
31 changes: 16 additions & 15 deletions c_src/generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void map_model(double **planet,int n_layers,double lambda0, double phi0, double
l2 = brightness_params[2];
}

if(brightness_model == 7 || brightness_model == 8) {
if(brightness_model == 2 || brightness_model == 3 || brightness_model == 7 || brightness_model == 8) {
make_grid = brightness_params[3];
}

Expand Down Expand Up @@ -92,18 +92,18 @@ double *call_map_model(double la,double lo,double lambda0, double phi0,int brigh
point_T = Uniform_T(brightness_params[3]);
point_b = bb_interp(point_T, bb_g);
}
if(brightness_model == 2){
double p_day = brightness_params[0];
double p_night = brightness_params[1];
point_b = Two_b(la,lo,p_day,p_night);
}
if(brightness_model == 3){
double p_day = brightness_params[3];
double p_night = brightness_params[4];
double point_T = p_night;
point_T = Two_T(la,lo,p_day,p_night);
point_b = bb_interp(point_T, bb_g);
}
// if(brightness_model == 2){
// double p_day = brightness_params[0];
// double p_night = brightness_params[1];
// point_b = Two_b(la,lo,p_day,p_night);
// }
// if(brightness_model == 3){
// double p_day = brightness_params[3];
// double p_night = brightness_params[4];
// double point_T = p_night;
// point_T = Two_T(la,lo,p_day,p_night);
// point_b = bb_interp(point_T, bb_g);
// }

if(brightness_model == 4){
double xi =brightness_params[3];
Expand All @@ -122,15 +122,16 @@ double *call_map_model(double la,double lo,double lambda0, double phi0,int brigh
point_T = kreidberg_2016(la, lo, insol, albedo, redist);
point_b = bb_interp(point_T, bb_g);
}
if(brightness_model == 7){
if(brightness_model == 2 || brightness_model == 7){
double la0 = brightness_params[0];
double lo0 = brightness_params[1];
double p_b = brightness_params[2];
double spot_b = brightness_params[4];
double size = brightness_params[5];
// printf("%f %f %f %f %f\n",la0,lo0,p_b,spot_b,size);
point_b = Hotspot_b(la, lo, la0,lo0,p_b,spot_b,size,make_grid ,theta1,theta2,r1,r2,lambda0,phi0);
}
if(brightness_model == 8){
if(brightness_model == 3 || brightness_model == 8){
double la0 = brightness_params[4];
double lo0 = brightness_params[5];
double p_T = brightness_params[6];
Expand Down
16 changes: 10 additions & 6 deletions spiderman/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def __init__(self,brightness_model='xi'):
self.pb_n= None # Relative planet brightness (Star is 1)

self.thermal= False # Is this a thermal distribution?
self.grid_size = 10
if not (hasattr(self,'grid_size')):
self.grid_size = 10


elif brightness_model == 'two temperature':
Expand All @@ -52,7 +53,8 @@ def __init__(self,brightness_model='xi'):
self.pb_n= None # Relative planet brightness (Star is 1)
self.T_s= None # **STELLAR** effective temperature
self.thermal= True # Is this a thermal distribution?
self.grid_size = 10
if not (hasattr(self,'grid_size')):
self.grid_size = 10

elif brightness_model == 'zhang':
self.brightness_type= 4 # Integer model identifier
Expand All @@ -77,14 +79,16 @@ def __init__(self,brightness_model='xi'):
elif brightness_model == 'hotspot_b':
self.brightness_type= 7 # Integer model identifer
self.thermal= False # Is this a thermal distribution?
self.grid_size = 10
if not (hasattr(self,'grid_size')):
self.grid_size = 10


elif brightness_model == 'hotspot_t':
self.brightness_type= 8 # Integer model identifer
self.T_s = None
self.thermal= True # Is this a thermal distribution?
self.grid_size = 10
if not (hasattr(self,'grid_size')):
self.grid_size = 10

elif brightness_model == 'lambertian':
self.brightness_type= 9 # Integer model identifer
Expand Down Expand Up @@ -120,7 +124,7 @@ def format_bright_params(self):
# try:
# brightness_params = [self.pb_d,self.pb_n]

self.brightness_type = 7
# self.brightness_type = 7
try:
brightness_params = [0, 0, self.pb_n, self.grid_size,self.pb_d, 90]
except:
Expand All @@ -131,7 +135,7 @@ def format_bright_params(self):
brightness_param_names = ['T_s','l1','l2','T_p_d','T_p_n']
# try:
# brightness_params = [self.T_s,self.l1,self.l2,self.T_p_d,self.T_p_n]
self.brightness_type = 8
# self.brightness_type = 8
try:
brightness_params = [self.T_s,self.l1, self.l2, self.grid_size, 0, 0, self.T_p_n, self.T_p_d, 90]
except:
Expand Down

0 comments on commit 90788bf

Please sign in to comment.