def makeColdHeatMap(inpath,outpath,inCube,startwl,coldwls):
cube = pyfits.open(inpath+inCube)
cube_all = cube[0].data[startwl:,0:,0:]
hdr_all = cube[0].header
cube = pyfits.open(inpath+inCube.replace('_i','_old_i'))
cube_old = cube[0].data[startwl:,0:,0:]
cube = pyfits.open(inpath+inCube.replace('_i','_young_i'))
cube_young = cube[0].data[startwl:,0:,0:]
Fold = 100. * (0.5*cube_old + 0.5*(cube_all-cube_young)) / cube_all
Fyoung = 100. * (0.5*cube_young + 0.5*(cube_all-cube_old)) / cube_all
tot_all = 100.* (coldwls[len(coldwls)-1] - coldwls[0])
# Get header with appropriate WCS info
im36 = pyfits.open("SKIRTinput/new3.6MJySr.fits")
hdr_wcs = im36[0].header
tot_old = integrateHeating(Fold,coldwls) / tot_all
hdu = pyfits.PrimaryHDU(tot_old,hdr_wcs)
hdu.writeto(outpath+"heatingTotColdOld.fits",clobber=True)
tot_young = integrateHeating(Fyoung,coldwls) / tot_all
hdu = pyfits.PrimaryHDU(tot_young,hdr_wcs)
hdu.writeto(outpath+"heatingTotColdYoung.fits",clobber=True)
评论列表
文章目录