Skip to content

Commit 93f7154

Browse files
author
eigenbrot
committed
Ugh, crap from forever ago. Mostly just temp changes during testing
Get out of my staging area!
1 parent a1cf7b5 commit 93f7154

2 files changed

Lines changed: 20 additions & 22 deletions

File tree

‎custom_chisq.py‎

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,16 @@ def compute_rms_spec(mlist=['/d/monk/eigenbrot/WIYN/14B-0456/anal/DFK/models/DFK
210210
oldAvg = np.mean(bigD[:,2:,:],axis=1)
211211
youngAvg = np.mean(bigD[:,:2,:],axis=1)
212212
print bigD[0,:,:].shape, ageAvg[0].shape, (bigD[0,:,:] - ageAvg[0]).shape
213-
saverms = np.sqrt(np.mean((bigD[3,:,:] - ageAvg[3])**2,axis=0))
213+
# saverms = np.sqrt(np.mean((bigD[3,:,:] - ageAvg[3])**2,axis=0))
214214
for z in range(nmetal):
215-
# if z == 0:
216-
# rms = np.sqrt(np.mean((bigD[z,2:,:] - oldAvg[z])**2,axis=0))
217-
# elif z >=1 and z < 4:
218-
# rms = np.sqrt(np.mean((bigD[z,:,:] - ageAvg[z])**2,axis=0))
219-
# else:
220-
# rms = np.sqrt(np.mean((bigD[z,:2,:] - youngAvg[z])**2,axis=0))
221-
rms = np.sqrt(np.mean((bigD[z,:,:] - ageAvg[z])**2,axis=0))
222-
rms /= saverms
215+
if z == 0:
216+
rms = np.sqrt(np.mean((bigD[z,2:,:] - oldAvg[z])**2,axis=0))
217+
elif z >=1 and z < 4:
218+
rms = np.sqrt(np.mean((bigD[z,:,:] - ageAvg[z])**2,axis=0))
219+
else:
220+
rms = np.sqrt(np.mean((bigD[z,:2,:] - youngAvg[z])**2,axis=0))
221+
# rms = np.sqrt(np.mean((bigD[z,:,:] - ageAvg[z])**2,axis=0))
222+
# rms /= saverms
223223
rms = np.convolve(rms,np.ones(20)/20.,'same')
224224
ax.plot(wave, rms,label='{}$Z_{{\odot}}$'.format(Zlist[z]),color=clist[z])
225225
# ax.plot(wave, np.mean(bigD[z,:,:],axis=0),':')
@@ -231,7 +231,7 @@ def compute_rms_spec(mlist=['/d/monk/eigenbrot/WIYN/14B-0456/anal/DFK/models/DFK
231231
ax.set_xlim(3400,7000)
232232
ax.legend(loc=0)
233233
add_line_labels(ax)
234-
mfig.savefig('A_rms_IRAF_prior_norm.png',dpi=200)
234+
mfig.savefig('A_rms_IRAF_prior2.png',dpi=200)
235235

236236
#Age axis
237237
afig = plt.figure()
@@ -242,14 +242,14 @@ def compute_rms_spec(mlist=['/d/monk/eigenbrot/WIYN/14B-0456/anal/DFK/models/DFK
242242
ZAvg = np.mean(bigD,axis=0)
243243
highZAvg = np.mean(bigD[1:,:,:],axis=0)
244244
lowZAvg = np.mean(bigD[:4,:,:],axis=0)
245-
saverms = np.sqrt(np.mean((bigD[:,2,:] - ZAvg[2])**2,axis=0))
245+
# saverms = np.sqrt(np.mean((bigD[:,2,:] - ZAvg[2])**2,axis=0))
246246
for a in range(nage):
247-
# if a < 2:
248-
# rms = np.sqrt(np.mean((bigD[1:,a,:] - highZAvg[a])**2,axis=0))
249-
# else:
250-
# rms = np.sqrt(np.mean((bigD[:4,a,:] - lowZAvg[a])**2,axis=0))
251-
rms = np.sqrt(np.mean((bigD[:,a,:] - ZAvg[a])**2,axis=0))
252-
rms /= saverms
247+
if a < 2:
248+
rms = np.sqrt(np.mean((bigD[1:,a,:] - highZAvg[a])**2,axis=0))
249+
else:
250+
rms = np.sqrt(np.mean((bigD[:4,a,:] - lowZAvg[a])**2,axis=0))
251+
# rms = np.sqrt(np.mean((bigD[:,a,:] - ZAvg[a])**2,axis=0))
252+
# rms /= saverms
253253
rms = np.convolve(rms,np.ones(20)/20.,'same')
254254
ax.plot(wave, rms, label='{:7.4f} Gyr'.format(age[a]))
255255
rms_Z += rms**2
@@ -259,10 +259,8 @@ def compute_rms_spec(mlist=['/d/monk/eigenbrot/WIYN/14B-0456/anal/DFK/models/DFK
259259
ax.set_xlim(3500,7000)
260260
ax.legend(loc=0)
261261
add_line_labels(ax)
262-
afig.savefig('Z_rms_IRAF_prior_norm.png',dpi=200)
262+
afig.savefig('Z_rms_IRAF_prior2.png',dpi=200)
263263

264-
return
265-
266264
#All
267265
bigfig = plt.figure()
268266
ax = bigfig.add_subplot(111)
@@ -279,7 +277,7 @@ def compute_rms_spec(mlist=['/d/monk/eigenbrot/WIYN/14B-0456/anal/DFK/models/DFK
279277
ax.legend(loc=0)
280278
add_line_labels(ax)
281279
# bigfig.show()
282-
bigfig.savefig('big_RMS_IRAF_prior.png',dpi=200)
280+
bigfig.savefig('big_RMS_IRAF_prior2.png',dpi=200)
283281

284282
return wave, rms, rms_Z, rms_A
285283

‎emcee_CI.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def plot_ages(output,
934934
err = np.vstack((MLWA_L,MLWA_H))
935935

936936
if plot_LM:
937-
LM_dat = glob('NGC_891_P{}_*CI*dat'.format(pointing))[0]
937+
LM_dat = glob('NGC_891_P{}_fullCI*dat'.format(pointing))[0]
938938
print LM_dat
939939
LM, LM_L, LM_H = np.loadtxt(LM_dat, usecols=(1,2,3), unpack=True)
940940
LM_err = np.vstack((LM_L,LM_H))

0 commit comments

Comments
 (0)