In [25]:
%load_ext autoreload
%autoreload 2
from bokeh.io import output_notebook
import numpy as np
from pkg_resources import resource_filename
output_notebook()


The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
Loading BokehJS ...

Introduction

The Spanish Virtual Observatory (SVO) Filter Profile Service is a great resource for homogenized photometric filter curves and metadata. With svo_filters, I tried to create a lightweight and flexible package to incorporate these filters into Python applications.

Install in the usual fashion with

pip install svo_filters

or via Github with

git clone https://github.com/hover2pi/svo_filters.git
cd svo_filters
python setup.py install

Then import like so


In [2]:
from svo_filters import svo

The actual filters are stored locally as XML files and can be viewed with


In [3]:
svo.filters()


Out[3]:
<Table masked=True length=107>
BandCalibrationReferenceFWHMFacilityFilterProfileServiceMagSysPhotCalIDPhotSystemProfileReferenceWavelengthCenWavelengthEffWavelengthMaxWavelengthMeanWavelengthMinWavelengthPeakWavelengthPhotWavelengthPivotWavelengthUCDWavelengthUnitWidthEffZeroPointZeroPointTypeZeroPointUnitfilterIDn_binsn_pixelspathpixels_per_binrefswl_maxwl_minInstrumentCommentsDetectorType
str91str86float64str91str91str91str91str91str91float64float64float64float64float64float64float64float64str91str91float64str91str91str91str91float64float64str91float64str91float64float64str91str91float64
2MASS.Hhttp://adsabs.harvard.edu/cgi-bin/nph-bib_query?bibcode=2003AJ....126.1090C&db_key=AST0.260962MASSivo://svo/fpsVega2MASS/2MASS.H/Vega2MASShttp://www.ipac.caltech.edu/2mass/releases/allsky/doc/sec6_4a.html1.648721.6621.82311.6621.478741.6711.642381.64949em.wlum0.250941.1113698753332439e-10Pogsonerg / (Angstrom cm2 s)2MASS/2MASS.H1.058.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/2MASS.H58.0['AST']1.82311.47874------
2MASS.Jhttp://adsabs.harvard.edu/cgi-bin/nph-bib_query?bibcode=2003AJ....126.1090C0.214912MASSivo://svo/fpsVega2MASS/2MASS.J/Vega2MASShttp://www.ipac.caltech.edu/2mass/releases/allsky/doc/sec6_4a.html#rsr1.239061.2351.40681.2351.080651.3261.232091.23931em.wlum0.162413.133106119110296e-10Pogsonerg / (Angstrom cm2 s)2MASS/2MASS.J1.0107.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/2MASS.J107.0['2003AJ....126.1090C']1.40681.08065------
2MASS.Kshttp://adsabs.harvard.edu/cgi-bin/nph-bib_query?bibcode=2003AJ....126.1090C0.278462MASSivo://svo/fpsVega2MASS/2MASS.Ks/Vega2MASShttp://www.ipac.caltech.edu/2mass/releases/allsky/doc/sec6_4a.html#rsr2.16342.1592.355242.1591.954372.2632.155772.16386em.wlum0.261894.2885552489626795e-11Pogsonerg / (Angstrom cm2 s)2MASS/2MASS.Ks1.076.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/2MASS.Ks76.0['2003AJ....126.1090C']2.355241.95437------
ACS_HRC.F435W--0.08852HSTivo://svo/fpsVegaHST/ACS_HRC.F435W/VegaACS_HRChttp://www.stsci.edu/hst/acs/analysis/zeropoints0.435730.433150.486130.434340.35990.476010.435060.43327em.wlum0.076026.3846394495943405e-09Pogsonerg / (Angstrom cm2 s)HST/ACS_HRC.F435W1.02163.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/ACS_HRC.F435W2163.0[]0.486130.3599ACS----
ACS_HRC.F555W--0.123HSTivo://svo/fpsVegaHST/ACS_HRC.F555W/VegaACS_HRChttp://www.stsci.edu/hst/acs/analysis/zeropoints0.541070.532710.620490.539190.458670.549980.535070.53798em.wlum0.110183.82955756705008e-09Pogsonerg / (Angstrom cm2 s)HST/ACS_HRC.F555W1.02833.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/ACS_HRC.F555W2833.0[]0.620490.45867ACS----
ACS_HRC.F658N--0.0072HSTivo://svo/fpsVegaHST/ACS_HRC.F658N/VegaACS_HRChttp://www.stsci.edu/hst/acs/analysis/zeropoints0.65840.658610.665940.65840.650990.65920.658620.6584em.wlum0.007471.7755279808560669e-09Pogsonerg / (Angstrom cm2 s)HST/ACS_HRC.F658N1.0189.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/ACS_HRC.F658N189.0[]0.665940.65099ACS----
ACS_HRC.F775W--0.15151HSTivo://svo/fpsVegaHST/ACS_HRC.F775W/VegaACS_HRChttp://www.stsci.edu/hst/acs/analysis/zeropoints0.775740.762460.863070.770220.680140.738030.764890.76897em.wlum0.129921.3016053164718504e-09Pogsonerg / (Angstrom cm2 s)HST/ACS_HRC.F775W1.02784.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/ACS_HRC.F775W2784.0[]0.863070.68014ACS----
ACS_HRC.F850LP--0.15317HSTivo://svo/fpsVegaHST/ACS_HRC.F850LP/VegaACS_HRChttp://www.stsci.edu/hst/acs/analysis/zeropoints0.911030.911841.094650.919440.801510.900960.9150.91778em.wlum0.15528.05183794111089e-10Pogsonerg / (Angstrom cm2 s)HST/ACS_HRC.F850LP1.03105.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/ACS_HRC.F850LP3105.0[]1.094650.80151ACS----
Cousins.I--0.10937--ivo://svo/fpsVegaGeneric/Cousins.I/VegaCousinshttp://ulisse.pd.astro.it/Astro/ADPS/Systems/Sys_093/index_093.html0.786940.782920.900060.788560.706650.7650.784680.78764em.wlum0.101111.2023352736450864e-09Pogsonerg / (Angstrom cm2 s)Generic/Cousins.I1.043.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/Cousins.I43.0[]0.900060.70665------
Cousins.R--0.15165--ivo://svo/fpsVegaGeneric/Cousins.R/VegaCousinshttp://ulisse.pd.astro.it/Astro/ADPS/Systems/Sys_093/index_093.html0.647180.63580.7950.646940.550.60.639310.64509em.wlum0.138112.2455983575940744e-09Pogsonerg / (Angstrom cm2 s)Generic/Cousins.R1.053.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/Cousins.R53.0[]0.7950.55------
......................................................................................................
WFC3_UVIS2.F850LP--0.1168HSTivo://svo/fpsVegaHST/WFC3_UVIS2.F850LP/VegaWFC3http://www.stsci.edu/hst/wfc3/documents/handbooks/currentIHB/0.908230.912461.092240.917810.825050.882180.914740.9166em.wlum0.11828.068639909681385e-10Pogsonerg / (Angstrom cm2 s)HST/WFC3_UVIS2.F850LP1.01711.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/WFC3_UVIS2.F850LP1711.0[]1.092240.82505WFC3/>--
WFPC2.F336W--0.04909HSTivo://svo/fpsVegaHST/WFPC2.f336w/Vega--http://www.stsci.edu/hst/wfpc2/analysis/filters.html0.332710.332930.379030.333550.295650.34480.333680.33317em.wlum0.049243.291718270769144e-09Pogsonerg / (Angstrom cm2 s)HST/WFPC2.f336w1.0404.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/WFPC2.F336W404.0[]0.379030.29565WFPC2----
WFPC2.F439W--0.07058HSTivo://svo/fpsVegaHST/WFPC2.f439w/Vega--http://www.stsci.edu/hst/wfpc2/analysis/filters.html0.431750.429130.475810.430610.389350.41760.430030.43015em.wlum0.0616.7906234368351585e-09Pogsonerg / (Angstrom cm2 s)HST/WFPC2.f439w1.0420.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/WFPC2.F439W420.0[]0.475810.38935WFPC2----
WFPC2.F656N--0.00285HSTivo://svo/fpsVegaHST/WFPC2.f656n/Vega--http://www.stsci.edu/hst/wfpc2/analysis/filters.html0.656410.656370.658740.656380.653840.65620.656370.65638em.wlum0.002831.5071375295016861e-09Pogsonerg / (Angstrom cm2 s)HST/WFPC2.f656n1.026.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/WFPC2.F656N26.0[]0.658740.65384WFPC2----
WFPC2.F814W--0.25562HSTivo://svo/fpsVegaHST/WFPC2.f814w/Vega--http://www.stsci.edu/hst/wfpc2/analysis/filters.html0.835890.818641.004260.836950.694760.83860.825440.83357em.wlum0.25011.0611475122615156e-09Pogsonerg / (Angstrom cm2 s)HST/WFPC2.f814w1.01513.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/WFPC2.F814W1513.0[]1.004260.69476WFPC2----
Wircam.Y--0.11053CFHTivo://svo/fpsVegaCFHT/Wircam.Y/VegaWircamhttp://cfht.hawaii.edu/Instruments/Filters/wircam.html1.025351.022131.11341.025880.93861.03221.023281.0253em.wlum0.108425.949435587748138e-10Pogsonerg / (Angstrom cm2 s)CFHT/Wircam.Y1.0875.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/Wircam.Y875.0[]1.11340.9386Wircam----
WISE.W1http://wise2.ipac.caltech.edu/docs/release/prelim/expsup/figures/sec4_3gt4.gif0.63579WISEivo://svo/fpsVegaWISE/WISE.W1/VegaWISEhttp://wise2.ipac.caltech.edu/docs/release/prelim/expsup/sec4_3g.html#WISEZMA3.465523.35263.872393.35262.75413.483.33873.3897em.wlum0.662648.256082039570161e-12Pogsonerg / (Angstrom cm2 s)WISE/WISE.W11.0141.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/WISE.W1141.0['http://wise2.ipac.caltech.edu/docs/release/prelim/expsup/figures/sec4_3gt4.gif']3.872392.7541------
WISE.W2http://wise2.ipac.caltech.edu/docs/release/prelim/expsup/figures/sec4_3gt4.gif1.10732WISEivo://svo/fpsVegaWISE/WISE.W2/VegaWISEhttp://wise2.ipac.caltech.edu/docs/release/prelim/expsup/sec4_3g.html#WISEZMA4.64434.60285.341364.60283.963334.934.586944.64064em.wlum1.042272.4308982979229142e-12Pogsonerg / (Angstrom cm2 s)WISE/WISE.W21.0168.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/WISE.W2168.0['http://wise2.ipac.caltech.edu/docs/release/prelim/expsup/figures/sec4_3gt4.gif']5.341363.96333------
WISE.W3http://wise2.ipac.caltech.edu/docs/release/prelim/expsup/figures/sec4_3gt4.gif6.2758WISEivo://svo/fpsVegaWISE/WISE.W3/VegaWISEhttp://wise2.ipac.caltech.edu/docs/release/prelim/expsup/sec4_3g.html#WISEZMA13.2156411.560817.2613411.56087.4430414.4611.3081312.56755em.wlum5.505577.104734271598481e-14Pogsonerg / (Angstrom cm2 s)WISE/WISE.W31.01122.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/WISE.W31122.0['http://wise2.ipac.caltech.edu/docs/release/prelim/expsup/figures/sec4_3gt4.gif']17.261347.44304------
WISE.W4http://wise2.ipac.caltech.edu/docs/release/prelim/expsup/figures/sec4_3gt4.gif4.73973WISEivo://svo/fpsVegaWISE/WISE.W4/VegaWISEhttp://wise2.ipac.caltech.edu/docs/release/prelim/expsup/sec4_3g.html#WISEZMA22.2228822.088327.9107222.088319.5200821.6222.0231122.31427em.wlum4.101685.138758584844504e-15Pogsonerg / (Angstrom cm2 s)WISE/WISE.W41.0897.0/Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/WISE.W4897.0['http://wise2.ipac.caltech.edu/docs/release/prelim/expsup/figures/sec4_3gt4.gif']27.9107219.52008------

Load a Photometric Filter

To load a filter object, just pass the band name to the Filter class. We can then view the metadata and see a plot!


In [37]:
H_band = svo.Filter('2MASS.H')
H_band.info()
H_band.plot()


     Attributes                                              Values                                        
-------------------- --------------------------------------------------------------------------------------
                Band H                                                                                     
CalibrationReference http://adsabs.harvard.edu/cgi-bin/nph-bib_query?bibcode=2003AJ....126.1090C&db_key=AST
            Facility 2MASS                                                                                 
FilterProfileService ivo://svo/fps                                                                         
              MagSys Vega                                                                                  
           PhotCalID 2MASS/2MASS.H/Vega                                                                    
          PhotSystem 2MASS                                                                                 
    ProfileReference http://www.ipac.caltech.edu/2mass/releases/allsky/doc/sec6_4a.html                    
          ext_vector 0.327                                                                                 
            filterID 2MASS/2MASS.H                                                                         
                fwhm 0.26096 um                                                                            
              n_bins 1                                                                                     
                name 2MASS.H                                                                               
                path /Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/2MASS.H     
      pixels_per_bin 58                                                                                    
                refs ['AST']                                                                               
         wave_center 1.64872 um                                                                            
            wave_eff 1.662 um                                                                              
            wave_max 1.8231 um                                                                             
           wave_mean 1.662 um                                                                              
            wave_min 1.47874 um                                                                            
           wave_peak 1.671 um                                                                              
           wave_phot 1.64238 um                                                                            
          wave_pivot 1.64949 um                                                                            
           width_eff 0.25094 um                                                                            
                  zp 1.1113698753332439e-10 erg / (Angstrom cm2 s)                                         

The actual relative spectral response curve is stored as an array of the wavelength and throughput.


In [38]:
H_band.rsr.shape


Out[38]:
(2, 58)

Load a Grism

Filters can also be binned arbitrarily, for use with grisms. We can pass integers to the n_bins or n_channels arguments to specify the number of wavelength bins or channels per bin, respectively.


In [39]:
G141 = svo.Filter('WFC3_IR.G141', n_bins=15)
G141.info()
G141.plot()


Bandpass trimmed to 1.04039 um - 1.77466 um
15 bins of 634 pixels each.
     Attributes                                              Values                                        
-------------------- --------------------------------------------------------------------------------------
            Comments />                                                                                    
            Facility HST                                                                                   
FilterProfileService ivo://svo/fps                                                                         
          Instrument WFC3                                                                                  
              MagSys Vega                                                                                  
           PhotCalID HST/WFC3_IR.G141/Vega                                                                 
          PhotSystem WFC3                                                                                  
    ProfileReference http://www.stsci.edu/hst/wfc3/documents/handbooks/currentIHB/                         
          ext_vector 0                                                                                     
            filterID HST/WFC3_IR.G141                                                                      
                fwhm 0.57288 um                                                                            
              n_bins 15                                                                                    
                name WFC3_IR.G141                                                                          
                path /Users/jfilippazzo/Documents/Modules/svo_filters/svo_filters/data/filters/WFC3_IR.G141
      pixels_per_bin 634                                                                                   
                refs []                                                                                    
         wave_center 1.38902 um                                                                            
            wave_eff 1.32829 um                                                                            
            wave_max 1.77466 um                                                                            
           wave_mean 1.39879 um                                                                            
            wave_min 1.04039 um                                                                            
           wave_peak 1.48039 um                                                                            
           wave_phot 1.3481 um                                                                             
          wave_pivot 1.38869 um                                                                            
           width_eff 0.52172 um                                                                            
                  zp 2.2612502006498423e-10 erg / (Angstrom cm2 s)                                         

Now we can apply the filter to a spectrum like so:


In [41]:
# Get the filter object
G141 = svo.Filter('WFC3_IR.G141', n_bins=15)

# Get a spectrum
file = resource_filename('svo_filters', 'data/spectra/vega.txt')
spec = np.genfromtxt(file, unpack=True)
spec = [i[(spec[0] > 0.9) & (spec[0] < 1.9)] for i in spec]

# Applyt the filter
filtered = G141.apply(spec, plot=True)


Bandpass trimmed to 1.04039 um - 1.77466 um
15 bins of 634 pixels each.

Filters are fun!