本文整理汇总了Python中JLA_library.spectrum方法的典型用法代码示例。如果您正苦于以下问题:Python JLA_library.spectrum方法的具体用法?Python JLA_library.spectrum怎么用?Python JLA_library.spectrum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JLA_library
的用法示例。
在下文中一共展示了JLA_library.spectrum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: prop_unc
# 需要导入模块: import JLA_library [as 别名]
# 或者: from JLA_library import spectrum [as 别名]
def prop_unc(params,filt,spectrum=None):
# Use the filterwheel to find the filename of the filter
filterDir=params['DES_instrument']
filterWheel=JLA.get_full_path(filterDir)+'/Filterwheel'
filterNames=numpy.genfromtxt(filterWheel,comments='#',usecols=(0,1),dtype='S1,S30',
names=['filterName','filename'])
filter_filename=filterNames[filterNames['filterName']==filt['filter'][-1:]]['filename'][0]
# Read in the filter curve
filterCurve=JLA.filterCurve(JLA.get_full_path(filterDir)+'/'+filter_filename)
# Set the magnitude of the filter offset
offset=filt['wavelength']*10.
# We compute a number of integrals. First with the filtercurves as is, then with an offset added to the filter curve
# i) The I0 integral
error_I0=2.5 * numpy.log10(filterCurve.I0(0.0)/filterCurve.I0(offset))
# ii) The chromatic correction.
# Assumed to be zero for now
# If the standard filter transmission curves are shifted by 5nm, then all the filters will be out by that same amount
# This may mean, that the offset is quite small
#mean_wavelength=filterCurve.mean()
#I10_std=filterCurve.I1(mean_wavelength,0.0) / filterCurve.I0(0.0)
#I10_std_offset=filterCurve.I1(mean_wavelength,10.0) / filterCurve.I0(10.0)
error_chromatic=0.0
# iii) The error in the AB offset
# We use the standard filter curve to compute the AB offset
if spectrum==None:
calspec=JLA.spectrum(fits.getdata(JLA.get_full_path(params['calspec']),1),'CALSPEC')
else:
calspec=JLA.spectrum(fits.getdata(JLA.get_full_path(spectrum),1),'CALSPEC')
error_AB=filterCurve.AB(calspec)-filterCurve.AB(calspec,offset)
return error_I0,error_chromatic,error_AB
示例2: compute_ZP
# 需要导入模块: import JLA_library [as 别名]
# 或者: from JLA_library import spectrum [as 别名]
def compute_ZP(options):
import JLA_library as JLA
import numpy as np
params=JLA.build_dictionary(options.config)
# Read in the standard star
standard=JLA.spectrum(JLA.get_full_path(params['magSys'])+options.standard)
# Read in the filter
filt=JLA.filterCurve(JLA.get_full_path(params['filterDir'])+options.filter)
# Compute the ZP
if options.system=='AB':
print '%s in %s %s %5.3f' % (options.standard,options.filter,options.system,filt.AB(standard))
else:
pass
# print '%s in %s %s %5.3f' % (options.standard,options.filter,options.system,filt.Vega(standard))
return