本文整理汇总了Python中lsst.sims.photUtils.Sed.writeSED方法的典型用法代码示例。如果您正苦于以下问题:Python Sed.writeSED方法的具体用法?Python Sed.writeSED怎么用?Python Sed.writeSED使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lsst.sims.photUtils.Sed
的用法示例。
在下文中一共展示了Sed.writeSED方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mCalcs
# 需要导入模块: from lsst.sims.photUtils import Sed [as 别名]
# 或者: from lsst.sims.photUtils.Sed import writeSED [as 别名]
def mCalcs(airmass, bandName, ra, dec, expMJD, FWHMeff, hwbpdict, photparams=None, sm=None):
"""
sm :
"""
if photparams is None:
photparams = PhotometricParameters()
if sm is None:
sm = SkyModel(observatory='LSST', mags=False, preciseAltAz=True)
# Obtain full sky transmission at airmass
# Note that this method is not interpolating but choosing the atmospheric transmission from
# Modtran simulations of the closest airmass in a sequence of np.arange(1., 2.51, 0.1)
fname = atmTransName(airmass)
print(fname)
atmTrans = np.loadtxt(fname)
wave, trans = hwbpdict[bandName].multiplyThroughputs(atmTrans[:, 0], atmTrans[:, 1])
bp = Bandpass(wavelen=wave, sb=trans)
# Set the observing condition
sm.setRaDecMjd(lon=[ra], lat=[dec], filterNames=[bandName],
mjd=expMJD, degrees=False, azAlt=False)
# Get the sky sed
wave, spec = sm.returnWaveSpec()
sed = Sed(wavelen=wave, flambda=spec[0])
sed.writeSED('skySED_laptop.csv')
m5 = calcM5(sed, bp, hwbpdict[bandName], photparams, FWHMeff)
# Get the sky magnitude only in the band concerned
m = sm.returnMags(bandpasses=hwbpdict)[bandName][0]
return m5, m
示例2:
# 需要导入模块: from lsst.sims.photUtils import Sed [as 别名]
# 或者: from lsst.sims.photUtils.Sed import writeSED [as 别名]
skyheader += versioninfo
perfilterheader = {}
for f in filters:
good = np.where(filters[f].sb > 0)[0]
wavelen_blue = filters[f].wavelen[good[0]-1]
wavelen_red = filters[f].wavelen[good[-1]+1]
perfilterheader[f] = '# Wavelen_cutoff_BLUE %.2f\n' % (wavelen_blue)
perfilterheader[f] += '# Wavelen_cutoff_RED %.2f\n' % (wavelen_red)
detector.writeThroughput(os.path.join(outDir, 'detector.dat'), print_header=header)
lens1.writeThroughput(os.path.join(outDir, 'lens1.dat'), print_header=header)
lens2.writeThroughput(os.path.join(outDir, 'lens2.dat'), print_header=header)
lens3.writeThroughput(os.path.join(outDir, 'lens3.dat'), print_header=header)
m1.writeThroughput(os.path.join(outDir, 'm1.dat'), print_header=header)
m2.writeThroughput(os.path.join(outDir, 'm2.dat'), print_header=header)
m3.writeThroughput(os.path.join(outDir, 'm3.dat'), print_header=header)
atmos_std.writeThroughput(os.path.join(outDir, 'atmos_std.dat'), print_header=atmosheader)
atmos_10.writeThroughput(os.path.join(outDir, 'atmos_10.dat'), print_header=atmosheader)
darksky.writeSED(os.path.join(outDir, 'darksky.dat'), print_header=skyheader)
for f in filters:
filters[f].writeThroughput(os.path.join(outDir, 'filter_%s.dat' %(f)), print_header=header+perfilterheader[f])
hardware[f].writeThroughput(os.path.join(outDir, 'hardware_%s.dat' %(f)), print_header=header+perfilterheader[f])
system[f].writeThroughput(os.path.join(outDir, 'total_%s.dat' %(f)), print_header=systemheader+perfilterheader[f])