All Projects → jobovy → mwdust

jobovy / mwdust

Licence: BSD-3-Clause License
Dust maps in the Milky Way

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to mwdust

astrodash
Deep learning for the automated spectral classification of supernovae
Stars: ✭ 25 (+19.05%)
Mutual labels:  astronomy, astrophysics
naima
Derivation of non-thermal particle distributions through MCMC spectral fitting
Stars: ✭ 32 (+52.38%)
Mutual labels:  astronomy, astrophysics
sncosmo
Python library for supernova cosmology
Stars: ✭ 53 (+152.38%)
Mutual labels:  astronomy, astrophysics
ldtk
Python toolkit for calculating stellar limb darkening profiles and model-specific coefficients using the stellar atmosphere spectrum library by Husser et al. (2013). Described in Parviainen & Aigrain, MNRAS 453, 3821–3826 (2015).
Stars: ✭ 26 (+23.81%)
Mutual labels:  astronomy, astrophysics
PandExo
A Community Tool for Transiting Exoplanet Science with the JWST & HST
Stars: ✭ 23 (+9.52%)
Mutual labels:  astronomy, astrophysics
Virgo
📡 Virgo: A Versatile Spectrometer for Radio Astronomy
Stars: ✭ 85 (+304.76%)
Mutual labels:  astronomy, astrophysics
amuse
Astrophysical Multipurpose Software Environment. This is the main repository for AMUSE
Stars: ✭ 115 (+447.62%)
Mutual labels:  astronomy, astrophysics
heyoka.py
Python library for ODE integration via Taylor's method and LLVM
Stars: ✭ 45 (+114.29%)
Mutual labels:  astronomy, astrophysics
nmmn
Miscellaneous methods for: astronomy, dealing with arrays, statistical distributions, computing goodness-of-fit, numerical simulations and much more
Stars: ✭ 16 (-23.81%)
Mutual labels:  astronomy, astrophysics
yt astro analysis
yt astrophysical analysis modules
Stars: ✭ 18 (-14.29%)
Mutual labels:  astronomy, astrophysics
heyoka
C++ library for ODE integration via Taylor's method and LLVM
Stars: ✭ 151 (+619.05%)
Mutual labels:  astronomy, astrophysics
phantom
Phantom Smoothed Particle Hydrodynamics and Magnetohydrodynamics code
Stars: ✭ 52 (+147.62%)
Mutual labels:  astronomy, astrophysics
astromodels
Spatial and spectral models for astrophysics
Stars: ✭ 21 (+0%)
Mutual labels:  astronomy, astrophysics
OACAPI
Open Astronomy Catalog API
Stars: ✭ 58 (+176.19%)
Mutual labels:  astronomy
QLFits
The macOS quicklook plugin for FITS files.
Stars: ✭ 44 (+109.52%)
Mutual labels:  astronomy
kaggle-plasticc
Solution to Kaggle's PLAsTiCC Astronomical Classification Competition
Stars: ✭ 50 (+138.1%)
Mutual labels:  astronomy
bifrost
A stream processing framework for high-throughput applications.
Stars: ✭ 48 (+128.57%)
Mutual labels:  astronomy
school2021
ESCAPE Summer School 2021
Stars: ✭ 241 (+1047.62%)
Mutual labels:  astronomy
Comet
A complete VOEvent transport system
Stars: ✭ 20 (-4.76%)
Mutual labels:  astronomy
UnitfulAstro.jl
An extension of Unitful.jl for astronomers.
Stars: ✭ 18 (-14.29%)
Mutual labels:  astronomy

mwdust

Dust in 3D in the Milky Way

Installation

Please define an environment variable DUST_DIR before installing the code; this is a directory that will contain the dust data.

Standard python setup.py build/install

Either

sudo python setup.py install

or

python setup.py install --prefix=/some/directory/

The installation automatically downloads the relevant dust data. You might have to define an environment variable SUDO_USER if not installing with sudo and you might have to use the -E option when you are installing with sudo to transfer your environment variables to sudo.

Dust Data

The code can automatically download all of the necessary data. By default, only the most commonly-used dust maps are downloaded; to download all maps, use the --all-downloads installation option (you can just re-run the installation with this option to add this later). The installation option --no-downloads turns all downloads off.

The data are put in subdirectories of a directory DUST_DIR, with roughly the following lay-out:

$DUST_DIR/
   combined15/
      dust-map-3d.h5
   combined19/
      combine19.h5
   green15/
      dust-map-3d.h5
   green17/
      bayestar2017.h5
   green19/
      bayestar2019.h5
   maps/
      SFD_dust_4096_ngp.fits
      SFD_dust_4096_sgp.fits
   marshall06/
      ReadMe
      table1.dat
   sale14/
      Amap.dat
      ReadMe

The data for the Drimmel et al. (2003) map is installed in the code directory, because it is not very large.

Usage

All of the maps can be initialized similar to:

import mwdust
drimmel= mwdust.Drimmel03(filter='2MASS H')
combined= mwdust.Combined15(filter='2MASS H')
combined19= mwdust.Combined19(filter='2MASS H')
sfd= mwdust.SFD(filter='2MASS H')

which sets up the Drimmel et al. (2003) map, the combined Bovy et al. (2016) map, an updated version of the combined map using the Green et al. (2019) Bayestar19 map, and the SFD map for the H-band filter. The maps can be evaluate for a given Galactic longitude l, Galactic latitude b, and an array (or scalar) of distances D:

drimmel(60.,0.,3.) # inputs are (l,b,D)
array([ 0.38813341])
combined(30.,3.,numpy.array([1.,2.,3.,10.]))
array([ 0.22304147,  0.55687252,  0.86694602,  1.18779507])
# SFD is just the constant SFD extinction
sfd(30.,3.,numpy.array([1.,2.,3.]))
array([ 1.19977335,  1.19977335,  1.19977335])

and they can be plotted as a function of distance at a given (l,b):

combined.plot(55.,0.5) # inputs are (l,b)

(plot not shown). Maps that are derived from the HierarchicalHealpixMap.py class (currently all Green-type maps and the combined maps) can also be plotted on the sky using a Mollweide projection at a given distance using:

combined.plot_mollweide(5.) # input is distance in kpc

Supported bandpasses

Currently only a few filters are supported; if no filter is supplied, E(B-V) is returned on the SFD scale if the object is initialized with sf10=True (which tells the code to use re-scalings from Schlafly & Finkbeiner 2011). sf10=True is the default initialization for every map, so be careful in interpreting the raw E(B-V) that come out of the code. Only use sf10=False when you have an extinction map in true E(B-V), not SFD E(B-V). No map currently included in this package is in this situation, so using sf10=False is never recommended.

To check what bandpasses are supported on the sf10=True scale do (these are all the bandpasses from Table 6 in Schlafly & Finkbeiner 2011):

from mwdust.util import extCurves
extCurves.avebvsf.keys()

which gives:

['Stromgren u',
 'Stromgren v',
 'ACS clear',
 'CTIO R',
 'CTIO V',
 'CTIO U',
 'CTIO I',
 ...]

To check the bandpasses that are supported on the old SFD scale (sf10=False), do:

numpy.array(extCurves.avebv.keys())[True-numpy.isnan(extCurves.avebv.values())]

which gives:

array(['CTIO R', 'CTIO V', 'CTIO U', 'CTIO I', 'CTIO B', 'DSS-II i',
 'DSS-II g', 'WISE-1', 'WISE-2', 'DSS-II r', 'UKIRT H', 'UKIRT J',
 'UKIRT K', 'IRAC-1', 'IRAC-2', 'IRAC-3', 'IRAC-4', '2MASS H',
 'SDSS r', 'SDSS u', 'SDSS z', 'SDSS g', 'SDSS i', '2MASS Ks',
 '2MASS J'],
dtype='|S14'

Acknowledgements

When making use of this code in a publication, please cite Bovy et al. (2015a). Also cite the relevant papers for the dust map that you use:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].