Python (Jupyter) based activities used in ASTR352 (Extragalactic Data Science) 0.5 credit upper-level undergraduate class at Haverford College.
These examples were practiced and/or developed in a Sciserver.org Compute Jupyter Notebook.
-
Computing Galactic Orbits of Stars with Gala Astropy tutorial
-
Galaxy Populations and Data Visualisation - a Notebook in this repository. This uses SciServer and Casjobs to query SDSS data, learn about sample selection, data frames (pandas), and some examples of data visualisation with matplotlib.
-
Galaxy Kinematics Scaling Relations and MaNGA Data - a Notebook in this repository. This explores MaNGA data mostly related to kinematics, and also does some statistics with line fits, comparing distributions, exploring the Tully-Fisher relation and how different measures of kinematics differ.
Other ideas to explore SDSS-IV MaNGA spectral maps of galaxies with the code, Marvin
- Check out Marvin Web and pick a galaxy you like.
- Do the Plotting Tutorial: The Basics of Plotting in Marvin, and make the plots for your chosen galaxy.
- Pick one of the Science Exercises to try out.
- Galaxies and the large-scale structure of the Universe - a Notebook in this repository. This explores large scale structure as traced by galaxies in the SDSS survey, and how to compute correlations functions and compare to random distributions.
Other ideas to explore large Scale structure in simulations and/or observations (the notebook in this respository is based in part on some of these)
- Explore the Indra Simulations (accessed on SciServer with "indra-tools": https://github.com/bfalck/indra-tools) https://www.sciserver.org/datasets/
- Large Scale structure in SDSS: https://github.com/ritatojeiro/SDSSEPO/blob/master/AS1001_SDSSEPO.ipynb (some of this will be a bit familiar from the Galaxy populations notebook - but this focuses more on the LSS and environment).
- Two-point correlation functions (tutorial found on Github which works through this statistical method which is often used on LSS): https://github.com/fjaviersanchez/corrfunc_tutorial
- Galaxy Images as Data - a Notebook in this repository. This explores multi-wavelength images of the Centaurus A galaxy using both jpg and fits image files. We also did the StatMorph Tutorial to try out fitting models to galaxy data.
Useful resources for working with FITS images in python:
* THINGS (HI 21cm data): https://www2.mpia-hd.mpg.de/THINGS/Data.html (moment 0 is the intensity map).
* Digitised Sky Survey (for optical FITS images): https://archive.eso.org/dss/dss
* List of sources for astronomical FITS files: https://fits.gsfc.nasa.gov/fits_samples.html
* Astropy, read a FITS image and plot: https://docs.astropy.org/en/stable/generated/examples/io/plot_fits-image.html#sphx-glr-generated-examples-io-plot-fits-image-py
* Astropy: read RA and Dec from the header of a FITS file: https://learn.astropy.org/tutorials/celestial_coords1.html
* Astropy overlay contours: https://docs.astropy.org/en/stable/visualization/wcsaxes/images_contours.html
* Astropy make 3 colour image: https://docs.astropy.org/en/stable/visualization/rgb.html
* Astropy FITS cube: https://learn.astropy.org/tutorials/FITS-cubes.html
Here are a bunch of links to other Astronomical Python Tutorials and/or Examples, some of which have been directly used in the development of materials for this class.
- Learn Astropy - a variety of Tutorials, Examples and Documentation about Astropy.
- Python for Astronomers (free online textbook, which contains some tutorials/examples)
- Britt Lundgren's SciServer Based Astronomy Class - tested in an upper level astronomy class at UNC Asheville.
- Intro to Python by Colette Salyk: https://github.com/csalyk/python_tutorial/blob/master/python_tutorial.ipynb
- AstroEdu Package: https://github.com/astroDimitrios/astroedu
- Python Data Science - Github repository of this textbook by Jake VanderPlas
- Try out LSSGalPy for interactive visualisation: https://github.com/margudo/LSSGALPY
- NOIR Data Lab: https://datalab.noirlab.edu/docs/manual/UsingTheNOAODataLab/ScienceExamples