Package: pygdsm
PyGDSMPyGDSMis a Python interface for global diffuse sky models: all-sky maps in Healpix format of diffuse Galactic radio emission.This package includes interfaces to:GSM2008:A model of diffuse Galactic radio emission from 10 MHz to 100 GHz,Oliveira-Costa et. al., (2008).GSM2016:An improved model of diffuse galactic radio emission from 10 MHz to 5 THz,Zheng et. al., (2016).LFSS:The LWA1 Low Frequency Sky Survey (10-408 MHz)Dowell et. al. (2017).Haslam:A frequency-scaled model using a spectral index, based on theHaslam 408 MHzall-sky map.In general, these arenotwrappers of the original code (GSM2008 was written in Fortan and GSM2016 in C); instead they provides a uniform API with some additional features and advantages, such as healpy integration for imaging, and sky rotation for observed skies.QuickstartThe first thing to do will be to make sure you've got the dependencies:numpyscipyhealpyh5pyastropyThen you should be able to install with:pip install git+https://github.com/telegraphic/pygdsmAlternatively, clone the directory:git clone https://github.com/telegraphic/pygdsmAn runpip install .. On first run, the sky model data will be downloaded from Zenodo / LAMBDA. These are about 500 MB total, and will be downloaded into your astropy cache (~/.astropy/). The data are hosted onZenodo.ExamplesTo get a quick feel of whatPyGDSMdoes, have a look at theGSM2008 quickstart guide, and the newGSM2016 quickstart guide.Q & AQ. What's the difference between this and thegsm.ffrom the main GSM2008 website?Thegsm.fis a very basic Fortran code, which reads and writes values to and from
ASCII files, and uses a command line interface for input. If you want to run this code
on an ancient computer with nothing but Fortran installed, thengsm.fis the way to go.
In contrast,PyGDSMis a Python code that leverages a lot of other Packages so that you
can do more stuff more efficiently. For example: you can view a sky model in a healpy
image; you can write a sky model to a Healpix FITS file; and believe it or not, the
Python implementation ismuch faster. Have a look at thequickstart guideto get a feel for whatPyGDSMdoes.Q. Are the outputs ofgsm.fandpygdsmidentical?.NO. The cubic  spline interpolation implementation differs, so values will differ by as
much as a few percent. The interpolation code used ingsm.fdoes not have an open-source
license (it's fromNumerical Recipes), so we haven't
implemented it (one could probably come up with an equivalent that didn't infringe).
Nevertheless, the underlying PCA data are identical, and I've run tests to check that
the two outputs are indeed comparable.Q. What's the difference between this and theZheng et. al. github repo?pygdsmprovides two classes:GlobalSkyModel16()andGSMObserver16(), which once instantiated
provide methods for programatically generating sky models. The Zheng et. al. github repo is a
simple, low-dependency, command line tool. As of PyGDSM 1.4.0, we have implemented improved interpolation
via cubic spline or PCHIP, which avoids discontinuities identified using the 2016 method. Have a look at theGSM2016 quickstart guideto get a feel for whatPyGDSMdoes.Q. Why does this package download so much data when first run?The package size is dominated by the PCA healpix maps, which have about 3 million points each.
They're compressed using HDF5 LZF, so are actually about 3x smaller than the*.datfiles that come in the originalgsm.tar.gzfile. The next biggest thing is test data,
so that the output can be compared against precomputed output fromgsm.f. The package now also includes
the Zheng et. al. data, which is another ~300 MB.ReferencesThe sky model data contained here is from:GSM2008http://space.mit.edu/~angelica/gsm/index.html(link no longer active)GSM2016https://github.com/jeffzhen/gsm2016LFSShttps://lda10g.alliance.unm.edu/LWA1LowFrequencySkySurvey/Haslamhttps://lambda.gsfc.nasa.gov/product/foreground/fg_2014_haslam_408_info.cfmA model of diffuse Galactic radio emission from 10 MHz to 100 GHz
A. de Oliveira-Costa, M. Tegmark, B.M. Gaensler, J. Jonas, T.L. Landecker and P. Reich
MNRAS 388, 247-260 (2008)
https://ui.adsabs.harvard.edu/abs/2008MNRAS.388..247D/abstract

An Improved Model of Diffuse Galactic Radio Emission from 10 MHz to 5 THz
H. Zheng, M. Tegmark, J. Dillon, A. Liu, A. Neben, J. Jonas, P. Reich, W.Reich
MNRAS, 464, 3, 3486-3497 (2017)
https://ui.adsabs.harvard.edu/abs/2017MNRAS.464.3486Z/abstract

The LWA1 Low Frequency Sky Survey
J. Dowell, G. B. Taylor, F. Schinzel, N. E. Kassim, K. Stovall
MNRAS, 469, 4, 4537-4550 (2017)
https://ui.adsabs.harvard.edu/abs/2017MNRAS.469.4537D/abstract

An improved source-subtracted and destriped 408-MHz all-sky map 
M. Remazeilles, C. Dickinson,A.J. Banday,  M. Bigot-Sazy, T. Ghosh
MNRAS 451, 4, 4311-4327 (2014)
https://ui.adsabs.harvard.edu/abs/2015MNRAS.451.4311R/abstractPyGSDM has anascl.net entry:D. C. Price, 2016, 2.0.0, Astrophysics Source Code Library, 1603.013LicenseAllcodein PyGDSM is licensed under the MIT license (not the underlyingdata).
The PCA data, by Zheng et. al. is licensed under MIT also (seehttps://github.com/jeffzhen/gsm2016).