def setup(temperature, fluxScaling = 4.4e-22, L40 = 1, distance = 100.0) : t1000 = temperature/1000. d100 = distance/100. fluxScaling =fluxScaling * L40 / d100**2 / t1000**4 text = "/home/s1/annis/daedalean/synmag/sysresp/DES-{}.txt" decam,mag=dict(),dict() for f in ["g","r","i","z","y"] : decam[f] = synMagnitude.synMag(text.format(f)); decam[f].set_ccd(36) decam[f].set_blackbody_sed(temperature, fluxScaling=fluxScaling) mag[f] = decam[f].magnitude() return decam, mag
def computeSynMagFile (outfile="../sysresp/symMags-sdss.txt") : """ """ import os synMagFile = outfile sm=dict() sm[0]=synMagnitude.synMag("../sysresp/SDSS-u.txt") sm[1]=synMagnitude.synMag("../sysresp/SDSS-g.txt") sm[2]=synMagnitude.synMag("../sysresp/SDSS-r.txt") sm[3]=synMagnitude.synMag("../sysresp/SDSS-i.txt") sm[4]=synMagnitude.synMag("../sysresp/SDSS-z.txt") de = DECam.DECam() picklesList = de.listOfPickles() picklesDict = de.picklesDict() filterList = [0,1,2,3,4] print "opening ", synMagFile fd = open(synMagFile,"w") fd.write("# synthetic magnitudes of the pickles library\n") fd.write("# pickles-id, ") fd.write("ccd-{},".format(1)) fd.write("filter\n") for star in picklesList : print star, starnum = picklesDict[star] for filter in filterList : sm[filter].set_sed("../Stars/PICKLES/" + star,"f_lambda", 10.) fd.write("{:3d} ".format(int(starnum))) mag = sm[filter].magnitude() print mag, " ", fd.write("{:7.3f} ".format(mag)) fd.write("{:2d} \n".format(filter)) print "" print "closing ", synMagFile fd.close()
def loadSysResp (self) : """This loads 62 system response files into the object. The system response files are assumed to live in sysReponseFileDir and to have name in the format "DES-{}.txt".format(filter), with one wavelength col and 62 ccd cols """ import synMagnitude filterList = self.filterList decam = {} for filter in filterList : sys = self.sysResponseFileDir + "DES-{}.txt".format(filter) decam[filter] = synMagnitude.synMag(sys) return decam