Skip to content

Commit 98b7735

Browse files
committed
fixed bug in transitplot5 to find plotting range.
1 parent aa12f55 commit 98b7735

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

transitfit5/mcmchist5bf.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ program mcmchist5
7070
call PGPAP ( 8.0 ,1.0) !paper size
7171
call pgsubp(5,5) !break up plot into grid
7272
73-
write(6,501) "Parameter ","Median ", "Stdev ",
73+
write(6,501) "Parameter ","Bestfit ", "Stdev ",
7474
. "+1 sig ", "-1 sig ", "+2 sig ", "-2 sig ",
7575
. "+3 sig ", "-3 sig "
7676
write(6,502) "----------------------------------------------------

transitfit5/transitfit5.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ def transitplot(time,flux,sol,nplanetplot=1, itime=-1, ntt=0, tobs=0, omc=0, dty
7979
sol2[nc+3]=0.0 #rdrs
8080
tmodel= zeros(len(time)) #contains the transit model
8181
tfit5.transitmodel(nplanet,sol2,time,itime,nttin,tobsin,omcin,tmodel,dtypein)
82+
stdev=np.std(flux-tmodel)
83+
#print(stdev)
8284

8385
#make a model with only the other transits to subtract
8486
nc=8+10*(nplanetplot-1)
@@ -131,14 +133,16 @@ def transitplot(time,flux,sol,nplanetplot=1, itime=-1, ntt=0, tobs=0, omc=0, dty
131133
plt.xlabel('Phase (hours)') #x-label
132134
plt.ylabel('Relative Flux') #y-label
133135
x1,x2,y1,y2 = plt.axis() #get range of plot
134-
ymin=min(fplot[i1:i2])
135-
ymax=max(fplot[i1:i2])
136-
y1=ymin-0.1*(ymax-ymin)
137-
y2=ymax+0.1*(ymax-ymin)
136+
ymin=min(fluxsort[i1:i2])
137+
ymax=max(fluxsort[i1:i2])
138+
y1=ymin-0.1*(ymax-ymin)-2.0*stdev
139+
y2=ymax+0.1*(ymax-ymin)+2.0*stdev
138140
plt.axis((-tdur,tdur,y1,y2)) #readjust range
139141
plt.show() #show the plot
140142

141143
return;
144+
145+
return;
142146

143147

144148
def transitmodel (sol,time, itime=-1, ntt=0, tobs=0, omc=0, dtype=0 ):

0 commit comments

Comments
 (0)