当前位置: 首页>>代码示例>>Python>>正文


Python JLA_library.filterCurve方法代码示例

本文整理汇总了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
开发者ID:dessn,项目名称:Covariance,代码行数:21,代码来源:jla_compute_filterTransVar.py

示例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
开发者ID:dessn,项目名称:Covariance,代码行数:39,代码来源:jla_FGCM.py

示例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
开发者ID:clidman,项目名称:Covariance,代码行数:26,代码来源:jla_compute_ZP.py


注:本文中的JLA_library.filterCurve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。