Skip to content

Commit

Permalink
fixed bug in direct method for small pixel number
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlouden committed Oct 12, 2017
1 parent 39dd419 commit 44533bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion c_src/generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ double *call_map_model(double la,double lo,double lambda0, double phi0,int brigh
// printf("%f %f %f\n",ars, star_bright,insol);
output = malloc(sizeof(double) * 2); // dynamic `array (size 2) of pointers to double`


output[0] = point_b;
output[1] = point_T;

Expand Down
8 changes: 4 additions & 4 deletions spiderman/read_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ def format_grid(longitude,latitude,temp):
T = np.vstack((T[-5],T[-4],T[-3],T[-2],T[-1],T,T[0],T[1],T[2],T[3],T[4]))
LO = np.hstack((LO[-5:]-360,LO,LO[0:5]+360))
else:
T = np.vstack((T[-1],T,T[0]))
LO = np.hstack((LO[-1:]-360,LO,LO[0:1]+360))
T = np.vstack((T[-2],T[-1],T,T[0],T[1]))
LO = np.hstack((LO[-2:]-360,LO,LO[0:2]+360))

if len(LA) > 100:
T = np.vstack((T[:,4],T[:,3],T[:,2],T[:,1],T[:,0],T.T,T[:,-1],T[:,-2],T[:,-3],T[:,-4],T[:,-5])).T
LA = np.hstack((-180 - LA[0:5][::-1],LA,180-LA[-5:][::-1]))
else:
T = np.vstack((T[:,0],T.T,T[:,-1])).T
LA = np.hstack((-180 - LA[0:1][::-1],LA,180-LA[-1:][::-1]))
T = np.vstack((T[:,1],T[:,0],T.T,T[:,-1],T[:,-2])).T
LA = np.hstack((-180 - LA[0:2][::-1],LA,180-LA[-2:][::-1]))

grid = np.array([LO,LA,T])

Expand Down

0 comments on commit 44533bf

Please sign in to comment.