Affiliated Package: Astroquery

Astroquery is an Astropy-affiliated package that contains a collection of tools to access online Astronomical data. To install it, do:

pip install astroquery

The following modules have been completed using a common API:

  • SIMBAD Queries (astroquery.simbad)
  • VizieR Queries (astroquery.vizier)
  • IRSA Dust Extinction Service Queries (astroquery.irsa_dust)
  • NED Queries (astroquery.ned)
  • Splatalogue Queries (astroquery.splatalogue)
  • IRSA Queries (astroquery.irsa)
  • UKIDSS Queries (astroquery.ukidss)
  • MAGPIS Queries (astroquery.magpis)
  • NRAO Queries (astroquery.nrao)
  • Besancon Queries (astroquery.besancon)
  • NIST Queries (astroquery.nist)
  • NVAS Queries (astroquery.nvas)
  • GAMA Queries (astroquery.gama)
  • ESO Queries (astroquery.eso)
  • xMatch Queries (astroquery.xmatch)
  • Atomic Line List (astroquery.atomic)
  • ALMA Queries (astroquery.alma)
  • Skyview Queries (astroquery.skyview)
  • NASA ADS Queries (astroquery.nasa_ads)
  • HEASARC Queries (astroquery.heasarc)

These others are functional, but do not follow a common & consistent API:

  • Fermi Queries (astroquery.fermi)
  • SDSS Queries (astroquery.sdss)
  • ALFALFA Queries (astroquery.alfalfa)
  • Spitzer Heritage Archive (astroquery.sha)
  • LAMDA Queries (astroquery.lamda)
  • OGLE Queries (astroquery.ogle)
  • Open Exoplanet Catalogue(astroquery.open_exoplanet_catalogue)
  • CosmoSim Queries (astroquery.cosmosim)

SIMBAD

As an example, let's run a SIMBAD query:

In [1]:
from astropy import units as u
from astroquery.simbad import Simbad
In [2]:
r = Simbad.query_region('m42', radius=3. * u.arcmin)
In [3]:
r.colnames
Out[3]:
['MAIN_ID',
 'RA',
 'DEC',
 'RA_PREC',
 'DEC_PREC',
 'COO_ERR_MAJA',
 'COO_ERR_MINA',
 'COO_ERR_ANGLE',
 'COO_QUAL',
 'COO_WAVELENGTH',
 'COO_BIBCODE']
In [4]:
r
Out[4]:
<Table masked=True length=2246>
MAIN_IDRADECRA_PRECDEC_PRECCOO_ERR_MAJACOO_ERR_MINACOO_ERR_ANGLECOO_QUALCOO_WAVELENGTHCOO_BIBCODE
"h:m:s""d:m:s"masmasdeg
objectstr416str416int16int16float32float32int16str32str32object
NAME ORI REGION05 35 17.30-05 23 28.066----0DO
M 4205 35 17.3-05 23 28557500.0007500.00090D1981MNRAS.194..693L
[OW94] 172-23705 35 17.20-05 23 26.866----0D1999AJ....117.1375S
[OW94] 172-32705 35 17.20-05 23 26.866----0D1996AJ....111..846O
DOH 7 175-32805 35 17.5-05 23 2855----0D2004AJ....127.3456D
MAX 12605 35 17.11-05 23 29.366----0DI2005AJ....129.1534R
DOH 7 171-32705 35 17.1-05 23 2755----0D2004AJ....127.3456D
MAX 12505 35 17.11-05 23 26.666----0DI2005AJ....129.1534R
[OW94] 171-32605 35 17.1-05 23 2655----0D2004AJ....127.3456D
.................................
TPSC 805 35 18.9148-05 20 30.94188300.000300.00090CM2011ApJ...733...50M
[YKS96] 805 35 11.0-05 26 00553000.0003000.00090D
2MASS J05350705-052500505 35 07.05-05 25 00.56680.00080.00090BI2003yCat.2246....0C
[LB2000] 1905 35 13.0-05 20 4155----0D2000MNRAS.315...11L
2MASS J05351814-052029505 35 18.142-05 20 29.5277170.000160.00096BI2003yCat.2246....0C
COUP J053514.1-05262005 35 14.191-05 26 20.8377----0D2005ApJS..160..319G
JW 37705 35 12.272-05 20 45.247760.00060.00090BI2003yCat.2246....0C
MLLA 91905 35 12.59-05 20 42.966150.000150.00090CO2009A&A...502..883R
[NW2007] OrionAN-0535146-5262305 35 14.6-05 26 2355----0Em2007MNRAS.374.1413N
MLLA 94505 35 19.69-05 20 31.666----0CO2009ApJS..183..261D

WISE

In [5]:
from astroquery.irsa import Irsa
In [6]:
Irsa.query_region('m42', catalog='wise_allsky_4band_p3as_psd', radius=10*u.arcmin)
Out[6]:
<Table masked=True length=500>
designationradecclonclatsigrasigdecsigradecw1mprow1sigmprow1snrw1rchi2w2mprow2sigmprow2snrw2rchi2w3mprow3sigmprow3snrw3rchi2w4mprow4sigmprow4snrw4rchi2nbnaw1satw2satw3satw4satcc_flagsext_flgvar_flgmoon_levw1nmw1mw2nmw2mw3nmw3mw4nmw4mw1magw1sigmw1flgw1mcorw2magw2sigmw2flgw2mcorw3magw3sigmw3flgw3mcorw4magw4sigmw4flgw4mcortmass_keyj_m_2massj_msig_2massh_m_2massh_msig_2massk_m_2massk_msig_2massdistangleid
degdegarcsarcsarcsmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagarcsdeg
objectfloat64float64objectobjectfloat64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64int32int32float64float64float64float64objectint32objectobjectint32int32int32int32int32int32int32int32float64float64int32float64float64float64int32float64float64float64int32float64float64float64int32float64int32float64float64float64float64float64float64float64float64object
J053530.49-051529.383.877-5.25805h35m30.50s-05d15m29.36s1.05231.7555000000000001-0.950799999999999988.3640000000000008--1.88.59099999999999937.63499999999999980.5032.200000000000000211.119999999999999-3.24500000000000010.01499999999999999971.7999999999999974.4039999999999999--------100.00.00.76800000000000002--ddd03nnnn00000120131313----8.99300000000000030.06700000000000000400.261000000000000017.60700000000000020.03599999999999999700.3190000000000000110.321--32------------------------517.70798923.8564930
J053539.34-051636.083.914-5.27705h35m39.34s-05d16m36.08s0.0699000000000000040.066600000000000006-0.02929.81700000000000020.02346.799999999999997168.900000000000019.14499999999999960.02444.799999999999997111.34.03699999999999990.02199999999999999949.29999999999999773.670000000000002-0.340000000000000020.02100000000000000151.79999999999999779.590000000000003100.00.00.00.0dhhd39999000014141414141414149.24099999999999970.01900.261000000000000018.77299999999999970.1100.319000000000000013.52300000000000010.04800000000000000100.82499999999999996-0.767000000000000020.10810.57599999999999996119481203214.1329999999999990.03300000000000000212.2570.03599999999999999711.4110.024531.09190540.0162199999999971
J053452.59-051655.283.719-5.28205h34m52.60s-05d16m55.21s0.0670000000000000040.070699999999999999-0.003700000000000000212.4440000000000010.02999999999999999935.79999999999999763.65999999999999712.4480.117999999999999999.199999999999999310.325.78800000000000030.04299999999999999725.30000000000000114.933.1370.140999999999999997.70000000000000027.0999999999999996300.00.00.00.0hddd39n9n00001014214121231310.840.15300.2610000000000000110.1679999999999990.21500.319000000000000015.06599999999999980.11400.824999999999999961.18999999999999990.4010000000000000210.57599999999999996--------------526.75310200000001317.3789622
J053518.81-051729.183.828-5.29105h35m18.82s-05d17m29.19s0.02530.0252-0.01096.0320.04200000000000000325.8999999999999995.24600000000000045.32300000000000040.03134.52.01399999999999981.72700000000000010.1557.0155.5-0.653000000000000020.01299999999999999981.400000000000006216.5100.1140.1070.3790.0hhdd30099000013131313121211127.16099999999999960.021000000000000001160.261000000000000016.13799999999999990.023160.319000000000000013.05399999999999980.016160.82499999999999996-0.573999999999999950.01210.57599999999999996119480547811.2189999999999990.0249.38599999999999920.0320000000000000017.89599999999999990.023355.377171999999975.63646600000000043
J053525.87-051831.783.858-5.30905h35m25.88s-05d18m31.74s0.175499999999999990.18099999999999999-0.0437000000000000039.9520.07000000000000000715.59.22899999999999929.32799999999999940.08000000000000000213.66.8159999999999998----------------200.00.0----dd00399nn00001014614--------8.60100000000000090.07299999999999999510.261000000000000018.61700000000000090.3519999999999999810.31900000000000001------------------------------323.18058825.7427439999999984
J053537.20-051710.183.905-5.28605h35m37.21s-05d17m10.19s0.0734000000000000070.074399999999999994-0.0485000000000000017.65399999999999990.03699999999999999829.100000000000001133.400000000000017.02700000000000010.02500000000000000143.100000000000001240.51.54899999999999990.03500000000000000330.60000000000000154.539999999999999-0.766000000000000010.02100000000000000152.100000000000001126.90000000000001200.00.00.471999999999999980.0dddh39999000013131313101313138.42500000000000070.02999999999999999910.261000000000000018.56000000000000050.50310.319000000000000012.8410000000000002--320.82499999999999996-1.21700000000000010.07599999999999999810.57599999999999996--------------484.4789779999999839.7220549999999975
J053450.40-051604.083.710-5.26805h34m50.41s-05d16m04.01s0.0459000000000000030.045400000000000003-0.007499999999999999711.0269999999999990.03135.10000000000000169.70999999999999410.1110000000000010.02599999999999999942.29999999999999752.7100000000000015.41999999999999990.07399999999999999614.6999999999999994.48299999999999970.0459999999999999990.03400000000000000232.20000000000000351.109999999999999100.00.00.00.000hh38969000014141414131371010.4339999999999990.05000000000000000300.261000000000000019.66099999999999960.05500.319000000000000014.76499999999999970.2909999999999999800.82499999999999996-0.39200000000000002--320.57599999999999996--------------586.65157199999999318.415306999999986
J053518.52-051338.383.827-5.22705h35m18.52s-05d13m38.37s0.0374999999999999990.035499999999999997-0.00619999999999999987.89499999999999960.02346.3999999999999994.05400000000000036.78800000000000030.02100000000000000150.7999999999999972.83800000000000012.74000000000000020.358999999999999993.0543.0-0.1610.04499999999999999824.30000000000000126.370000000000001100.00.00.194000000000000010.0dddD311nn000013131313996127.87399999999999970.01200.261000000000000016.89799999999999970.08000000000000000200.319000000000000014.1420000000000003--320.82499999999999996-0.91400000000000003--320.57599999999999996119480524911.4490.02199999999999999910.1030.0320000000000000019.29100000000000040.023585.268838999999962.98825299999999987
J053537.92-051701.583.908-5.28405h35m37.92s-05d17m01.52s0.126700000000000010.15520.03279.56000000000000050.04100000000000000226.69999999999999955.758.84500000000000060.03200000000000000133.70000000000000388.8400000000000033.94200000000000020.07000000000000000715.621.1299999999999991.08000000000000010.04399999999999999724.69999999999999954.310000000000002200.00.00.203999999999999990.0hddd39999000013131313111210138.64400000000000010.06600000000000000310.261000000000000018.0589999999999993--320.319000000000000012.6880000000000002--320.82499999999999996-1.15199999999999990.04399999999999999710.57599999999999996119481200614.862--14.318--14.8680.20300000000000001497.9680149999999840.0288150000000028
............................................................................................................................................................................................................
J053542.50-052732.483.927-5.45905h35m42.51s-05d27m32.41s0.0767999999999999930.0759999999999999980.00570000000000000029.0320.02347.39999999999999929.7100000000000018.45700000000000070.02100000000000000152.026.024.83699999999999970.03699999999999999829.57.72100000000000015.5119999999999996----5281.0100.00.00.00.0hh0D3929n0000131313131313178.79899999999999950.01499999999999999910.261000000000000018.26999999999999960.04800000000000000110.319000000000000013.8270.04800000000000000100.824999999999999960.0459999999999999990.3529999999999999810.57599999999999996119481144011.3919999999999990.02410.5660000000000010.03110.1220.021000000000000001461.93136900000002122.705634490
J053541.19-052751.783.922-5.46405h35m41.20s-05d27m51.70s0.13210.1211-0.019511.480.05800000000000000318.8000000000000012.65310.9840.06900000000000000615.8000000000000014.4847.8920000000000003---0.900000000000000020.57389999999999997--------100.00.00.00.0dd00399nn000012131313020010.4350.11310.261000000000000019.58999999999999990.10710.319000000000000015.1260000000000003--320.824999999999999960.0919999999999999980.06900000000000000610.57599999999999996119481142412.50.02199999999999999911.680.03111.1980.021000000000000001456.66587600000003126.072276491
J053437.40-052124.583.656-5.35705h34m37.40s-05d21m24.55s0.288700000000000010.372400000000000010.05999999999999999813.512---3.60000000000000011.71212.968999999999999---4.01.6636.43299999999999980.04723.1999999999999996.32500000000000024.33900000000000040.202000000000000015.40000000000000042.847100.00.00.00.0000D1nn9n000001011682811.577--320.2610000000000000111.105--320.319000000000000016.14299999999999980.06500000000000000210.824999999999999962.0899999999999999--320.57599999999999996--------------595.45618899999999281.45176900000001492
J053446.38-052431.983.693-5.40905h34m46.39s-05d24m31.92s0.10870.1147-0.01969999999999999910.3989999999999990.02800000000000000138.6000000000000010.6822000000000000310.3560.04800000000000000122.6999999999999990.679899999999999957.05100000000000020.03699999999999999829.39999999999999922.4699999999999992.83300000000000020.06317.10000000000000119.640000000000001100.00.00.00.00h0d10999000014141414111391110.3790.06400000000000000100.2610000000000000110.0350.01299999999999999900.319000000000000016.29399999999999960.08400000000000000500.824999999999999961.462--320.57599999999999996119477640411.5320.02310.8390.03500000000000000310.5320.023454.64256599999999261.25540000000001493
J053514.32-051938.483.810-5.32705h35m14.33s-05d19m38.46s0.0555000000000000010.056800000000000003-0.00489999999999999988.48799999999999950.02900000000000000136.89999999999999968.2800000000000017.67199999999999970.02900000000000000137.70000000000000345.020000000000003----------------100.00.0----dd00399nn000013131313--------7.95500000000000010.03799999999999999910.261000000000000017.27599999999999980.1320000000000000110.31900000000000001----------------119480565413.869--14.9990000000000010.24612.166--226.67055999999999351.85771499999998494
J053513.93-051839.883.808-5.31105h35m13.94s-05d18m39.87s0.0587999999999999980.0628999999999999980.00730000000000000019.09600000000000010.03300000000000000233.052.2100000000000018.04899999999999950.02900000000000000137.10000000000000147.07----------------100.00.0--0.78100000000000003dd00399nn000014141414----008.45599999999999950.10710.261000000000000017.32599999999999960.04599999999999999910.31900000000000001---------1.0850.51600000000000001210.57599999999999996--------------285.51074699999998352.36319300000002495
J053508.69-051807.383.786-5.30205h35m08.69s-05d18m07.34s0.0570000000000000020.058000000000000003-0.00809999999999999968.89899999999999910.02900000000000000137.20000000000000382.5199999999999968.33099999999999950.02900000000000000137.20000000000000345.850000000000001--------2.827---1.335.549999999999997300.00.0--0.51700000000000002hh0D399nn000013131313----038.30599999999999920.03910.261000000000000018.00300000000000010.2039999999999999910.31900000000000001---------1.8220000000000001--320.57599999999999996--------------336.26084100000003339.76565499999998496
J053524.76-052145.883.853-5.36305h35m24.76s-05d21m45.86s0.220900000000000010.25269999999999998-0.0439999999999999978.72000000000000060.08000000000000000213.56.87100000000000048.19500000000000030.146999999999999997.40000000000000041.2809999999999999----------------100.00.0----dd0035nnn00001313013--------7.62199999999999990.2010000000000000110.261000000000000017.0480.2959999999999999910.31900000000000001----------------119480606013.750999999999999--13.207000000000001--14.4570000000000010.22800000000000001157.2059759999999951.908293999999998497
J053511.74-051940.083.799-5.32805h35m11.75s-05d19m40.07s0.24170.2581-0.03679999999999999910.625--1.81.13599999999999999.24499999999999920.07399999999999999614.67.9589999999999996----------------100.00.0----dd003nnnn00001177--------8.7919999999999998--320.261000000000000018.0020000000000007--320.31900000000000001------------------------------233.72290599999999342.39838400000002498
J053526.39-052501.483.860-5.41705h35m26.39s-05d25m01.48s0.0631000000000000030.0676999999999999960.0303000000000000016.0560.05000000000000000321.89999999999999927.7100000000000014.89400000000000010.04000000000000000127.19999999999999916.170000000000002----------------100.455000000000000020.41199999999999998----dd0D394nn000013141414--------7.02700000000000010.065000000000000002160.261000000000000015.77299999999999970.036999999999999998160.31900000000000001----------------11948077336.28500000000000010.0246.27799999999999960.0379999999999999996.2420.016177.865711123.679283499

Practical Exercise

Go to the documentation and try out a query interface for a service that might be relevant to you!