本文整理汇总了Python中JLA_library.fitLC方法的典型用法代码示例。如果您正苦于以下问题:Python JLA_library.fitLC方法的具体用法?Python JLA_library.fitLC怎么用?Python JLA_library.fitLC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JLA_library
的用法示例。
在下文中一共展示了JLA_library.fitLC方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runSALT
# 需要导入模块: import JLA_library [as 别名]
# 或者: from JLA_library import fitLC [as 别名]
def runSALT(SALTpath, SALTmodel, salt_prefix, inputFile, SN):
import os
# Set up the path to the SALT model and the name of the outputFile
os.environ['SALTPATH']=SALTpath+SALTmodel['directory']+'/snfit_data/'
outputFile=JLA.get_full_path(options.workArea)+'/'+SN+'/'+SN+'_'+SALTmodel['directory']+'.dat'
if os.path.isfile(outputFile):
pass
#print "Skipping, fit with SALT model %s for %s already done" % (SALTmodel['directory'],os.path.split(inputFile)[1])
else:
# Otherwise, do the fit with the date of Max set to the value in the lightcurve file
JLA.fitLC(inputFile, outputFile, salt_prefix, forceDayMax=True)
return outputFile
示例2: fitDateOfMax
# 需要导入模块: import JLA_library [as 别名]
# 或者: from JLA_library import fitLC [as 别名]
def fitDateOfMax(self,lightCurveFile,params):
# A full salt2 fit
outputFile=lightCurveFile.replace('.list','.res')
os.environ['SALTPATH']=JLA.get_full_path(params['defsaltModel'])
JLA.fitLC(lightCurveFile, outputFile, salt_prefix='')
self.dateofMax,self.dateofMaxError=JLA.getDateOfMax(outputFile)
# Remove the old date of max and insert the new one
lc=open(lightCurveFile)
lc_lines=lc.readlines()
lc.close()
lc=open(lightCurveFile,'w')
lc.write('@DayMax %s %s\n' % (self.dateofMax,self.dateofMaxError))
for line in lc_lines:
if 'DayMax' in line:
pass
else:
lc.write(line)
lc.close()
return