本文整理匯總了Python中JLA_library.filterCurve方法的典型用法代碼示例。如果您正苦於以下問題:Python JLA_library.filterCurve方法的具體用法?Python JLA_library.filterCurve怎麽用?Python JLA_library.filterCurve使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JLA_library
的用法示例。
在下文中一共展示了JLA_library.filterCurve方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: compute_filterTransVar
# 需要導入模塊: import JLA_library [as 別名]
# 或者: from JLA_library import filterCurve [as 別名]
def compute_filterTransVar(options):
import JLA_library as JLA
import numpy
from astropy.table import Table
eff=[]
# Read in the filter curves
filt=Table.read(JLA.get_full_path(options.filter),format='ascii.csv')
for col in filt.colnames:
if 'ccd' in col and 'amp' not in col:
f=JLA.filterCurve(filt['wavelength'],filt[col])
eff.append(f.eff())
print 'Examined the transmission curves for %d CCDs' % (len(eff))
print 'Mean effective wavelength is %6.1f' % (numpy.mean(eff))
print 'Range of effective wavelength is %6.1f-%6.1f' % (numpy.min(eff),numpy.max(eff))
print 'RMS effective wavelength %6.1f' % (numpy.std(eff))
return
示例2: prop_unc
# 需要導入模塊: import JLA_library [as 別名]
# 或者: from JLA_library import filterCurve [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
示例3: compute_ZP
# 需要導入模塊: import JLA_library [as 別名]
# 或者: from JLA_library import filterCurve [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