SlideShare a Scribd company logo
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...
Astronomy 101


               How to Study the Cosmos


                     Python, MongoDB, etc.


                         Case Studies


Dan Foreman-Mackey                              CCPP@NYU
                                             dfm.github.com
Astronomy 101


               How to Study the Cosmos


                     Python, MongoDB, etc.


    Andromeda Case Studies The Internet
              The Milky Way



Dan Foreman-Mackey                              CCPP@NYU
                                             dfm.github.com
The Universe


                       Galaxies


                        Stars


                       Planets


Dan Foreman-Mackey                     CCPP@NYU
                                    dfm.github.com
What is the           The Universe
 Universe
Made of?
                        Galaxies


                         Stars


                        Planets


 Dan Foreman-Mackey                     CCPP@NYU
                                     dfm.github.com
What is the           The Universe
 Universe
Made of?
                        Galaxies


                         Stars
                                        Are there
                                      other Earth-
                        Planets      like planets?



 Dan Foreman-Mackey                       CCPP@NYU
                                       dfm.github.com
What is the           The Universe
 Universe
Made of?
                        Galaxies


                         Stars
                                        Are there
                                      other Earth-
                        Planets      like planets?



 Dan Foreman-Mackey                       CCPP@NYU
                                       dfm.github.com
What is the Universe Made of?




Dan Foreman-Mackey           CCPP@NYU
                          dfm.github.com
What is the Universe Made of?




                        Source: Wikipedia (Adam Evans)




Dan Foreman-Mackey                    CCPP@NYU
                                   dfm.github.com
What is the Universe Made of?

         Rotational Speed




                            Radius




Dan Foreman-Mackey                      CCPP@NYU
                                     dfm.github.com
What is the Universe Made of?

                            Observed
         Rotational Speed




                            Radius




Dan Foreman-Mackey                        CCPP@NYU
                                       dfm.github.com
What is the Universe Made of?

                            Observed
         Rotational Speed

                                 WTF?




                            Radius




Dan Foreman-Mackey                         CCPP@NYU
                                        dfm.github.com
What is the Universe Made of?

         Rotational Speed   ?   Observed


                                     WTF?




                                Radius




Dan Foreman-Mackey                             CCPP@NYU
                                            dfm.github.com
What is the Universe Made of?

         Rotational Speed   ?   Observed


                                     WTF?




                                Radius
                                                 ?

Dan Foreman-Mackey                             CCPP@NYU
                                            dfm.github.com
What is the Universe Made of?

                                Observed
         Rotational Speed

                                     WTF?




                                Radius
                                                 ?
                            ?
Dan Foreman-Mackey                             CCPP@NYU
                                            dfm.github.com
What is the Universe Made of?




                     Dark Matter
Dan Foreman-Mackey                    CCPP@NYU
                                   dfm.github.com
What is the Universe Made of?
           Size of the Universe




                                                             PyGotham
   b le
     rva
obse




                                  Time
                                         Source: NASA / WMAP Science Team




       Dan Foreman-Mackey                                 CCPP@NYU
                                                       dfm.github.com
What is the Universe Made of?


                          Dark Energy
                             73%


        Heavy
       Elements
        0.03%
                      Dark Matter
                         23%
              Atoms
               4%


                                        Source: NASA / WMAP Science Team
                                            WMAP Year 7 (Larson et al. 2011)



Dan Foreman-Mackey                                         CCPP@NYU
                                                        dfm.github.com
What is the Universe Made of?


                                             Dark Energy
                                                73%
Source: DFM & Widrow (in prep)

                          Heavy
                         Elements
                          0.03%
                                         Dark Matter
                                            23%
                                 Atoms
                                  4%


                                                           Source: NASA / WMAP Science Team
                                                               WMAP Year 7 (Larson et al. 2011)



             Dan Foreman-Mackey                                               CCPP@NYU
                                                                           dfm.github.com
What is the Universe Made of?                        Source: http://apod.nasa.gov




                                             Dark Energy
                                                73%
Source: DFM & Widrow (in prep)

                          Heavy
                         Elements
                          0.03%
                                         Dark Matter
                                            23%
                                 Atoms
                                  4%


                                                           Source: NASA / WMAP Science Team
                                                               WMAP Year 7 (Larson et al. 2011)



             Dan Foreman-Mackey                                               CCPP@NYU
                                                                           dfm.github.com
What is the Universe Made of?                        Source: http://apod.nasa.gov




                                             Dark Energy
                                                73%
Source: DFM & Widrow (in prep)

                          Heavy
                         Elements
                          0.03%
                                         Dark Matter
                                            23%
                                 Atoms
                                  4%


                                                           Source: NASA / WMAP Science Team
                                                               WMAP Year 7 (Larson et al. 2011)



             Dan Foreman-Mackey                                               CCPP@NYU
                                                                           dfm.github.com
Dan Foreman-Mackey                          CCPP@NYU
                     Credit: The Millennium Simulation Project
                                         dfm.github.com
Dan Foreman-Mackey                          CCPP@NYU
                     Credit: The Millennium Simulation Project
                                         dfm.github.com
Dan Foreman-Mackey                          CCPP@NYU
                     Credit: The Millennium Simulation Project
                                         dfm.github.com
Data in Astronomy




Dan Foreman-Mackey                      CCPP@NYU
                                     dfm.github.com
Data in Astronomy




                                 Credit: Jonathan Sick
                                       jonathansick.ca



Dan Foreman-Mackey                   CCPP@NYU
                                  dfm.github.com
Data in Astronomy




                                 Credit: Jonathan Sick
                                       jonathansick.ca



Dan Foreman-Mackey                   CCPP@NYU
                                  dfm.github.com
Data in Astronomy




              MegaCam: 340 MegaPixels   Credit: Jonathan Sick
                                              jonathansick.ca



Dan Foreman-Mackey                          CCPP@NYU
                                         dfm.github.com
Data in Astronomy




              MegaCam: 340 MegaPixels       Credit: NASA




Dan Foreman-Mackey                         CCPP@NYU
                                        dfm.github.com
Data in Astronomy
                     Imaging




                                 Source: NASA / ESA




Dan Foreman-Mackey                  CCPP@NYU
                                 dfm.github.com
Data in Astronomy
            Imaging

                             Spectroscopy




                                       Source: NASA / ESA




Dan Foreman-Mackey                        CCPP@NYU
                                       dfm.github.com
Data in Astronomy
                      Source: Riaud & Schneider (2007)


            Imaging
                          Spectroscopy
                                                         Spectroscopy




                                                                   Source: NASA / ESA




Dan Foreman-Mackey                                                    CCPP@NYU
                                                                   dfm.github.com
Data in Astronomy
                      Source: Riaud & Schneider (2007)


            Imaging
                          Spectroscopy
                                                         Spectroscopy




                                                                   Source: NASA / ESA




Dan Foreman-Mackey                                                    CCPP@NYU
                                                                   dfm.github.com
a
                   Data in Astronomy
                  lot
                        is Open
                        of




Dan Foreman-Mackey                        CCPP@NYU
                                       dfm.github.com
a
                   Data in Astronomy
                  lot
                        is Open
                        of


                                                     !
                             and there’s a lot of it




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




                               GAIA
Pan-STARRS                                                       LSST
                                  Planned

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




                               GAIA
Pan-STARRS                                                       LSST
                                  Planned

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




                               GAIA
Pan-STARRS                                                       LSST
                                  Planned

Dan Foreman-Mackey                                                  CCPP@NYU
                                                                 dfm.github.com
Where does Python fit in?




Dan Foreman-Mackey               CCPP@NYU
                              dfm.github.com
Where does Python fit in?




Dan Foreman-Mackey                    CCPP@NYU
                                   dfm.github.com
Where does Python fit in?




Dan Foreman-Mackey                    CCPP@NYU
                                   dfm.github.com
Where does Python fit in?




Dan Foreman-Mackey                    CCPP@NYU
                                   dfm.github.com
Where does Python fit in?




Dan Foreman-Mackey                    CCPP@NYU
                                   dfm.github.com
Where does Python fit in?




                                 +
                        Scientific Python Stack




Dan Foreman-Mackey                                  CCPP@NYU
                                                 dfm.github.com
Where does Python fit in?




                                 +
                        Scientific Python Stack




Dan Foreman-Mackey                                  CCPP@NYU
                                                 dfm.github.com
Where does Python fit in?




                                 +
                        Scientific Python Stack




Dan Foreman-Mackey                                  CCPP@NYU
                                                 dfm.github.com
What about             ?

                       Easy
                      Flexible
                     Pythonic
                      Scalable

Dan Foreman-Mackey                   CCPP@NYU
                                  dfm.github.com
Case Studies




Dan Foreman-Mackey                     CCPP@NYU
                                    dfm.github.com
Case Studies
                     Variable Stars in Stripe 82
           SDSS




Dan Foreman-Mackey                        CCPP@NYU
                                       dfm.github.com
Case Studies
                                        Variable Stars in Stripe 82
           SDSS

          728                                           SESAR ET AL.

                                                                                 Ses

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




Dan Foreman-Mackey                        CCPP@NYU
                                       dfm.github.com
Case Studies
                     Variable Stars in Stripe 82
           SDSS




Dan Foreman-Mackey                        CCPP@NYU
                                       dfm.github.com
Case Studies
                           Variable Stars in Stripe 82
           SDSS


         800k “Fields” ~ 12TB Imaging data
                > 1M “Target Stars”




Dan Foreman-Mackey                              CCPP@NYU
                                             dfm.github.com
Case Studies
                                         Variable Stars in Stripe 82
           SDSS
             Photons/Brightness




                                  Time

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




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




  Dan Foreman-Mackey                                          CCPP@NYU
                                                           dfm.github.com
Case Studies
                                                     Variable Stars in Stripe 82
                       SDSS
                       YN
 p(X|⇥) =                    [(1     Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)]
                       ↵=1
                       Stars
           M
           Y                                                 M
                                                             Y
pconst ⌘         [(1    Pbad )pgood + Pbad pbad ]   pvar ⌘         [(1   Pbad )pvar,good + Pbad pbad ]
           i=1                                               i=1




     Dan Foreman-Mackey                                                             CCPP@NYU
                                                                                 dfm.github.com
Case Studies
                                                     Variable Stars in Stripe 82
                       SDSS
                       YN
 p(X|⇥) =                    [(1     Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)]
                       ↵=1
                       Stars
           M
           Y                                                 M
                                                             Y
pconst ⌘         [(1    Pbad )pgood + Pbad pbad ]   pvar ⌘         [(1   Pbad )pvar,good + Pbad pbad ]
           i=1                                               i=1

     Runs                                               Runs




     Dan Foreman-Mackey                                                             CCPP@NYU
                                                                                 dfm.github.com
Case Studies
                                                        Variable Stars in Stripe 82
                       SDSS
                       YN
 p(X|⇥) =                    [(1        Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)]
                       ↵=1
                       Stars
           M
           Y                                                     M
                                                                 Y
pconst ⌘         [(1    Pbad )pgood + Pbad pbad ]      pvar ⌘          [(1   Pbad )pvar,good + Pbad pbad ]
           i=1                                                   i=1

      Runs                                                   Runs
                       ⇤                                                     ⇤
  pgood ⌘ N (Ci↵ |fi0 f↵ ,     2
                               i↵   +   2
                                        i↵ )        pvar,good ⌘ N (Ci↵ |fi0 f↵ ,     2
                                                                                     i↵   +   2
                                                                                              i↵   + ⌃2 )
                                                                                                      var
                 “Constant & Good”                   “Variable & Good”

                                                 ⇤
                             pbad ⌘ N (Ci↵ |fi0 f↵ ,    2
                                                        i↵   +   2
                                                                 i↵    + ⌃2 )
                                                                          bad
                                                “Bad”

      Dan Foreman-Mackey                                                                CCPP@NYU
                                                                                     dfm.github.com
Case Studies
                                                        Variable Stars in Stripe 82
                       SDSS
                       YN
 p(X|⇥) =                    [(1        Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)]
                       ↵=1
                       Stars
           M
           Y                                                     M
                                                                 Y
pconst ⌘         [(1    Pbad )pgood + Pbad pbad ]      pvar ⌘         [(1   Pbad )pvar,good + Pbad pbad ]
           i=1
                Npars = Nstars + Nruns + 6
                                         i=1

      Runs      ~ 0 , ~ ⇤ , , ⌘, ⌃2 , PRuns , Pbad }
                                              2
           ⇥ = {f f               var  var , ⌃bad
                       ⇤                                                     ⇤
  pgood ⌘ N (Ci↵ |fi0 f↵ ,     2
                               i↵   +   2
                                        i↵ )        pvar,good ⌘ N (Ci↵ |fi0 f↵ ,    2
                                                                                    i↵   +   2
                                                                                             i↵   + ⌃2 )
                                                                                                     var
                 “Constant & Good”                   “Variable & Good”

                                                 ⇤
                             pbad ⌘ N (Ci↵ |fi0 f↵ ,    2
                                                        i↵   +   2
                                                                 i↵   + ⌃2 )
                                                                         bad
                                                “Bad”

      Dan Foreman-Mackey                                                               CCPP@NYU
                                                                                    dfm.github.com
Case Studies
                     Variable Stars in Stripe 82
           SDSS




Dan Foreman-Mackey                        CCPP@NYU
                                       dfm.github.com
Case Studies
                     Variable Stars in Stripe 82
           SDSS




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




Dan Foreman-Mackey                                                 CCPP@NYU
                                                                dfm.github.com
Case Studies
                        Variable Stars in Stripe 82
           SDSS




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




4.7 Gigapixel mosaic of M31
                                    Source: Jonathan Sick
                                      (Queen’s University)



Dan Foreman-Mackey                       CCPP@NYU
                                      dfm.github.com
Dan Foreman-Mackey      CCPP@NYU
                     dfm.github.com Jonathan Sick
                               Source:
                                 (Queen’s University)
Dan Foreman-Mackey      CCPP@NYU
                     dfm.github.com Jonathan Sick
                               Source:
                                 (Queen’s University)
Dan Foreman-Mackey      CCPP@NYU
                     dfm.github.com Jonathan Sick
                               Source:
                                 (Queen’s University)
Case Studies
    CFHT
Cosmic ray removal      Flat-fielding   Sky subtraction     ...    Mosaic making




                   MongoDB
    Persistent Metadata + GeoSpatial Indexing


       img1.fits           img2.fits           ...         img4000.fits
                                                                 Source: Jonathan Sick
                                                                   (Queen’s University)



   Dan Foreman-Mackey                                                 CCPP@NYU
                                                                   dfm.github.com
Astrometry.net       Case Studies




Dan Foreman-Mackey             CCPP@NYU
                            dfm.github.com
Astrometry.net       Case Studies




Dan Foreman-Mackey             CCPP@NYU
                            dfm.github.com
Dan Foreman-Mackey      CCPP@NYU
                     dfm.github.com
Dan Foreman-Mackey      CCPP@NYU
                     dfm.github.com
Dan Foreman-Mackey      CCPP@NYU
                     dfm.github.com
Crowdsourcing Comet Holmes                  Case Studies


                       Lang & Hogg (2011)




                        ~2500
                           JPGs



Dan Foreman-Mackey                                    CCPP@NYU
                                                   dfm.github.com
Crowdsourcing Comet Holmes   Case Studies




Dan Foreman-Mackey                     CCPP@NYU
                                    dfm.github.com
Crowdsourcing Comet Holmes   Case Studies




Dan Foreman-Mackey                     CCPP@NYU
                                    dfm.github.com
Crowdsourcing Comet Holmes   Case Studies




Dan Foreman-Mackey                     CCPP@NYU
                                    dfm.github.com
Crowdsourcing Comet Holmes   Case Studies




                                  Source: Lang & Hogg (2011)




Dan Foreman-Mackey                          CCPP@NYU
                                         dfm.github.com
Crowdsourcing Comet Holmes   Case Studies




                                  Source: Lang & Hogg (2011)




Dan Foreman-Mackey                          CCPP@NYU
                                         dfm.github.com
Crowdsourcing Comet Holmes   Case Studies




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


Dan Foreman-Mackey                          CCPP@NYU
                                         dfm.github.com
Crowdsourcing Comet Holmes   Case Studies




Dan Foreman-Mackey                     CCPP@NYU
                                    dfm.github.com
Growing
 Datasets



   User
Interaction



 Number                  Data     And Much
Crunching            Management    More...
                       (      )
Dan Foreman-Mackey                      CCPP@NYU
                                     dfm.github.com
Growing
 Datasets



   User
Interaction
                     Easy!
 Number                  Data     And Much
Crunching            Management    More...
                       (      )
Dan Foreman-Mackey                      CCPP@NYU
                                     dfm.github.com
Growing                          Big Questions
 Datasets



   User
Interaction
                     Easy!
 Number                  Data        And Much
Crunching            Management       More...
                       (      )
Dan Foreman-Mackey                          CCPP@NYU
                                         dfm.github.com
Dan Foreman-Mackey
  Center for Cosmology & Particle Physics (NYU)
                dfm.github.com
                  @__dfm__




Dan Foreman-Mackey                           CCPP@NYU
                                          dfm.github.com

More Related Content

PDF
A1 14 Comets
PPT
13 lecture outline
PPT
13 review clickers
PDF
Dragan Huterer "Novi pogledi na svemir"
PPT
12 lecture outline
PPT
11 review clickers
PPT
02 Matter Is Atoms That Move After Class
PPT
08 review clickers
A1 14 Comets
13 lecture outline
13 review clickers
Dragan Huterer "Novi pogledi na svemir"
12 lecture outline
11 review clickers
02 Matter Is Atoms That Move After Class
08 review clickers

What's hot (20)

PPT
04 lecture outline
PPT
05 lecture outline
PPT
09 lecture outline
ZIP
Cube.key
PPTX
The Science of Comet ISON
PPT
11 lecture outline
PPTX
Rocketry, Meteor Belt, Astronomy PowerPoint Quiz Game
PPT
Origins (big bang)
PPTX
Atomic Mass, Atomic Number, Isotopes, Physical Science Lesson PowerPoint
PPT
12 review clickers
PDF
Sloan digital sky survey iii mapping the universe on the largest scales
PPTX
Discovering Your Inner Scientist
PPT
S2 review clickers
KEY
Cubegood
DOCX
1universe hp
PDF
Jack oughton 02.12.08 - fomalhaut
PPTX
Big Bang Theory Astronomy Lesson PowerPoint
PDF
PDF
A1 17 Ism
PDF
2010_Lobbia_Thesis
04 lecture outline
05 lecture outline
09 lecture outline
Cube.key
The Science of Comet ISON
11 lecture outline
Rocketry, Meteor Belt, Astronomy PowerPoint Quiz Game
Origins (big bang)
Atomic Mass, Atomic Number, Isotopes, Physical Science Lesson PowerPoint
12 review clickers
Sloan digital sky survey iii mapping the universe on the largest scales
Discovering Your Inner Scientist
S2 review clickers
Cubegood
1universe hp
Jack oughton 02.12.08 - fomalhaut
Big Bang Theory Astronomy Lesson PowerPoint
A1 17 Ism
2010_Lobbia_Thesis
Ad

Viewers also liked (20)

KEY
The Changing Face(s) of Astronomy
PPTX
Starting in Backyard Astronomy: On the Right Foot
PDF
Discovering Astronomy: Intro to the Cosmos
PPT
Origin of Modern Astronomy
PDF
My astronomy dictionary
PPTX
Iya Activities Of Kssp
PPTX
Astronomy
PPT
History of Photography
PDF
Pre Photography History
PPTX
History Of The Internet[1]
PDF
Discovering Astronomy Workshop 2014 May
PPT
How Telescopes Work
PPT
Basic astronomy
PPS
Astronomy Photographer of the Year 2014, shortlist
PPTX
History of photography
PPT
Astronomy Midterm Review
PPS
Cosmology And Astronomy
PPTX
History Of Photography
PPS
Astronomy Photographer of the Year 2015 (shortlisted images selected)
PPT
PeopleBrowsr Presents A Brief Cartoon History of Social Networking 1930-2015
The Changing Face(s) of Astronomy
Starting in Backyard Astronomy: On the Right Foot
Discovering Astronomy: Intro to the Cosmos
Origin of Modern Astronomy
My astronomy dictionary
Iya Activities Of Kssp
Astronomy
History of Photography
Pre Photography History
History Of The Internet[1]
Discovering Astronomy Workshop 2014 May
How Telescopes Work
Basic astronomy
Astronomy Photographer of the Year 2014, shortlist
History of photography
Astronomy Midterm Review
Cosmology And Astronomy
History Of Photography
Astronomy Photographer of the Year 2015 (shortlisted images selected)
PeopleBrowsr Presents A Brief Cartoon History of Social Networking 1930-2015
Ad

Similar to Python and MongoDB in Astronomy (20)

PPT
earth and life science 12 lovebsbsbjwjej
PPT
Dark Matter and Dark Energy
PPT
Astronomy Extensions Menu
PPT
Dark Matter And Dark Energy
PPTX
powerpoint predentation of on intersteller
PPTX
universe pptbest ppt of universe of the fooloing.pptx
DOCX
Galaxies
PDF
Neven Bilic, "Dark Matter, Dark Energy, and Unification Models"
PPT
Facts about our universe
PDF
To The Edge of Infinity
PDF
Scientific culture.u1. the universe ppt
PPT
Class%20presentation.ppt
PPT
The universe
PPTX
BASICS OF COSMOLOGY
PDF
A1 23 The Universe
PDF
slidesgo-exploring-the-infinite-a-journey-through-the-wonders-of-the-universe...
PPTX
Universe and the Solar System (Lesson 1).pptx
PPT
Astronomy notes2: Notes on the composition & formation of Galaxies, leading ...
PPTX
THE UNIVERSE.pptx
earth and life science 12 lovebsbsbjwjej
Dark Matter and Dark Energy
Astronomy Extensions Menu
Dark Matter And Dark Energy
powerpoint predentation of on intersteller
universe pptbest ppt of universe of the fooloing.pptx
Galaxies
Neven Bilic, "Dark Matter, Dark Energy, and Unification Models"
Facts about our universe
To The Edge of Infinity
Scientific culture.u1. the universe ppt
Class%20presentation.ppt
The universe
BASICS OF COSMOLOGY
A1 23 The Universe
slidesgo-exploring-the-infinite-a-journey-through-the-wonders-of-the-universe...
Universe and the Solar System (Lesson 1).pptx
Astronomy notes2: Notes on the composition & formation of Galaxies, leading ...
THE UNIVERSE.pptx

Recently uploaded (20)

PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
A Presentation on Artificial Intelligence
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
A Presentation on Touch Screen Technology
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Tartificialntelligence_presentation.pptx
PPTX
1. Introduction to Computer Programming.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
cloud_computing_Infrastucture_as_cloud_p
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Chapter 5: Probability Theory and Statistics
Encapsulation_ Review paper, used for researhc scholars
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
A Presentation on Artificial Intelligence
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MIND Revenue Release Quarter 2 2025 Press Release
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A Presentation on Touch Screen Technology
Enhancing emotion recognition model for a student engagement use case through...
Tartificialntelligence_presentation.pptx
1. Introduction to Computer Programming.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
A comparative analysis of optical character recognition models for extracting...
Heart disease approach using modified random forest and particle swarm optimi...
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Hindi spoken digit analysis for native and non-native speakers
cloud_computing_Infrastucture_as_cloud_p

Python and MongoDB in Astronomy

  • 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. Astronomy 101 How to Study the Cosmos Python, MongoDB, etc. Case Studies Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 3. Astronomy 101 How to Study the Cosmos Python, MongoDB, etc. Andromeda Case Studies The Internet The Milky Way Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 4. The Universe Galaxies Stars Planets Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 5. What is the The Universe Universe Made of? Galaxies Stars Planets Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 6. What is the The Universe Universe Made of? Galaxies Stars Are there other Earth- Planets like planets? Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 7. What is the The Universe Universe Made of? Galaxies Stars Are there other Earth- Planets like planets? Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 8. What is the Universe Made of? Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 9. What is the Universe Made of? Source: Wikipedia (Adam Evans) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 10. What is the Universe Made of? Rotational Speed Radius Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 11. What is the Universe Made of? Observed Rotational Speed Radius Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 12. What is the Universe Made of? Observed Rotational Speed WTF? Radius Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 13. What is the Universe Made of? Rotational Speed ? Observed WTF? Radius Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 14. What is the Universe Made of? Rotational Speed ? Observed WTF? Radius ? Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 15. What is the Universe Made of? Observed Rotational Speed WTF? Radius ? ? Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 16. What is the Universe Made of? Dark Matter Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 17. What is the Universe Made of? Size of the Universe PyGotham b le rva obse Time Source: NASA / WMAP Science Team Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 18. What is the Universe Made of? Dark Energy 73% Heavy Elements 0.03% Dark Matter 23% Atoms 4% Source: NASA / WMAP Science Team WMAP Year 7 (Larson et al. 2011) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 19. What is the Universe Made of? Dark Energy 73% Source: DFM & Widrow (in prep) Heavy Elements 0.03% Dark Matter 23% Atoms 4% Source: NASA / WMAP Science Team WMAP Year 7 (Larson et al. 2011) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 20. What is the Universe Made of? Source: http://apod.nasa.gov Dark Energy 73% Source: DFM & Widrow (in prep) Heavy Elements 0.03% Dark Matter 23% Atoms 4% Source: NASA / WMAP Science Team WMAP Year 7 (Larson et al. 2011) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 21. What is the Universe Made of? Source: http://apod.nasa.gov Dark Energy 73% Source: DFM & Widrow (in prep) Heavy Elements 0.03% Dark Matter 23% Atoms 4% Source: NASA / WMAP Science Team WMAP Year 7 (Larson et al. 2011) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 22. Dan Foreman-Mackey CCPP@NYU Credit: The Millennium Simulation Project dfm.github.com
  • 23. Dan Foreman-Mackey CCPP@NYU Credit: The Millennium Simulation Project dfm.github.com
  • 24. Dan Foreman-Mackey CCPP@NYU Credit: The Millennium Simulation Project dfm.github.com
  • 25. Data in Astronomy Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 26. Data in Astronomy Credit: Jonathan Sick jonathansick.ca Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 27. Data in Astronomy Credit: Jonathan Sick jonathansick.ca Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 28. Data in Astronomy MegaCam: 340 MegaPixels Credit: Jonathan Sick jonathansick.ca Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 29. Data in Astronomy MegaCam: 340 MegaPixels Credit: NASA Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 30. Data in Astronomy Imaging Source: NASA / ESA Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 31. Data in Astronomy Imaging Spectroscopy Source: NASA / ESA Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 32. Data in Astronomy Source: Riaud & Schneider (2007) Imaging Spectroscopy Spectroscopy Source: NASA / ESA Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 33. Data in Astronomy Source: Riaud & Schneider (2007) Imaging Spectroscopy Spectroscopy Source: NASA / ESA Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 34. a Data in Astronomy lot is Open of Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 35. a Data in Astronomy lot is Open of ! and there’s a lot of it Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 36. Data in Astronomy is Open 1990– 2000– 1997–2001 SDSS Hubble archive.stsci.edu/hst sdss.org 2MASS www.ipac.caltech.edu/2mass GAIA Pan-STARRS LSST Planned Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 37. Data in Astronomy is Open 1990– 2000– 1997–2001 SDSS Hubble archive.stsci.edu/hst sdss.org 2MASS www.ipac.caltech.edu/2mass GAIA Pan-STARRS LSST Planned Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 38. Data in Astronomy is Open 1990– 2000– 1997–2001 SDSS Hubble archive.stsci.edu/hst sdss.org 2MASS www.ipac.caltech.edu/2mass GAIA Pan-STARRS LSST Planned Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 39. Where does Python fit in? Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 40. Where does Python fit in? Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 41. Where does Python fit in? Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 42. Where does Python fit in? Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 43. Where does Python fit in? Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 44. Where does Python fit in? + Scientific Python Stack Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 45. Where does Python fit in? + Scientific Python Stack Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 46. Where does Python fit in? + Scientific Python Stack Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 47. What about ? Easy Flexible Pythonic Scalable Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 48. Case Studies Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 49. Case Studies Variable Stars in Stripe 82 SDSS Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 50. Case Studies Variable Stars in Stripe 82 SDSS 728 SESAR ET AL. Ses S07 Labela Ntot A 84 B 144 C 54 D 8 E 11 F 11 Source: Sesar et al. (2010) G 10 H 7 I 4 J 26 K 8 Dan Foreman-Mackey CCPP@NYU L 3 dfm.github.com M 5
  • 51. Case Studies Variable Stars in Stripe 82 SDSS Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 52. Case Studies Variable Stars in Stripe 82 SDSS Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 53. Case Studies Variable Stars in Stripe 82 SDSS 800k “Fields” ~ 12TB Imaging data > 1M “Target Stars” Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 54. Case Studies Variable Stars in Stripe 82 SDSS Photons/Brightness Time Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 55. Case Studies Variable Stars in Stripe 82 SDSS Y N p(X|⇥) = [(1 Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)] ↵=1 Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 56. Case Studies Variable Stars in Stripe 82 SDSS Y N p(X|⇥) = [(1 Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)] ↵=1 Stars Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 57. Case Studies Variable Stars in Stripe 82 SDSS YN p(X|⇥) = [(1 Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)] ↵=1 Stars M Y M Y pconst ⌘ [(1 Pbad )pgood + Pbad pbad ] pvar ⌘ [(1 Pbad )pvar,good + Pbad pbad ] i=1 i=1 Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 58. Case Studies Variable Stars in Stripe 82 SDSS YN p(X|⇥) = [(1 Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)] ↵=1 Stars M Y M Y pconst ⌘ [(1 Pbad )pgood + Pbad pbad ] pvar ⌘ [(1 Pbad )pvar,good + Pbad pbad ] i=1 i=1 Runs Runs Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 59. Case Studies Variable Stars in Stripe 82 SDSS YN p(X|⇥) = [(1 Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)] ↵=1 Stars M Y M Y pconst ⌘ [(1 Pbad )pgood + Pbad pbad ] pvar ⌘ [(1 Pbad )pvar,good + Pbad pbad ] i=1 i=1 Runs Runs ⇤ ⇤ pgood ⌘ N (Ci↵ |fi0 f↵ , 2 i↵ + 2 i↵ ) pvar,good ⌘ N (Ci↵ |fi0 f↵ , 2 i↵ + 2 i↵ + ⌃2 ) var “Constant & Good” “Variable & Good” ⇤ pbad ⌘ N (Ci↵ |fi0 f↵ , 2 i↵ + 2 i↵ + ⌃2 ) bad “Bad” Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 60. Case Studies Variable Stars in Stripe 82 SDSS YN p(X|⇥) = [(1 Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)] ↵=1 Stars M Y M Y pconst ⌘ [(1 Pbad )pgood + Pbad pbad ] pvar ⌘ [(1 Pbad )pvar,good + Pbad pbad ] i=1 Npars = Nstars + Nruns + 6 i=1 Runs ~ 0 , ~ ⇤ , , ⌘, ⌃2 , PRuns , Pbad } 2 ⇥ = {f f var var , ⌃bad ⇤ ⇤ pgood ⌘ N (Ci↵ |fi0 f↵ , 2 i↵ + 2 i↵ ) pvar,good ⌘ N (Ci↵ |fi0 f↵ , 2 i↵ + 2 i↵ + ⌃2 ) var “Constant & Good” “Variable & Good” ⇤ pbad ⌘ N (Ci↵ |fi0 f↵ , 2 i↵ + 2 i↵ + ⌃2 ) bad “Bad” Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 61. Case Studies Variable Stars in Stripe 82 SDSS Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 62. Case Studies Variable Stars in Stripe 82 SDSS Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 63. Case Studies Variable Stars in Stripe 82 SDSS N Y p(X|⇥) = [(1 Pvar )pconst (X ↵ |⇥) + Pvar pvar (X ↵ |⇥)] ↵=1 Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 64. Case Studies Variable Stars in Stripe 82 SDSS N X f ⇤ (t) = A0 + [An sin(!t) + Bn cos(!t)] n=1 Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 65. Case Studies CFHT 4.7 Gigapixel mosaic of M31 Source: Jonathan Sick (Queen’s University) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 66. Dan Foreman-Mackey CCPP@NYU dfm.github.com Jonathan Sick Source: (Queen’s University)
  • 67. Dan Foreman-Mackey CCPP@NYU dfm.github.com Jonathan Sick Source: (Queen’s University)
  • 68. Dan Foreman-Mackey CCPP@NYU dfm.github.com Jonathan Sick Source: (Queen’s University)
  • 69. Case Studies CFHT Cosmic ray removal Flat-fielding Sky subtraction ... Mosaic making MongoDB Persistent Metadata + GeoSpatial Indexing img1.fits img2.fits ... img4000.fits Source: Jonathan Sick (Queen’s University) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 70. Astrometry.net Case Studies Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 71. Astrometry.net Case Studies Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 72. Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 73. Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 74. Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 75. Crowdsourcing Comet Holmes Case Studies Lang & Hogg (2011) ~2500 JPGs Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 76. Crowdsourcing Comet Holmes Case Studies Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 77. Crowdsourcing Comet Holmes Case Studies Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 78. Crowdsourcing Comet Holmes Case Studies Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 79. Crowdsourcing Comet Holmes Case Studies Source: Lang & Hogg (2011) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 80. Crowdsourcing Comet Holmes Case Studies Source: Lang & Hogg (2011) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 81. Crowdsourcing Comet Holmes Case Studies Source: Lang & Hogg (2011) github.com/dfm/MarkovPy Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 82. Crowdsourcing Comet Holmes Case Studies Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 83. Growing Datasets User Interaction Number Data And Much Crunching Management More... ( ) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 84. Growing Datasets User Interaction Easy! Number Data And Much Crunching Management More... ( ) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 85. Growing Big Questions Datasets User Interaction Easy! Number Data And Much Crunching Management More... ( ) Dan Foreman-Mackey CCPP@NYU dfm.github.com
  • 86. Dan Foreman-Mackey Center for Cosmology & Particle Physics (NYU) dfm.github.com @__dfm__ Dan Foreman-Mackey CCPP@NYU dfm.github.com