本文整理匯總了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