In [1]:
#Now let us preform a statistical exercise comparing cumulative distribution
import numpy as np
from astroquery.irsa import Irsa
import scipy.stats as stat
import matplotlib.pyplot as plt
In [2]:
#Let us see the catalogs contained in IRSA
Irsa.print_catalogs()
lockman_70_cat_s05              SWIRE Lockman Region 70um Spring '05 Spitzer Catalog
elaisn1_70_cat_s05              SWIRE ELAIS N1 Region 70um Spring '05 Spitzer Catalog
cosmos_ib_phot                  COSMOS Intermediate and Broad Band Photometry Catalog 2008
dr4_clouds_hrel                 C2D Fall '07 High Reliability (HREL) CLOUDS Catalog (CHA_II, LUP, OPH, PER, SER)
sdwfs_var                       SDWFS Variability Catalog
fp_scan_dat                     2MASS All-Sky Survey Scan Info (Read Me!)
wise_allsky_3band_p3am_xrf      WISE 3-Band Cryo Frame Cross-Reference Table
wise_allsky_2band_p1bs_psd      WISE Post-Cryo Single Exposure (L1b) Source Table
servsxmmi2                      SERVS XMM-LSS 4.5 micron Catalog
servsxmmi1                      SERVS XMM-LSS 3.6 micron Catalog
sage_full_m70                   SAGE MIPS 70 um Combined Epoch Full List (more complete, less reliable)
elaiss1_70_cat_f05              SWIRE ELAIS S1 Region 70um Fall '05 Spitzer Catalog
glimpse3dep1a                   GLIMPSE 3D Epoch 1 Archive (more complete, less reliable)
glimpse3dep1c                   GLIMPSE 3D Epoch 1 Catalog (highly reliable)
wise_allsky_3band_p1bm_frm      WISE 3-Band Cryo Single Exposure (L1b) Image Inventory Table
hgoodss                         GOODS South Catalog
hgoodsn                         GOODS North Catalog
wise_allsky_3band_p1bs_frm      WISE 3-Band Cryo Single Exposure (L1b) Frame Metadata Table
sdwfs_lcurve                    SDWFS Light Curve Catalog
musyc_photz                     MUSYC Photometric Redshift Catalog
brava                           BRAVA Catalog
sagesmc_iracep1c                SAGE-SMC IRAC Epoch 1 Catalog (more reliable)
xfls_i3m                        Extragalactic FLS IRAC Channel 3 Main Field Catalog
sagesmc_iracep1a                SAGE-SMC IRAC Epoch 1 Archive  (less reliable)
sage_cat_irac_e1e2              SAGE IRAC Epoch 1 and Epoch 2 Catalog  (more reliable)
xfls_i3v                        Extragalactic FLS IRAC Channel 3 Verification Field Catalog
ewsdbf_info                     2MASS Survey Merged Extended Source Information Table
csi2264t1                       CSI 2264 Object Table
coadd_dat_6x2                   2MASS 6X w/LMC/SMC Atlas Image Info
scosmos_mips_24_go2             S-COSMOS MIPS 24um MAIN Photometry Catalog June 2007 ((Aug 2008: Important Flux-correction Note))
scosmos_mips_24_go3             S-COSMOS MIPS 24 Photometry Catalog October 2008
xmm_70_cat_s05                  SWIRE XMM_LSS Region 70um Spring '05 Spitzer Catalog
glimpse2ep1a08                  GLIMPSE II Epoch 1 December '08 Archive (more complete, less reliable)
sagevar                         SAGE-Var LMC Variable Catalog
wise_prelim_p1bl_lod            WISE Preliminary Release Single Exposure (L1b) Scan Inventory Table (Superseded)
sage_full_m160                  SAGE MIPS 160 um Combined Epoch Catalog (more complete, less reliable)
chandra_cat_f05                 SWIRE CDFS Region Fall '05  Spitzer Catalog
clash80_v2                      CLASH 80 micron Catalog
dr4_cores_ysoc                  C2D Fall '07 candidate Young Stellar Objects (YSO) CORES Catalog
sage_full_m24_match             SAGE MIPS 24 um Matched Epoch Full List (more complete, less reliable)
glimpse2ep2a09                  GLIMPSE II Epoch 2 November '09 Archive (more complete, less reliable)
dr4_cores_full                  C2D Fall '07 Full CORES Catalog
wise_allsky_4band_p1bs_psd      WISE All-Sky Single Exposure (L1b) Source Table
fp_xsc                          2MASS All-Sky Extended Source Catalog (XSC)
heritagel100                    HERITAGE LMC PACS 100 micron Catalog
irassss                         IRAS Small Scale Structure Catalog
cosmos_zphot_mag25              COSMOS Photometric Redshift Catalog Fall 2008 (README - mag 25 limited)
irs_enhv211                     IRS Enhanced Products
acs_iphot_sep07                 COSMOS ACS I-band photometry catalog September 2007
slmcovv2                        SEIP MIPS Coverage Table
irasssc                         IRAS Serendipitous Survey Catalog
bolocam_gps_v1_0_1              BOLOCAM Galactic Plane Survey Catalog
wise_allsky_3band_p3am_cdd      WISE 3-Band Cryo Atlas Image Inventory Table
heritages250                    HERITAGE SMC SPIRE 250 micron Catalog
xmm_24_cat_s05                  SWIRE XMM_LSS Region 24um Spring '05 Spitzer Catalog
sage_cat_irac_match             SAGE IRAC Matched Epoch Archive (more reliable)
scf_info                        2MASS LMC/SMC Calibration Merged Point Source Information Table
clash36_v2                      CLASH 3.6 micron Catalog
heritagel350                    HERITAGE LMC SPIRE 350 micron Catalog
ext_src_cat1                    2MASS First Incremental Release Extended Source Catalog (XSC)
chandra_70_cat_f05              SWIRE CDFS Region 70um Fall '05 Spitzer Catalog
sagefull                        SAGE-Var LMC Full Catalog
fls_release_v2_photom           FLS SDSS and MIPS Astrometric and Photometric Catalog (V2)
bolocamdist                     BOLOCAM Galactic Plane Survey Distance Catalog
glimpse_s07                     GLIMPSE I Spring '07 Catalog (highly reliable)
lockman_160_cat_s05             SWIRE Lockman Region 160um Spring '05 Spitzer Catalog
wise_allsky_3band_p1ba_mch      WISE 3-Band Cryo Known Solar System Object Possible Association List ( Caution )
sepm70                          SEP MIPS 70 micron Point Source Catalog
esixxf_link                     2MASS 6X w/LMC/SMC Merged Extended Source Link Table
ewsdbf_link                     2MASS Survey Merged Extended Source Link Table
msxc6_rej                       The Midcourse Space Experiment (MSXC6) Rejects
scosmos_mips_24_go2_deep        S-COSMOS MIPS 24um DEEP Photometry Catalog June 2007 ((Aug 2008: Important Flux-correction Note))
ercsc_f353_e                    Planck ERCSC 353GHz Catalog
servscdfsi12                    SERVS CDFS 2-band Catalog (highly reliable)
csi2264t2                       CSI 2264 CoRoT Light Curves
csi2264t3                       CSI 2264 Spitzer Light Curves
sagesmc_mips160f                SAGE-SMC MIPS 160um Combined Epoch Full List (more complete, less reliable)
sagesmc_mips160c                SAGE-SMC MIPS 160um Combined Epoch Catalog (more reliable)
neowiser_p1ba_mch               NEOWISE-R Known Solar System Object Possible Association List ( Caution )
ercsc_f070_e                    Planck ERCSC 70GHz Catalog
scan_dat                        2MASS First Incremental Release Survey Scan Info
swire_lhisod                    SWIRE Lockman Hole ISOCAM Deep Field Catalog
ssdf1                           SSDF IRAC Ch1 Catalog
dr4_cores_hrel                  C2D Fall '07 High Reliability (HREL) CORES Catalog
ssdf2                           SSDF IRAC Ch2 Catalog
swire_lhisos                    SWIRE Lockman Hole ISOCAM Shallow Field Catalog
cosmos_xmm_2                    COSMOS XMM Point-like Source Catalog v2.0
pep350                          PEP SPIRE 350 micron Catalog
dr4_off_cloud_full              C2D Fall '07 Full OFF-CLOUD Catalog (CHA_II, LUP, OPH, PER, SER)
schemas                         Available schemas at NASA/IPAC Infrared Science Archive
sdwfs_ch4_stack                 SDWFS Aug '09 DR1.1 IRAC 8.0um-Selected Total Coadd Stack
wise_allsky_4band_p3am_cdd      WISE All-Sky Atlas Image Inventory Table
ercsc_f217_e                    Planck ERCSC 217GHz Catalog
xfls_m2                         Extragalactic FLS MIPS 70 micron Catalog
xfls_m3                         Extragalactic FLS MIPS 160 micron Catalog
sagesmcvar                      SAGE-Var SMC Variable Catalog
sagesmc_mips70c                 SAGE-SMC MIPS 70um Combined Epoch Catalog (more reliable)
sagesmc_mips70f                 SAGE-SMC MIPS 70um Combined Epoch Full List (more complete, less reliable)
catalog                         IRAS 1.2-Jy Redshift Survey
pscan_dat                       2MASS Survey Scan Info
ext_src_sc                      2MASS LMC/SMC Calibration Extended Source Working Database
mipsgalc                        MIPSGAL Catalog
sage_ar_irac_e1e2               SAGE IRAC Epoch 1 and Epoch 2 Archive (more complete, less reliable)
sixxf_info                      2MASS 6X w/LMC/SMC Merged Point Source Information Table
cosmos_xgal                     COSMOS X-ray Group Member Catalog
ercsc_f545_e                    Planck ERCSC 545GHz Catalog
galex_emphot_v3                 GALEX/COSMOS Prior-based Photometry Catalog June 2008
sdwfs_ch1_epoch4                SDWFS Aug '09 DR1.1 IRAC 3.6um-Selected 3x30sec Coadd, epoch 4 (Mar '08)
sdwfs_ch1_epoch1                SDWFS Aug '09 DR1.1 IRAC 3.6um-Selected 3x30sec Coadd, epoch 1 (Jan '04)
sdwfs_ch1_epoch2                SDWFS Aug '09 DR1.1 IRAC 3.6um-Selected 3x30sec Coadd, epoch 2 (Aug '07)
sdwfs_ch1_epoch3                SDWFS Aug '09 DR1.1 IRAC 3.6um-Selected 3x30sec Coadd, epoch 3 (Feb '08)
heritages350                    HERITAGE SMC SPIRE 350 micron Catalog
servscdfsi2                     SERVS CDFS 4.5 micron Catalog
servscdfsi1                     SERVS CDFS 3.6 micron Catalog
key_columns                     Available Key Columns at NASA/IPAC Infrared Science Archive
dr4_clouds_ysoc                 C2D Fall '07 candidate Young Stellar Objects (YSO) CLOUDS Catalog (CHA_II, LUP, OPH, PER, SER)
wise_allsky_3band_p3al_lod      WISE 3-Band Cryo Atlas Inventory Table
heritagel250                    HERITAGE LMC SPIRE 250 micron Catalog
sage_cat_m24                    SAGE MIPS 24 um Epoch 1 and Epoch 2 Catalog  (more reliable)
sdwfs_ch2_epoch4                SDWFS Aug '09 DR1.1 IRAC 4.5um-Selected 3x30sec Coadd, epoch 4 (Mar '08)
sdwfs_ch2_epoch1                SDWFS Aug '09 DR1.1 IRAC 4.5um-Selected 3x30sec Coadd, epoch 1 (Jan '04)
sdwfs_ch2_epoch3                SDWFS Aug '09 DR1.1 IRAC 4.5um-Selected 3x30sec Coadd, epoch 3 (Feb '08)
sdwfs_ch2_epoch2                SDWFS Aug '09 DR1.1 IRAC 4.5um-Selected 3x30sec Coadd, epoch 2 (Aug '07)
clash58_v2                      CLASH 5.8 micron Catalog
sdwfs_ch4_epoch3                SDWFS Aug '09 DR1.1 IRAC 8.0um-Selected 3x30sec Coadd, epoch 3 (Feb '08)
sdwfs_ch4_epoch2                SDWFS Aug '09 DR1.1 IRAC 8.0um-Selected 3x30sec Coadd, epoch 2 (Aug '07)
xfls_m1t5                       Extragalactic FLS MIPS 24 micron Point Source Catalog
xfls_m1t4                       Extragalactic FLS MIPS 24 micron Calibration Star Catalog
scosmos_irac_0407               S-COSMOS IRAC 4-channel Photometry Catalog June 2007 (README)
xfls_m1t2                       Extragalactic FLS MIPS 24 micron Extended Source Catalog
sdwfs_ch2_stack                 SDWFS Aug '09 DR1.1 IRAC 4.5um-Selected Total Coadd Stack
pepxid                          PEP PACS and MIPS Cross-IDs Catalog
pts_samp_cat                    2MASS Sampler Point Source Catalog (PSC)
peplh24                         PEP Lockman Hole MIPS 24 micron Comparison Catalog
chandra_24_cat_f05              SWIRE CDFS Region 24um Fall '05 Spitzer Catalog
wise_allwise_p3as_mep           AllWISE Multiepoch Photometry Table
sagesmc_mips24ep1c              SAGE-SMC MIPS 24um Epoch 1 Catalog (more reliable)
sagesmc_mips24c                 SAGE-SMC MIPS 24 um Epoch 0, Epoch 1, and Epoch 2 Catalog  (more reliable)
sagesmc_mips24ep1f              SAGE-SMC MIPS 24um Epoch 1 Full List (less  reliable)
sagesmc_mips24f                 SAGE-SMC MIPS 24 um Epoch 0, Epoch 1, and Epoch 2 Full List (more complete, less reliable)
ercsc_f857_e                    Planck ERCSC 857GHz Catalog
sepm24                          SEP MIPS 24 micron Point Source Catalog
wise_allwise_p3as_psd           AllWISE Source Catalog
com_pccs1_044                   Planck PCCS 44GHz Catalog
prelim_p1bm_frm                 WISE Preliminary Release Single Exposure (L1b) Image Inventory Table (Superseded)
dr4_stars_full                  C2D Fall '07 Full STARS Catalog
wise_allwise_p3as_psr           AllWISE Reject Table
com_pccs1_sz_union              Planck Sunyaev-Zeldovich Cluster UNION List
feps_phot                       FEPS Photometry Catalog
xmm_160_cat_s05                 SWIRE XMM_LSS Region 160um Spring '05 Spitzer Catalog
elaisn1_160_cat_s05             SWIRE ELAIS N1 Region 160um Spring '05 Spitzer Catalog
spuds_mips                      SpUDS MIPS Catalog
ecc                             Planck Early Cold Core Source List (ECC)
sepmext                         SEP MIPS Extended Source Catalog
dr4_stars_hrel                  C2D Fall '07 High Reliability (HREL) STARS Catalog
wise_allsky_3band_p1bs_psd      WISE 3-Band Cryo Single Exposure (L1b) Source Table
sass_v3                         SASS October 2011 Catalog
fls_release_v2_sdss_spectra     FLS SDSS Spectroscopic Catalog (V2)
pscan_dat_sc                    2MASS LMC/SMC Calibration Scan Info
morphology_2005                 COSMOS Morphology Catalog 2005
elaisn2_cat_s05                 SWIRE ELAIS N2 Region Spring '05 Spitzer Catalog
irasfsc                         IRAS Faint Source Catalog v2.0 (FSC)
sage_cat_irac_off               SAGE IRAC Offset Position Epoch 1 and Epoch 2 Catalog (more reliable)
prelim_2band_p1bs_frm           WISE Preliminary Post-Cryo Single Exposure (L1b) Frame Metadata Table (Superseded)
scan_dat_2                      2MASS Second Incremental Release Survey Scan Info
coadd_dat_sc                    2MASS LMC/SMC Calibration Atlas Image Info
acmccat                         ACMC Catalog
lga_v2                          The 2MASS Large Galaxy Atlas
glimpse2sub                     GLIMPSEII Subarray Source List
dustingsfull                    DUSTiNGS Full Catalog
wise_allwise_p3am_xrf           AllWISE Frame Cross-Reference Table
chandra_160_cat_f05             SWIRE CDFS Region 160um Fall '05 SWIRE Spitzer Catalog
slphotdr4                       SEIP Source List
xfls_i2m                        Extragalactic FLS IRAC Channel 2 Main Field Catalog
xfls_i2v                        Extragalactic FLS IRAC Channel 2 Verification Field Catalog
glimpse3d_v2arc                 GLIMPSE 3D, 2007-2009 Archive (more complete, less reliable),(Erratum)
wise_allsky_4band_p1bs_frm      WISE All-Sky Single Exposure (L1b) Frame Metadata Table
ercsc_f030_e                    Planck ERCSC 30GHz Catalog
sagesmc_iraca                   SAGE-SMC IRAC Epoch 0, Epoch 1, and Epoch 2 Archive (less reliable)
sagesmc_iracc                   SAGE-SMC IRAC Epoch 0, Epoch 1, and Epoch 2 Catalog (more reliable)
pscan_dat_6x2                   2MASS 6X w/LMC/SMC Scan Info
heritagel160                    HERITAGE LMC PACS 160 micron Catalog
pepprior                        PEP PACS Extractions Using MIPS 24 micron Priors Catalog
neowiser_p1bm_frm               NEOWISE-R Single Exposure (L1b) Image Inventory Table
lockman_cat_s05                 SWIRE Lockman Region Spring '05 SWIRE Spitzer Catalog
sage_cat_m24_match              SAGE MIPS 24 um Matched Epoch Catalog (more reliable)
pep100                          PEP PACS 100 micron Catalog
prelim_p1bs_frm                 WISE Preliminary Release Single Exposure (L1b) Frame Metadata Table (Superseded)
pt_src_rej                      2MASS Survey Point Source Reject Table
heritages160                    HERITAGE SMC PACS 160 micron Catalog
s4gcat                          Spitzer Survey of Stellar Structure in Galaxies (S4G)
clash45_v2                      CLASH 4.5 micron Catalog
sage_ar_irac_off                SAGE IRAC Offset Position Epoch 1 and Epoch 2 Archive (more complete, less reliable)
sagecatmips24v2                 SAGE Winter '08 MIPS 24 um Epoch 1 and Epoch 2 Catalog  (more reliable)
galcen_psc                      Point Source in a Spitzer/IRAC Survey of the Galactic Center (Ramirez et al. 2008)
glimpse3dep2mra                 GLIMPSE 3D Epoch 2 More Reliable Archive (more complete, less reliable)
cf_info                         2MASS Calibration Merged Point Source Information Table
akari_irc                       Akari/IRC Point Source Catalogue
escf_link                       2MASS LMC/SMC Calibration Merged Extended Source Link Table
wise_allwise_p3am_cdd           AllWISE Atlas Image Inventory Table
wise_allsky_3band_p3as_psd      WISE 3-Band Cryo Source Working Database ( Readme)
wise_allwise_p3al_lod           AllWISE Atlas Inventory Table
elaisn2_24_cat_s05              SWIRE ELAIS N2 Region 24um Spring '05 Spitzer Catalog
com_pccs1_857                   Planck PCCS 857GHz Catalog
sagearciracv2                   SAGE Winter '08 IRAC Epoch 1 and Epoch 2 Archive (more complete, less reliable)
com_pccs1_070                   Planck PCCS 70GHz Catalog
neowiser_p1bs_psd               NEOWISE-R Single Exposure (L1b) Source Table
elaiss1_cat_f05                 SWIRE ELAIS S1 Region Fall '05 SWIRE Spitzer Catalog
slicovv2                        SEIP IRAC Coverage Table
mipsgala                        MIPSGAL Archive
bolocamv21                      BOLOCAM Galactic Plane Survey Catalog v2.1
cosmos_chandra_bsc21            Chandra-COSMOS Bright Source Catalog v2.1
cosmos_morph_col_1              COSMOS Zamojski Morphology Catalog v1.0
com_pccs1_353                   Planck PCCS 353GHz Catalog
ucac3_sources                   USNO CCD Astrograph Catalog (UCAC3)
wise_allsky_4band_p1bm_frm      WISE All-Sky Single Exposure (L1b) Image Inventory Table
servsesi1                       SERVS ELAIS S1 3.6 micron Catalog
servsesi2                       SERVS ELAIS S1 4.5 micron Catalog
ssid2                           SAGE-Spec ID Search
pep250                          PEP SPIRE 250 micron Catalog
com_pccs1_217                   Planck PCCS 217GHz Catalog
ext_src_6x2                     2MASS 6X w/LMC/SMC Extended Source Working Database / Catalog ( Read Me! )
prelim_p3al_lod                 WISE Preliminary Release Atlas Inventory Table (Superseded)
prelim_p3am_xrf                 WISE Preliminary Release Frame Cross-Reference Table (Superseded)
fp_psc                          2MASS All-Sky Point Source Catalog (PSC)
sage_cat_m160                   SAGE MIPS 160 um Combined Epoch Catalog (more reliable)
dr4_stars_ysoc                  C2D Fall '07 candidate Young Stellar Objects (YSO) STARS Catalog
cygx_cat                        Cygnus-X Catalog
scosmos_mips_70_v3              S-COSMOS MIPS 70um Photometry Catalog v3 Jan 2009
pt_src_cat                      2MASS Second Incremental Release Point Source Catalog (PSC)
columns                         Available columns at NASA/IPAC Infrared Science Archive
prelim_2band_p1bl_lod           WISE Preliminary Post-Cryo Single Exposure (L1b) Scan Inventory Table (Superseded)
servseni1                       SERVS ELAIS N1 3.6 micron Catalog
servseni2                       SERVS ELAIS N1 4.5 micron Catalog
elaisn2_70_cat_s05              SWIRE ELAIS N2 Region 70um Spring '05 Spitzer Catalog
sagecatiracv2                   SAGE Winter '08 IRAC Epoch 1 and Epoch 2 Catalog (more reliable)
elaiss1_24_cat_f05              SWIRE ELAIS S1 Region 24um Fall '05 Spitzer Catalog
summary                         IRAS Large Galaxies Catalog
ppmxl                           PPMXL: A Proper Motion Catalog Combining USNO-B and 2MASS
heritages500                    HERITAGE SMC SPIRE 500 micron Catalog
wise_allsky_3band_p3as_cdd      WISE 3-Band Cryo Atlas Metadata Table
sagesmcfull                     SAGE-Var SMC Full Catalog
sdwfs_ch1_stack                 SDWFS Aug'09 DR1.1 IRAC 3.6um-Selected Total Coadd Stack
cosmos_xgroups                  COSMOS X-ray Group Catalog
mipslg                          MIPS Local Galaxies Catalog
ercsc_f143_e                    Planck ERCSC 143GHz Catalog
a1763t3                         Abell 1763 MIPS 70 micron Catalog
a1763t2                         Abell 1763 Source Catalog
ptfphotcalcat                   PTF Photometric Calibrator Catalog
servsesi12                      SERVS ELAIS S1 2-band Catalog (highly reliable)
sage_ar_irac                    SAGE IRAC Single Frame + Mosaic Photometry Archive (more complete, less reliable)
wise_allwise_p3as_cdd           AllWISE Atlas Metadata Table
elaisn2_160_cat_s05             SWIRE ELAIS N2 Region 160um Spring '05 Spitzer Catalog
com_pccs1_030                   Planck PCCS 30GHz Catalog
sagesmc_iraccdr3                SAGE-SMC IRAC Single Frame + Mosaic Photometry Catalog v1.5
comsight                        IRAS Asteroid and Comet Survey
neowiser_p1bl_lod               NEOWISE-R Single Exposure (L1b) Scan Inventory Table
irasgal                         IRAS Cataloged Galaxies and Quasars
spuds_irac                      SpUDS IRAC Catalog
wise_allsky_3band_p1bl_lod      WISE 3-Band Cryo Single Exposure (L1b) Scan Inventory Table
simple                          SIMPLE Photometry Catalog
xfls_i1v                        Extragalactic FLS IRAC Channel 1 Verification Field Catalog
com_pccs1_143                   Planck PCCS 143GHz Catalog
xfls_i1m                        Extragalactic FLS IRAC Channel 1 Main Field Catalog
dr4_trans1_full                 C2D Fall '07 Perseus Epoch 1 Transient Sources FULL Catalog
servsxmmi12                     SERVS XMM-LSS 2-band Catalog (highly reliable)
wise_allsky_4band_p1bl_lod      WISE All-Sky Single Exposure (L1b) Scan Inventory Table
cosmos_phot                     COSMOS Photometry Catalog January 2006
elaisn1_24_cat_s05              SWIRE ELAIS N1 Region 24um Spring '05 Spitzer Catalog
sdwfs_ch4_epoch1                SDWFS Aug '09 DR1.1 IRAC 8.0um-Selected 3x30sec Coadd, epoch 1 (Jan '04)
velcarc                         Vela-Carina Catalog (highly reliable)
glimpse2ep2mra09                GLIMPSE II Epoch 2 November '09 More Reliable Archive (more reliable)
wise_allsky_4band_p3am_xrf      WISE All-Sky Frame Cross-Reference Table
taurus_2008_2_1                 Taurus Catalog October 2008 v2.1
denis3                          DENIS 3rd Release (Sep. 2005)
goodsn_mips24                   GOODS-N MIPS 24 micron Photometry Catalog
ercsc_f100_e                    Planck ERCSC 100GHz Catalog
sdwfs_ch4_epoch4                SDWFS Aug '09 DR1.1 IRAC 8.0um-Selected 3x30sec Coadd, epoch 4 (Mar '08)
ext_src_c                       2MASS Calibration Extended Source Working Database
wise_allsky_4band_p3as_cdd      WISE All-Sky Atlas Metadata Table
xmm_cat_s05                     SWIRE XMM_LSS Region Spring '05 Spitzer Catalog
sage_cat_irac                   SAGE IRAC Single Frame + Mosaic Photometry Catalog  (more reliable)
com_pccs1_sz_pws                Planck Sunyaev-Zeldovich Cluster PwS List
sdwfs_ch3_epoch2                SDWFS Aug '09 DR1.1 IRAC 5.8um-Selected 3x30sec Coadd, epoch 2 (Aug '07)
sdwfs_ch3_epoch3                SDWFS Aug '09 DR1.1 IRAC 5.8um-Selected 3x30sec Coadd, epoch 3 (Feb '08)
sdwfs_ch3_epoch1                SDWFS Aug '09 DR1.1 IRAC 5.8um-Selected 3x30sec Coadd, epoch 1 (Jan '04)
sagesmc_iracadr3                SAGE-SMC IRAC Single Frame + Mosaic Photometry Archive v1.5
sdwfs_ch3_epoch4                SDWFS Aug '09 DR1.1 IRAC 5.8um-Selected 3x30sec Coadd, epoch 4 (Mar '08)
prelim_2band_p1bm_frm           WISE Preliminary Post-Cryo Single Exposure (L1b) Image Inventory Table (Superseded)
lockman_24_cat_s05              SWIRE Lockman Region 24um Spring '05 Spitzer Catalog
escf_info                       2MASS LMC/SMC Calibration Merged Extended Source Information Table
glimpse2ep1c08                  GLIMPSE II Epoch 1 December '08 Catalog (highly reliable)
prelim_p1ba_mch                 WISE Preliminary Release Known Solar System Object Possible Association List ( Caution , Superseded)
xfls_kpno                       Extragalactic FLS KPNO R-band Source List
iraspsc                         IRAS Point Source Catalog v2.1 (PSC)
pep500                          PEP SPIRE 500 micron Catalog
wsdb_info                       2MASS Survey Merged Point Source Information Table
keys                            Available Keys at NASA/IPAC Infrared Science Archive
sdwfs_ch3_stack                 SDWFS Aug '09 DR1.1 IRAC 5.8um-Selected Total Coadd Stack
servseni12                      SERVS ELAIS N1 2-band Catalog (highly reliable)
glimpse_s07_ar                  GLIMPSE I Spring '07 Archive (more complete, less reliable)
msxc6                           The Midcourse Space Experiment (MSXC6)
pscan_dat_c                     2MASS Calibration Scan Info
prelim_p3am_cdd                 WISE Preliminary Release Atlas Image Inventory Table (Superseded)
cosmos_morph_zurich_1           COSMOS Zurich Structure and Morphology Catalog v1.0
wise_allsky_4band_p3as_psr      WISE All-Sky Reject Table
com_pccs1_100                   Planck PCCS 100GHz Catalog
wise_allsky_4band_p3as_psd      WISE All-Sky Source Catalog
pt_src_cat1                     2MASS First Incremental Release Point Source Catalog (PSC)
scf_link                        2MASS LMC/SMC Calibration Merged Point Source Link Table
heritages100                    HERITAGE SMC PACS 100 micron Catalog
tables                          Available tables at NASA/IPAC Infrared Science Archive
prelim_p1bs_psd                 WISE Preliminary Release Single Exposure (L1b) Source Table (Superseded)
coadd_dat_c                     2MASS Calibration Atlas Image Info
pt_src_c                        2MASS Calibration Point Source Working Database
cosmos_morph_cassata_1_1        COSMOS Cassata Morphology Catalog v1.1
glimpse2_v2cat                  GLIMPSE II Spring '08 Catalog (highly reliable)
dr4_trans2_full                 C2D Fall '07 Perseus Epoch 2 Transient Sources FULL Catalog
dr4_off_cloud_ysoc              C2D Fall '07 candidate Young Stellar Objects (YSO) OFF-CLOUD Catalog (CHA_II, LUP, OPH, PER, SER)
cosmos_vla_deep_may2010         COSMOS VLA Deep Catalog May 2010
cygx_arch                       Cygnus-X Archive
sixxf_link                      2MASS 6X w/LMC/SMC Merged Point Source Link Table
wise_allsky_2band_p1bs_frm      WISE Post-Cryo Single Exposure (L1b) Frame Metadata Table
wsdb_link                       2MASS Survey Merged Point Source Link Table
cosmos_morph_tasca_1_1          COSMOS Tasca Morphology Catalog v1.1
glimpse2_v2arc                  GLIMPSE II Spring '08 Archive (more complete, less reliable)
astsight                        IRAS Minor Planet Survey
glimpse3dep2a                   GLIMPSE 3D Epoch 2 Archive (more complete, less reliable)
wise_allsky_2band_p1bl_lod      WISE Post-Cryo Single Exposure (L1b) Scan Inventory Table
deepglimpsea                    Deep GLIMPSE Archive (more complete, less reliable)
goods_mips24                    GOODS-S MIPS 24 micron Photometry Catalog
esixxf_info                     2MASS 6X w/LMC/SMC Merged Extended Source Information Table
cf_link                         2MASS Calibration Merged Point Source Link Table
dr4_off_cloud_hrel              C2D Fall '07 High Reliability (HREL) OFF-CLOUD Catalog (CHA_II, LUP, OPH, PER, SER)
servslhi1                       SERVS Lockman Hole 3.6 micron Catalog
dunes                           DUNES Catalog
esz                             Planck Early Sunyaev-Zeldovich Cluster List (ESZ)
xfls_iallv                      Extragalactic FLS IRAC Bandmerged Verification Field Catalog
servslhi2                       SERVS Lockman Hole 4.5 micron Catalog
xfls_iallm                      Extragalactic FLS IRAC Bandmerged Main Field Catalog
glimpse3d_v1cat_tbl             GLIMPSE 3D, 2007-2009 Catalog (highly reliable)
dr4_clouds_full                 C2D Fall '07 Full CLOUDS Catalog (CHA_II, LUP, OPH, PER, SER)
ucac4_sources                   USNO CCD Astrograph Catalog (UCAC4)
prelim_2band_p1bs_psd           WISE Preliminary Post-Cryo Single Exposure (L1b)  Source Table (Superseded)
xfls_i4m                        Extragalactic FLS IRAC Channel 4 Main Field Catalog
ecf_link                        2MASS Calibration Merged Extended Source Link Table
scosmos_mips_160_v3             S-COSMOS MIPS 160um Photometry Catalog v3 Jan 2009
akari_fis                       Akari/FIS Bright Source Catalogue
xfls_i4v                        Extragalactic FLS IRAC Channel 4 Verification Field Catalog
com_pccs1_545                   Planck PCCS 545GHz Catalog
sage_cat_m70                    SAGE MIPS 70 um Combined Epoch Catalog (more reliable)
pep160                          PEP PACS 160 micron Catalog
com_pccs1_sz_mmf3               Planck Sunyaev-Zeldovich Cluster MMF3 List
com_pccs1_sz_mmf1               Planck Sunyaev-Zeldovich Cluster MMF1 List
wise_allsky_4band_p3al_lod      WISE All-Sky Atlas Inventory Table
fls_release_v2_mmt_spectra      FLS MMT/Hectospec Spectroscopic Catalog (V2)
sage_full_m24                   SAGE MIPS 24 um Epoch 1 and Epoch 2 Full List (more complete, less reliable)
exts_samp_cat                   2MASS Sampler Extended Source Catalog (XSC)
velcara                         Vela-Carina Archive (more complete, less reliable)
fp_coadd_dat                    2MASS All-Sky Survey Atlas Image Info
coadd_dat                       2MASS Survey Atlas Image Info
elaiss1_160_cat_f05             SWIRE ELAIS S1 Region 160um Fall '05 Spitzer Catalog
ext_src_rej                     2MASS Survey Extended Source Reject Table
dr4_MM                          C2D Fall '07 Millimeter (MM) Sources Catalog (OPH, PER, SER Clouds)
iraspscr                        IRAS Point Source Catalog Rejects
iraspscw                        IRAS PSC joined with WSDB
iraspsch                        IRAS PSC joined with HCON and WSDB
dustingsgsc                     DUSTiNGS Good Source Catalog
iras_ao                         IRAS Additional Observations (AO) Catalog
musyc_phot                      MUSYC Photometry Catalog
neowiser_p1bs_frm               NEOWISE-R Single Exposure (L1b) Frame Metadata Table
sltracev2                       SEIP Traceback Table
ecf_info                        2MASS Calibration Merged Extended Source Information Table
deepcal_src                     2MASS Combined  Calibration Field Source Table
ext_src_cat                     2MASS Second Incremental Release Extended Source Catalog (XSC)
usno_b1                         USNO-B1 (United States Naval Observatory B1.0 Catalog)
wise_allsky_4band_p1ba_mch      WISE All-Sky Known Solar System Object Possible Association List ( Caution )
sage_ar_irac_match              SAGE IRAC Matched Epoch Catalog (more complete, less reliable)
prelim_p3as_psd                 WISE Preliminary Release Source Catalog (Superseded)
servslhi12                      SERVS Lockman Hole 2-band Catalog (highly reliable)
prelim_2band_p1ba_mch           WISE Preliminary Post-Cryo Solar System Object Possible Association List ( Caution , Superseded)
prelim_p3as_cdd                 WISE Preliminary Release Atlas Metadata Table (Superseded)
heritagel500                    HERITAGE LMC SPIRE 500 micron Catalog
ercsc_f044_e                    Planck ERCSC 44GHz Catalog
glimpse360a                     GLIMPSE360 Archive (more complete, less reliable)
glimpse360c                     GLIMPSE360 Catalog (highly reliable)
pt_src_sc                       2MASS LMC/SMC Calibration Point Source Working Database
irasfscr                        IRAS Faint Source Catalog Rejects
wise_allsky_2band_p1ba_mch      WISE Post-Cryo Single Exposure (L1b)  Known SSO Possible Association List ( Caution )
cosmos327                       COSMOS VLA 327 MHz Catalog
deepglimpsec                    Deep GLIMPSE Catalog (highly reliable)
elaisn1_cat_s05                 SWIRE ELAIS N1 Region Spring '05 Spitzer Catalog
wise_allsky_2band_p1bm_frm      WISE Post-Cryo Single Exposure (L1b) Image Inventory Table
pt_src_6x2                      2MASS 6X w/LMC/SMC Point Source Working Database /Catalog ( Read Me! )
xfls_w4                         Extragalactic FLS WIYN/Hydra Line Ratios and Extinction Catalog
xfls_w2                         Extragalactic FLS WIYN/Hydra Spectroscopic Catalog
xfls_w3                         Extragalactic FLS WIYN/Hydra Line Strength and Equivalent Width Catalog

In [3]:
#Now lets see how to query using this module
help(Irsa)
Help on IrsaClass in module astroquery.irsa.core object:

class IrsaClass(astroquery.query.BaseQuery)
 |  Method resolution order:
 |      IrsaClass
 |      astroquery.query.BaseQuery
 |      __builtin__.object
 |  
 |  Methods defined here:
 |  
 |  list_catalogs(self)
 |      Return a dictionary of the catalogs in the IRSA Gator tool.
 |      
 |      Returns
 |      -------
 |      catalogs : dict
 |          A dictionary of catalogs where the key indicates the catalog name to
 |          be used in query functions, and the value is the verbose description
 |          of the catalog.
 |  
 |  print_catalogs(self)
 |      Display a table of the catalogs in the IRSA Gator tool.
 |  
 |  query_region(self, coordinates=None, catalog=None, spatial='Cone', radius=<Quantity 10.0 arcsec>, width=None, polygon=None, get_query_payload=False, verbose=False)
 |      This function can be used to perform either cone, box, polygon or
 |      all-sky search in the catalogs hosted by the NASA/IPAC Infrared
 |      Science Archive (IRSA).
 |      
 |      Parameters
 |      ----------
 |      coordinates : str, `astropy.coordinates` object
 |          Gives the position of the center of the cone or box if
 |          performing a cone or box search. The string can give coordinates
 |          in various coordinate systems, or the name of a source that will
 |          be resolved on the server (see `here
 |          <http://irsa.ipac.caltech.edu/search_help.html>`_ for more
 |          details). Required if spatial is ``'Cone'`` or ``'Box'``. Optional
 |          if spatial is ``'Polygon'``.
 |      catalog : str
 |          The catalog to be used (see the *Notes* section below).
 |      spatial : str
 |          Type of spatial query: ``'Cone'``, ``'Box'``, ``'Polygon'``, and
 |          ``'All-Sky'``. If missing then defaults to ``'Cone'``.
 |      radius : str or `~astropy.units.Quantity` object, [optional for spatial is ``'Cone'``]
 |          The string must be parsable by `~astropy.coordinates.Angle`. The
 |          appropriate `~astropy.units.Quantity` object from
 |          `astropy.units` may also be used. Defaults to 10 arcsec.
 |      width : str, `~astropy.units.Quantity` object [Required for spatial is ``'Polygon'``.]
 |      
 |          The string must be parsable by `~astropy.coordinates.Angle`. The
 |          appropriate `~astropy.units.Quantity` object from `astropy.units`
 |          may also be used.
 |      polygon : list, [Required for spatial is ``'Polygon'``]
 |          A list of ``(ra, dec)`` pairs (as tuples), in decimal degrees,
 |          outlinining the polygon to search in. It can also be a list of
 |          `astropy.coordinates` object or strings that can be parsed by
 |          `astropy.coordinates.ICRS`.
 |      get_query_payload : bool, optional
 |          If `True` then returns the dictionary sent as the HTTP request.
 |          Defaults to `False`.
 |      verbose : bool, optional.
 |          If `True` then displays warnings when the returned VOTable does not
 |          conform to the standard. Defaults to `False`.
 |      
 |      Returns
 |      -------
 |      table : `~astropy.table.Table`
 |          A table containing the results of the query
 |  
 |  query_region_async(self, coordinates=None, catalog=None, spatial='Cone', radius=<Quantity 10.0 arcsec>, width=None, polygon=None, get_query_payload=False)
 |      This function serves the same purpose as
 |      :meth:`~astroquery.irsa.IrsaClass.query_region`, but returns the raw
 |      HTTP response rather than the results in a `~astropy.table.Table`.
 |      
 |      Parameters
 |      ----------
 |      coordinates : str, `astropy.coordinates` object
 |          Gives the position of the center of the cone or box if
 |          performing a cone or box search. The string can give coordinates
 |          in various coordinate systems, or the name of a source that will
 |          be resolved on the server (see `here
 |          <http://irsa.ipac.caltech.edu/search_help.html>`_ for more
 |          details). Required if spatial is ``'Cone'`` or ``'Box'``. Optional
 |          if spatial is ``'Polygon'``.
 |      catalog : str
 |          The catalog to be used (see the *Notes* section below).
 |      spatial : str
 |          Type of spatial query: ``'Cone'``, ``'Box'``, ``'Polygon'``, and
 |          ``'All-Sky'``. If missing then defaults to ``'Cone'``.
 |      radius : str or `~astropy.units.Quantity` object, [optional for spatial is ``'Cone'``]
 |          The string must be parsable by `~astropy.coordinates.Angle`. The
 |          appropriate `~astropy.units.Quantity` object from
 |          `astropy.units` may also be used. Defaults to 10 arcsec.
 |      width : str, `~astropy.units.Quantity` object [Required for spatial is ``'Polygon'``.]
 |          The string must be parsable by `~astropy.coordinates.Angle`. The
 |          appropriate `~astropy.units.Quantity` object from `astropy.units`
 |          may also be used.
 |      polygon : list, [Required for spatial is ``'Polygon'``]
 |          A list of ``(ra, dec)`` pairs (as tuples), in decimal degrees,
 |          outlinining the polygon to search in. It can also be a list of
 |          `astropy.coordinates` object or strings that can be parsed by
 |          `astropy.coordinates.ICRS`.
 |      get_query_payload : bool, optional
 |          If `True` then returns the dictionary sent as the HTTP request.
 |          Defaults to `False`.
 |      
 |      Returns
 |      -------
 |      response : `requests.Response`
 |          The HTTP response returned from the service
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |  
 |  GATOR_LIST_URL = u'http://irsa.ipac.caltech.edu/cgi-bin/Gator/nph-scan...
 |  
 |  IRSA_URL = u'http://irsa.ipac.caltech.edu/cgi-bin/Gator/nph-query'
 |  
 |  ROW_LIMIT = 500
 |  
 |  TIMEOUT = 60
 |  
 |  __abstractmethods__ = frozenset([])
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from astroquery.query.BaseQuery:
 |  
 |  __call__(self, *args, **kwargs)
 |      init a fresh copy of self
 |  
 |  __init__(self)
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from astroquery.query.BaseQuery:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)


In [4]:
#Alright we are being statisically so lets go All-Sky for the survey
#Notice the row limite of 500, let us change that
Irsa.ROW_LIMIT = 1000 
table = Irsa.query_region(spatial="All-Sky",catalog='xfls_w3')
In [5]:
#Now let us see what we retrieved
print(table)
print(table.colnames)
idnumber  field   apid     ra   ...     sii_flux2           sii_ew2        id
                          deg   ...     1e-17 cgs           angstrom         
-------- ------- ------ ------- ... ------------------ ------------------ ---
     343 FLS1b03 APID16 257.824 ...                 --                 --   0
     344 FLS1b03 APID17 258.410 ...                 --                 --   1
     345 FLS1b03 APID18 257.931 ...                 --                 --   2
     346 FLS1b03 APID19 257.993 ...                 --                 --   3
     347 FLS1b03 APID20 258.641 ...                 --                 --   4
     348 FLS1b03 APID21 258.971 ...                 --                 --   5
     349 FLS1b03 APID22 257.689 ...                 --                 --   6
     350 FLS1b03 APID23 258.954 ...                 --                 --   7
     351 FLS1b03 APID24 257.977 ... 16.600000000000001 127.23999999999999   8
     352 FLS1b03 APID25 257.991 ...                 --                 --   9
     ...     ...    ...     ... ...                ...                ... ...
     333 FLS1b03 APID06 258.403 ... 7.7999999999999998 8.5899999999999999 762
     334 FLS1b03 APID07 257.990 ...                 --                 -- 763
     335 FLS1b03 APID08 258.407 ...                 --                 -- 764
     336 FLS1b03 APID09 258.969 ...                 --                 -- 765
     337 FLS1b03 APID10 258.656 ...                 --                 -- 766
     338 FLS1b03 APID11 258.204 ...                 --                 -- 767
     339 FLS1b03 APID12 259.114 ...                 --                 -- 768
     340 FLS1b03 APID13 258.447 ...                 --                 -- 769
     341 FLS1b03 APID14 258.549 ...                 --                 -- 770
     342 FLS1b03 APID15 258.308 ...                 --                 -- 771
Length = 772 rows
['idnumber', 'field', 'apid', 'ra', 'dec', 'clon', 'clat', 'ciii_flux', 'ciii_ew', 'mgii_flux', 'mgii_ew', 'hb_flux', 'hb_ew', 'oiii_flux', 'oiii_ew', 'ha_flux', 'ha_ew', 'nii_flux', 'nii_ew', 'sii_flux1', 'sii_ew1', 'sii_flux2', 'sii_ew2', 'id']

In [6]:
#Now people use the Halpha to Hbeta ratio to determine extinction along the line of sight
#Assuming a standard extinction law and case B recombination from Osterbrock 1989 (diffuse ISM case)
#Av = (log(fHalpha/fHbeta)-log(2.86))*(5./2.)*3.0/1.25
#Where 3.0 is R and -1.25 is k(Halpha)-k(Hbeta)
table['Av'] = (np.log10(table['ha_flux']/table['hb_flux'])-np.log10(2.86))*(5./2.)*3.0/1.25
/wandajune_home/jakub/PYTHON/loopy/lib/python2.7/site-packages/numpy/ma/core.py:790: RuntimeWarning: invalid value encountered in greater_equal
  return umath.absolute(a) * self.tolerance >= umath.absolute(b)
/wandajune_home/jakub/PYTHON/loopy/lib/python2.7/site-packages/numpy/ma/core.py:802: RuntimeWarning: invalid value encountered in less_equal
  return umath.less_equal(x, self.critical_value)

In [7]:
#Now check we have some reasonable Extinction numbers
print(table['Av'])
      Av      
--------------
            --
            --
            --
            --
            --
            --
            --
            --
            --
            --
           ...
            --
0.105639099466
            --
            --
            --
            --
            --
            --
            --
            --
            --
Length = 772 rows

In [8]:
#But wait this survey already has extinction values. Lets check and see if we recovered the values
exttable = Irsa.query_region(spatial="All-Sky",catalog='xfls_w4')
In [9]:
print(exttable.colnames)
print(exttable)
print(exttable['av'])
['idnumber', 'field', 'apid', 'ra', 'dec', 'clon', 'clat', 'balmer_dcr', 'ebv', 'av', 'log_ha', 'log_radio', 'log_mips', 'sfr_ha', 'sfr_radio', 'ratio_1', 'ratio_2', 'ratio_3', 'id']
idnumber  field   apid  ...        ratio_2              ratio_3         id
                        ...                                               
-------- ------- ------ ... --------------------- -------------------- ---
     433 FLS2a03 APID48 ...                    --                   --   0
     434 FLS2a03 APID49 ...                    --                   --   1
     435 FLS2a03 APID51 ...                    --                   --   2
     436 FLS2a03 APID52 ...                    --                   --   3
     437 FLS2a03 APID53 ...                    --                   --   4
     438 FLS2a03 APID54 ...  -0.26000000000000001                   --   5
     439 FLS2a03 APID55 ...                    --                   --   6
     440 FLS2a03 APID56 ...  -0.35999999999999999 -0.58999999999999997   7
     441 FLS2a03 APID58 ...                    --                   --   8
     442 FLS2a03 APID61 ...  -0.64000000000000001                   --   9
     ...     ...    ... ...                   ...                  ... ...
      91 FLS1c02 APID05 ...                 -0.11                   -- 762
      92 FLS1c02 APID06 ...                    --                   -- 763
      93 FLS1c02 APID07 ...  -0.40999999999999998                   -- 764
      94 FLS1c02 APID08 ... -0.050000000000000003                   -- 765
      95 FLS1c02 APID09 ...                    --                   -- 766
      96 FLS1c02 APID10 ...  -0.54000000000000004                   -- 767
      97 FLS1c02 APID11 ...                    --                   -- 768
      98 FLS1c02 APID12 ...                    --                   -- 769
      99 FLS1c02 APID13 ...  -0.67000000000000004 -0.33000000000000002 770
     100 FLS1c02 APID14 ...                    --                   -- 771
Length = 772 rows
         av         
        mag         
--------------------
                  --
                  --
                  --
                  --
                  --
                1.26
                  --
0.059999999999999998
                  --
 0.85999999999999999
                 ...
                1.26
  1.3200000000000001
                2.21
                1.26
                  --
 0.93999999999999995
                  --
                1.26
 0.20999999999999999
                  --
Length = 772 rows

In [10]:
#Notice the APID values are not in the same order!!!
#We cannot simply subtract the two Av rows
#But we can use other useful python routines
from astropy.table import join
In [11]:
#Now let us join the two tables into one big table
#keeping only data which is in both tables 
#combine on data with the same apid, field, AND idnumber
bigtable = join(table,exttable,join_type='inner',keys=['apid','field','idnumber'])
print(bigtable)
idnumber  field   apid  ...        ratio_2              ratio_3        id_2
                        ...                                                
-------- ------- ------ ... --------------------- -------------------- ----
      61 FLS1b02 APID00 ...                    --                   --  732
     141 FLS2a02 APID00 ...                    --                   --  424
     171 FLS2b02 APID00 ...  -0.55000000000000004                   --  454
     222 FLS2c02 APID00 ...                    --                   --  621
       1 FLS1a02 APID01 ...                    --                   --  483
     275 FLS1a03 APID01 ...                    --                   --  674
      62 FLS1b02 APID01 ...                    --                   --  733
     328 FLS1b03 APID01 ...                    --                   --  494
     705 FLS1b05 APID01 ...                 -0.19                   --  272
      87 FLS1c02 APID01 ...                    --                   --  758
     ...     ...    ... ...                   ...                  ...  ...
     636 FLS2d03 APID81 ...                    --                   --  203
     701 FLS1a05 APID82 ... -0.080000000000000002                   --  268
     771 FLS1b05 APID82 ...                    --                   --  338
     637 FLS2d03 APID82 ...                    --                   --  204
     702 FLS1a05 APID83 ...                    --                   --  269
     772 FLS1b05 APID83 ...  -0.53000000000000003                   --  339
     638 FLS2d03 APID83 ...                    --                   --  205
     703 FLS1a05 APID84 ...                 -0.38 -0.68999999999999995  270
     639 FLS2d03 APID84 ...                    --                   --  206
     704 FLS1a05 APID85 ...                    --                   --  271
Length = 772 rows

In [12]:
#Now let us test our derieved Avs
fig, ax = plt.subplots()
ax.scatter(bigtable['av'],bigtable['Av']-bigtable['av'],color='black')
ax.set_xlabel("Table Av")
ax.set_ylabel(r"$\delta$Av (Cal-Table)")
Out[12]:
<matplotlib.text.Text at 0x7f744acd2cd0>
In [13]:
#Hmmmm looks like I assumed a different extinction law
#This is where one would go check the literature and see how they derieved their extinction law 
#and we see from Marleau et al. 2006 they derieve extinction to a given line by 
#E(B-V)gas = 2.5/[k(Halpha)-k(Hbeta)]*(log(F(Halpha)/F(Hbeta))-log(2.87))
#Then the reddening curve from Calzetti 2001 was adopted that A(lambda)=E(B-V)gas*k(lambda)
def k_return(lam):
    if ((lam >= 6300.) & (lam < 22000.)):
        k = 1.17*(-1.857+1.040/(lam/10000.))+1.78
    if ((lam >= 1200.) & (lam < 6300.)):
        k = 1.17*(-2.156+1.509/(lam/10000.)-.198/(lam/10000.)**2.+.011/(lam/10000.)**3.)+1.78
    return k
def line_ext(k,ebv):
    alam = ebv*k
    return alam
In [14]:
#Calculate values for H alpha
kha = k_return(6563.)
print(kha)
extha = line_ext(kha,bigtable['ebv'])
print(extha)
1.46134016913
     ebv      
--------------
  1.0083247167
            --
0.511469059195
            --
            --
            --
            --
            --
  1.0083247167
            --
           ...
  1.0083247167
            --
  1.0083247167
            --
            --
  1.0083247167
0.306881435517
            --
  1.0083247167
            --
  1.0083247167
Length = 772 rows

In [15]:
#Now if redding is properly accounted for we can seperate the sources into AGN and HII regions
#First we need to correct for reddening of all lines
wav_line = {}
wav_line['oiii'] = 5007.
wav_line['hb'] = 4861.
wav_line['nii'] = 6583.
wav_line['ha'] = 6563.
wav_line['sii_1'] = 6716.
wav_line['sii_2'] = 6731.

for i in wav_line.keys():
    k = k_return(wav_line[i])
    ext = line_ext(k,bigtable['ebv'])
    tablecall = i+'_flux'
    if i[:3] == 'sii':
        tablecall = i.replace('_','_flux')
    print(i,k)
    bigtable['a_flux_'+i] = 10.**(ext/2.5)*bigtable[tablecall]
('oiii', 1.9620813567020472)
('nii', 1.455707387209479)
('sii_1', 1.4191027337701014)
('sii_2', 1.4150651626801367)
('hb', 2.021165705306191)
('ha', 1.4613401691299712)

In [16]:
print(bigtable['a_flux_nii'][bigtable['a_flux_nii'].mask == False])
  a_flux_nii 
-------------
27.8194335311
190.928657284
314.186819397
294.085620071
282.942462953
50.2133793309
59.5233330504
123.003654809
103.460308627
59.7755505633
          ...
49.9390675592
376.635692513
272.899348985
452.226000675
678.969544795
421.776124999
431.796382128
327.882766803
241.876594895
85.4750050566
402.791368142
Length = 231 rows

In [17]:
#Use a function that seperates galaxies from AGN  (Keweley et al. 2001)
def agn_nii(xnii):
    out = .61/(xnii-.47)+1.19
    return out
def agn_sii(xsii):
    out =(.72)/(xsii-.32)+1.30
    return out

#add tick marks to plots
def fancy_plot(ax):
    #Turn minor ticks on
    ax.minorticks_on()
    #set the width of the ticks
    ax.tick_params(which='both',width=1)
    #set the length of the major ticks
    ax.tick_params(which='major',length=7)
    #set length of the minor ticks
    ax.tick_params(which='minor',length=3)
In [21]:
#Now lets make the plots
#The Y axis will be the same so why not combine the two on the Y-axis to make the plot more compact


fig,ax = plt.subplots(ncols=2,sharey=True,figsize=(10.5,5.5))
fig.subplots_adjust(wspace=.001)


agnfindnii, = np.where(agn_nii(np.log10((bigtable['a_flux_nii']/bigtable['a_flux_ha'])))-
                      np.log10((bigtable['a_flux_oiii']/bigtable['a_flux_hb'])) < 0.)
agnfindsii, = np.where(agn_sii(np.log10(((bigtable['a_flux_sii_1']+bigtable['a_flux_sii_2'])/bigtable['a_flux_ha'])))-
                      np.log10((bigtable['a_flux_oiii']/bigtable['a_flux_hb'])) < 0.)
bigtable['color'] = 'black'
bigtable['color'][agnfindsii] = 'teal'
bigtable['color'][agnfindnii] = 'red'

#You need to tell the color array which cells are being masked because matplotlib doesn't know this by default
#A strange quark but it can lead you on quite the run around if you don't notice this
usenii =  ((bigtable['a_flux_nii'].mask == False) & (bigtable['a_flux_nii'].mask == False) 
          & (bigtable['a_flux_oiii'].mask == False) & (bigtable['a_flux_hb'].mask == False))

usesii =  ((bigtable['a_flux_nii'].mask == False) & (bigtable['a_flux_sii_1'].mask == False) &
          (bigtable['a_flux_sii_2'].mask == False)
          & (bigtable['a_flux_oiii'].mask == False) & (bigtable['a_flux_hb'].mask == False))

ax[0].scatter(np.log10((bigtable['a_flux_nii']/bigtable['a_flux_ha'])),
              np.log10((bigtable['a_flux_oiii']/bigtable['a_flux_hb'])),color=bigtable['color'][usenii])
ax[1].scatter(np.log10(((bigtable['a_flux_sii_1']+bigtable['a_flux_sii_2'])/bigtable['a_flux_ha'])),
              np.log10((bigtable['a_flux_oiii']/bigtable['a_flux_hb'])),color=bigtable['color'][usesii])

#plot a line that seperate the galaxies from AGN (Keweley et al. 2001)
xnii = np.linspace(ax[0].get_xlim()[0],ax[0].get_xlim()[1],20)
ax[0].plot(xnii,agn_nii(xnii),'--',color='black')
#shorted the plot back up
ax[0].set_xlim([xnii[0],xnii[-1]])

#plot a line that seperate the galaxies from AGN (Keweley et al. 2001)
xsii = np.linspace(ax[1].get_xlim()[0],ax[1].get_xlim()[1],20)
ax[1].plot(xsii,agn_sii(xsii),'--',color='black')
#shorted the plot back up
ax[1].set_xlim([xsii[0],xsii[-1]])


ax[0].set_ylabel(r'log($[$OIII$]$/H$\beta$)',fontsize=18)
ax[0].set_xlabel(r'log($[$NII$]$/H$\alpha$)',fontsize=18)
ax[1].set_xlabel(r'log($[$SII$]$/H$\alpha$)',fontsize=18)
fancy_plot(ax[0])
fancy_plot(ax[1])
In [23]:
#Now just out of curiousity lets check wheather points not determined to be AGN
#by one diagnostic affect results depending on their inclusion in the data
agnfindnii = (agn_nii(np.log10((bigtable['a_flux_nii']/bigtable['a_flux_ha'])))-
                      np.log10((bigtable['a_flux_oiii']/bigtable['a_flux_hb'])) > 0.)
agnfindsii = (agn_sii(np.log10(((bigtable['a_flux_sii_1']+bigtable['a_flux_sii_2'])/bigtable['a_flux_ha'])))-
                      np.log10((bigtable['a_flux_oiii']/bigtable['a_flux_hb'])) > 0.)
hamask = (bigtable['sfr_ha'].mask == False)
rigreject, = np.where((agnfindnii) & (agnfindsii) & (usenii) & (usesii) & (hamask))
niireject, = np.where((agnfindnii) & (usenii) & (hamask))

fig,ax = plt.subplots()

niival = np.sort(bigtable['sfr_ha'][niireject])
niisize = niireject.size
xnii = np.arange(1.,float(niisize)+1.)/float(niisize)

rigval = np.sort(bigtable['sfr_ha'][rigreject])
rigsize = rigreject.size
xrig = np.arange(1.,float(rigsize)+1.)/float(rigsize)
print("Number of NII/Halpha Galaxlies")
print(niisize)
print("Number of NII and SII /Halpha Galaxies")
print(rigsize)

ax.plot(rigval,xrig,color='red')
ax.plot(niival,xnii,color='blue')
ax.set_xlabel(r'SFR (M$_\odot$/yr)',fontsize=18)
ax.set_ylabel(r'Cumulative Fraction',fontsize=18)

print('Max Seperation, Probability' )
print(stat.ks_2samp(bigtable['sfr_ha'][niireject],bigtable['sfr_ha'][rigreject]))
Number of NII/Halpha Galaxlies
75
Number of NII and SII /Halpha Galaxies
36
Max Seperation, Probability
(0.071111111111111125, 0.999466955831673)

In [24]:
#So after starting with ~700 data points we now have only between 36-75 good galaxy data points
#We then compared the two distribution of two different quality cuts and found the distribution of starformation
#rates to be not dissimilar 
#Of course this is not a great real analysis but it does show the concept