Exemple #1
0
def get_filter_info(name, vega=vega):
    if name.startswith('nirc2'):
        from nirc2 import synthetic as nirc2syn
    
        tmp = name.split(',')
        filterName = tmp[-1]
        filt = nirc2syn.FilterNIRC2(filterName)
    else:
        filt = ObsBandpass(name)
        
        # Convert to ArraySpectralElement for resampling.
        filt = spectrum.ArraySpectralElement(filt.wave, filt.throughput,
                                             waveunits=filt.waveunits,
                                             name=filt.name)

    # Resample the filter to have 1500 points across. More is excessive.
    if len(filt.wave) > 1500:
        idx = np.where(filt.throughput > 0.001)[0]
        new_wave = np.linspace(filt.wave[idx[0]], filt.wave[idx[-1]], 1500, dtype=float)
        filt = filt.resample(new_wave) 

    vega_obs = obs.Observation(vega, filt, binset=filt.wave, force='taper')
    vega_flux = vega_obs.binflux.sum()
    vega_mag = 0.03

    filt.flux0 = vega_flux
    filt.mag0 = vega_mag
    
    return filt
def get_filter_info(name, vega=vega):
    filter = ObsBandpass(name)

    vega_obs = obs.Observation(vega, filter, binset=filter.wave, force='taper')
    vega_flux = vega_obs.binflux.sum()
    vega_mag = 0.03

    filter.flux0 = vega_flux
    filter.mag0 = vega_mag

    return filter
def get_filter_info(name, vega=vega):
    filter = ObsBandpass(name)

    vega_obs = obs.Observation(vega, filter, binset=filter.wave, force='taper')
    vega_flux = vega_obs.binflux.sum()
    vega_mag = 0.03

    filter.flux0 = vega_flux
    filter.mag0 = vega_mag
    
    return filter
def get_filter_info(name, vega=vega):
    if name.startswith('nirc2'):
        tmp = name.split(',')
        filterName = tmp[-1]
        filter = nirc2syn.filters[filterName]
        flux0 = nirc2syn.filter_flux0[filterName]
        mag0 = nirc2syn.filter_mag0[filterName]
    else:
        filter = ObsBandpass(name)

    vega_obs = obs.Observation(vega, filter, binset=filter.wave, force='taper')
    vega_flux = vega_obs.binflux.sum()
    vega_mag = 0.03

    filter.flux0 = vega_flux
    filter.mag0 = vega_mag
    
    return filter
def get_filter_info(name, vega=vega):
    if name.startswith('nirc2'):
        tmp = name.split(',')
        filterName = tmp[-1]
        filter = nirc2syn.filters[filterName]
        flux0 = nirc2syn.filter_flux0[filterName]
        mag0 = nirc2syn.filter_mag0[filterName]
    else:
        filter = ObsBandpass(name)

    vega_obs = obs.Observation(vega, filter, binset=filter.wave, force='taper')
    vega_flux = vega_obs.binflux.sum()
    vega_mag = 0.03

    filter.flux0 = vega_flux
    filter.mag0 = vega_mag

    return filter