Installation

There are two ways to install dustmaps.

1. Using pip

From the commandline, run

pip install dustmaps

You may have to use sudo.

Next, we’ll configure the package and download the dust maps we’ll want to use. Start up a python interpreter and type:

from dustmaps.config import config
config['data_dir'] = '/path/to/store/maps/in'

import dustmaps.sfd
dustmaps.sfd.fetch()

import dustmaps.planck
dustmaps.planck.fetch()

import dustmaps.bayestar
dustmaps.bayestar.fetch()

import dustmaps.iphas
dustmaps.iphas.fetch()

import dustmaps.marshall
dustmaps.marshall.fetch()

import dustmaps.chen2014
dustmaps.chen2014.fetch()

import dustmaps.lenz2017
dustmaps.lenz2017.fetch()

All the dust maps should now be in the path you gave to config['data_dir']. Note that these dust maps can be very large - some are several Gigabytes! Only download those you think you’ll need.

Note that there are two versions of the Bayestar dust map. By default, dustmaps.bayestar.fetch() will download Bayestar17 (Green et al. 2018). In order to download the earlier version of the map (Green et al. 2015), you can call dustmaps.bayestar.fetch(version='bayestar2015').

2. Using setup.py

An alternative way to download dustmaps, if you don’t want to use pip, is to download or clone the respository from https://github.com/gregreen/dustmaps.

In this case, you will have to manually make sure that the dependencies are satisfied:

  • numpy
  • scipy
  • astropy
  • h5py
  • healpy
  • requests
  • six
  • progressbar2

These packages can typically be installed using the Python package manager, pip.

Once these dependencies are installed, run the following command from the root directory of the dustmaps package:

python setup.py install --large-data-dir=/path/to/store/maps/in

Then, fetch the maps you’d like to use. Depending on which dust maps you choose to download, this step can take up several Gigabytes of disk space. Be careful to only download those you think you’ll need:

python setup.py fetch --map-name=sfd
python setup.py fetch --map-name=planck
python setup.py fetch --map-name=bayestar
python setup.py fetch --map-name=iphas
python setup.py fetch --map-name=marshall
python setup.py fetch --map-name=chen2014
python setup.py fetch --map-name=lenz2017

That’s it!

Note that the above code will download the latest version of the Bayestar dust map (the 2017 version). If you want to download the 2015 version, you can enter the command

python setup.py fetch --map-name=bayestar2015