本文整理汇总了Python中JLA_library.insertDateOfMax方法的典型用法代码示例。如果您正苦于以下问题:Python JLA_library.insertDateOfMax方法的具体用法?Python JLA_library.insertDateOfMax怎么用?Python JLA_library.insertDateOfMax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JLA_library
的用法示例。
在下文中一共展示了JLA_library.insertDateOfMax方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: compute_date_of_max
# 需要导入模块: import JLA_library [as 别名]
# 或者: from JLA_library import insertDateOfMax [as 别名]
def compute_date_of_max(options):
import numpy
from astropy.table import Table
import JLA_library as JLA
params=JLA.build_dictionary(options.config)
# ----------- Read in the configuration file ------------
lightCurveFits=JLA.get_full_path(params['lightCurveFits'])
lightCurves=JLA.get_full_path(params['lightCurves'])
adjlightCurves=JLA.get_full_path(params['adjLightCurves'])
# --------- Read in the list of SNe ---------------------
SNe = Table.read(lightCurveFits, format='fits')
nSNe=len(SNe)
print 'There are %d SNe' % (nSNe)
# ----------- The lightcurve fitting -------------------
J=[]
for SN in SNe:
SNfile='lc-'+SN['name']+'.list'
#print 'Examining %s' % SN['name']
inputFile=lightCurves+SNfile
outputFile=adjlightCurves+SNfile
# If needed refit the lightcurve and insert the date of maximum into the input file
JLA.insertDateOfMax(SN['name'].strip(),inputFile,outputFile,options.force)
return
示例2: compute_date_of_max
# 需要导入模块: import JLA_library [as 别名]
# 或者: from JLA_library import insertDateOfMax [as 别名]
def compute_date_of_max(options):
import numpy
from astropy.table import Table
import JLA_library as JLA
params=JLA.build_dictionary(options.config)
# ----------- Correction factor for extinction -----------
# See ApJ 737 103
extinctionFactor=0.86
# ----------- Read in the configuration file ------------
lightCurveFits=JLA.get_full_path(params['lightCurveFits'])
lightCurves=JLA.get_full_path(params['lightCurves'])
adjlightCurves=JLA.get_full_path(params['adjLightCurves'])
# --------- Read in the list of SNe ---------------------
# One can either use an ASCII file with the SN list or a fits file
if options.SNlist == None:
SNe = Table.read(lightCurveFits, format='fits')
else:
# We use the ascii file, which gives the full path name
SNe = Table.read(options.SNlist, format='ascii',names=['name','type','lc'],data_start=0)
nSNe=len(SNe)
print 'There are %d SNe' % (nSNe)
# ----------- The lightcurve fitting -------------------
for SN in SNe:
if options.SNlist == None:
SNfile='lc-'+SN['name']+'.list'
inputFile=lightCurves+SNfile
outputFile=adjlightCurves+SNfile
else:
inputFile=SN['lc']
outputFile=SN['lc'].replace(lightCurves,adjlightCurves)
print 'Examining %s' % SN['name']
# If needed refit the lightcurve and insert the date of maximum into the input file
JLA.insertDateOfMax(SN['name'].strip(),inputFile,outputFile,options.force,params)
# Shouldn't we adjust the extinction first
if options.adjustExtinction:
adjustExtinction(outputFile,extinctionFactor)
return