Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python and MongoDB in Astronomy

Python and MongoDB in Astronomy

Talk from PyGotham 2011.

Dan Foreman-Mackey

March 01, 2012
Tweet

More Decks by Dan Foreman-Mackey

Other Decks in Technology

Transcript

  1. Python and MongoDB in Astronomy Dan Foreman-Mackey Center for Cosmology

    and Particle Physics Department of Physics @ NYU In collaboration with: David W. Hogg (NYU), Larry Widrow (Queen’s), Dustin Lang (Princeton), Jonathan Sick (Queen’s), Micha Gorelick (NYU) and many others...
  2. Dan Foreman-Mackey CCPP@NYU dfm.github.com Astronomy 101 How to Study the

    Cosmos Python, MongoDB, etc. Case Studies Andromeda The Milky Way The Internet
  3. Dan Foreman-Mackey CCPP@NYU dfm.github.com The Universe Galaxies Stars Planets What

    is the Universe Made of? Are there other Earth- like planets?
  4. Dan Foreman-Mackey CCPP@NYU dfm.github.com The Universe Galaxies Stars Planets What

    is the Universe Made of? Are there other Earth- like planets?
  5. Dan Foreman-Mackey CCPP@NYU dfm.github.com What is the Universe Made of?

    Source: NASA / WMAP Science Team Time PyGotham Size of the Universe observable
  6. Dan Foreman-Mackey CCPP@NYU dfm.github.com What is the Universe Made of?

    Atoms 4% Dark Matter 23% Dark Energy 73% Heavy Elements 0.03% Source: NASA / WMAP Science Team WMAP Year 7 (Larson et al. 2011)
  7. Dan Foreman-Mackey CCPP@NYU dfm.github.com What is the Universe Made of?

    Atoms 4% Dark Matter 23% Dark Energy 73% Heavy Elements 0.03% Source: NASA / WMAP Science Team WMAP Year 7 (Larson et al. 2011) Source: DFM & Widrow (in prep)
  8. Dan Foreman-Mackey CCPP@NYU dfm.github.com What is the Universe Made of?

    Atoms 4% Dark Matter 23% Dark Energy 73% Heavy Elements 0.03% Source: NASA / WMAP Science Team WMAP Year 7 (Larson et al. 2011) Source: http://apod.nasa.gov Source: DFM & Widrow (in prep)
  9. Dan Foreman-Mackey CCPP@NYU dfm.github.com What is the Universe Made of?

    Atoms 4% Dark Matter 23% Dark Energy 73% Heavy Elements 0.03% Source: NASA / WMAP Science Team WMAP Year 7 (Larson et al. 2011) Source: http://apod.nasa.gov Source: DFM & Widrow (in prep)
  10. Dan Foreman-Mackey CCPP@NYU dfm.github.com Data in Astronomy Imaging Source: NASA

    / ESA Spectroscopy Spectroscopy Source: Riaud & Schneider (2007)
  11. Dan Foreman-Mackey CCPP@NYU dfm.github.com Data in Astronomy Imaging Source: NASA

    / ESA Spectroscopy Spectroscopy Source: Riaud & Schneider (2007)
  12. Dan Foreman-Mackey CCPP@NYU dfm.github.com Data in Astronomy is Open Hubble

    SDSS 2MASS 1990– 2000– 1997–2001 sdss.org archive.stsci.edu/hst www.ipac.caltech.edu/2mass Pan-STARRS LSST Planned GAIA
  13. Dan Foreman-Mackey CCPP@NYU dfm.github.com Data in Astronomy is Open Hubble

    SDSS 2MASS 1990– 2000– 1997–2001 sdss.org archive.stsci.edu/hst www.ipac.caltech.edu/2mass Pan-STARRS LSST Planned GAIA
  14. Dan Foreman-Mackey CCPP@NYU dfm.github.com Data in Astronomy is Open Hubble

    SDSS 2MASS 1990– 2000– 1997–2001 sdss.org archive.stsci.edu/hst www.ipac.caltech.edu/2mass Pan-STARRS LSST Planned GAIA
  15. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies SDSS Variable Stars in

    Stripe 82 728 SESAR ET AL. Ses S07 Labela Ntot A 84 B 144 C 54 D 8 E 11 F 11 G 10 H 7 I 4 J 26 K 8 L 3 M 5 Source: Sesar et al. (2010)
  16. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies SDSS Variable Stars in

    Stripe 82 800k “Fields” ~ 12TB Imaging data > 1M “Target Stars”
  17. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies SDSS Variable Stars in

    Stripe 82 p(X|⇥) = N Y ↵ =1 [(1 P var )p const (X↵ |⇥) + P var p var (X↵ |⇥)]
  18. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies SDSS Variable Stars in

    Stripe 82 p(X|⇥) = N Y ↵ =1 [(1 P var )p const (X↵ |⇥) + P var p var (X↵ |⇥)] Stars
  19. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies SDSS Variable Stars in

    Stripe 82 p(X|⇥) = N Y ↵ =1 [(1 P var )p const (X↵ |⇥) + P var p var (X↵ |⇥)] p const ⌘ M Y i =1 [(1 P bad )p good + P bad p bad ] p var ⌘ M Y i =1 [(1 P bad )p var , good + P bad p bad ] Stars
  20. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies SDSS Variable Stars in

    Stripe 82 p(X|⇥) = N Y ↵ =1 [(1 P var )p const (X↵ |⇥) + P var p var (X↵ |⇥)] p const ⌘ M Y i =1 [(1 P bad )p good + P bad p bad ] p var ⌘ M Y i =1 [(1 P bad )p var , good + P bad p bad ] Stars Runs Runs
  21. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies SDSS Variable Stars in

    Stripe 82 p(X|⇥) = N Y ↵ =1 [(1 P var )p const (X↵ |⇥) + P var p var (X↵ |⇥)] p const ⌘ M Y i =1 [(1 P bad )p good + P bad p bad ] p var ⌘ M Y i =1 [(1 P bad )p var , good + P bad p bad ] Stars Runs Runs p good ⌘ N(Ci↵ |f0 i f⇤ ↵ , 2 i↵ + 2 i↵ ) “Constant & Good” p var , good ⌘ N(Ci↵ |f0 i f⇤ ↵ , 2 i↵ + 2 i↵ + ⌃2 var ) “Variable & Good” pbad ⌘ N(Ci↵ |f0 i f⇤ ↵ , 2 i↵ + 2 i↵ + ⌃2 bad ) “Bad”
  22. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies SDSS Variable Stars in

    Stripe 82 p(X|⇥) = N Y ↵ =1 [(1 P var )p const (X↵ |⇥) + P var p var (X↵ |⇥)] p const ⌘ M Y i =1 [(1 P bad )p good + P bad p bad ] p var ⌘ M Y i =1 [(1 P bad )p var , good + P bad p bad ] Stars Runs Runs p good ⌘ N(Ci↵ |f0 i f⇤ ↵ , 2 i↵ + 2 i↵ ) “Constant & Good” p var , good ⌘ N(Ci↵ |f0 i f⇤ ↵ , 2 i↵ + 2 i↵ + ⌃2 var ) “Variable & Good” pbad ⌘ N(Ci↵ |f0 i f⇤ ↵ , 2 i↵ + 2 i↵ + ⌃2 bad ) “Bad” Npars = Nstars + Nruns + 6 ⇥ = {~ f0,~ f⇤, , ⌘, ⌃2 var , Pvar, ⌃2 bad , Pbad }
  23. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies SDSS Variable Stars in

    Stripe 82 p(X|⇥) = N Y ↵ =1 [(1 P var )p const (X↵ |⇥) + P var p var (X↵ |⇥)]
  24. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies SDSS Variable Stars in

    Stripe 82 f⇤ ( t ) = A0 + N X n=1 [ An sin( !t ) + Bn cos( !t )]
  25. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies CFHT 4.7 Gigapixel mosaic

    of M31 Source: Jonathan Sick (Queen’s University)
  26. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies CFHT Source: Jonathan Sick

    (Queen’s University) MongoDB Persistent Metadata + GeoSpatial Indexing img1.fits img2.fits img4000.fits ... Flat-fielding Cosmic ray removal Sky subtraction Mosaic making ...
  27. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies Crowdsourcing Comet Holmes 

              Source: Lang & Hogg (2011)
  28. Dan Foreman-Mackey CCPP@NYU dfm.github.com Case Studies Crowdsourcing Comet Holmes 

              Source: Lang & Hogg (2011) github.com/dfm/MarkovPy