{"id":22215697,"url":"https://github.com/jobovy/mwdust","last_synced_at":"2026-01-21T17:09:48.812Z","repository":{"id":12065265,"uuid":"14652050","full_name":"jobovy/mwdust","owner":"jobovy","description":"Dust maps in the Milky Way","archived":false,"fork":false,"pushed_at":"2025-03-03T14:58:00.000Z","size":243,"stargazers_count":38,"open_issues_count":3,"forks_count":14,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T07:08:19.280Z","etag":null,"topics":["astronomy","astrophysics","dust","extinction","milky-way","python"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"lostdecade/simple_canvas_game","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jobovy.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-23T22:57:28.000Z","updated_at":"2025-03-03T14:58:04.000Z","dependencies_parsed_at":"2023-01-13T16:46:36.405Z","dependency_job_id":"434a070b-26cc-4e81-a755-40e8d75597f9","html_url":"https://github.com/jobovy/mwdust","commit_stats":{"total_commits":207,"total_committers":8,"mean_commits":25.875,"dds":0.5555555555555556,"last_synced_commit":"c9250e1c038beb77b9939043a1bcf01a73a8ddeb"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobovy%2Fmwdust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobovy%2Fmwdust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobovy%2Fmwdust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobovy%2Fmwdust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jobovy","download_url":"https://codeload.github.com/jobovy/mwdust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451653,"owners_count":20940939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronomy","astrophysics","dust","extinction","milky-way","python"],"created_at":"2024-12-02T21:42:28.412Z","updated_at":"2026-01-21T17:09:48.805Z","avatar_url":"https://github.com/jobovy.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"mwdust\n======\n\n**Dust in 3D in the Milky Way**\n\n.. image:: https://github.com/jobovy/mwdust/workflows/build/badge.svg\n   :target: https://github.com/jobovy/mwdust/actions?query=workflow%3Abuild\n\n.. image:: http://img.shields.io/pypi/v/mwdust.svg\n   :target: https://pypi.python.org/pypi/mwdust/\n\n.. image:: http://img.shields.io/badge/license-New%20BSD-brightgreen.svg\n   :target: https://github.com/jobovy/mwdust/blob/main/LICENSE\n\n.. image:: http://img.shields.io/badge/DOI-10.3847/0004%2D%2D637X/818/2/130-blue.svg\n   :target: https://doi.org/10.3847/0004-637X/818/2/130\n\n| \n\n.. contents:: **Contents**\n    :depth: 3\n\nInstallation\n-------------\n\nInstall the latest released version using ``pip``:\n\n..  code-block::\n\n   pip install mwdust\n\nTo install the latest development version, clone the repository and do\n\n..  code-block::\n\n   python setup.py install\n\nor \n\n..  code-block::\n\n   python setup.py install --user\n\nUsing custom implementations of necessary HEALPIx functions, basic \nevaluation of extinction is available on all platforms (Linux, Mac OS,\nWindows) for all dust maps. However, some HEALPIx-based features like \nplotting require ``healpy``, which is unavailable on Windows.\nInstall on Linux/Mac OS for full functionality.\n\nDust Data\n---------\n\nBy default, dust maps are download when you use them for the first time. \nIf you define an environment variable ``DUST_DIR``, then all dust data\ndownloaded by the code will be downloaded to this directory. If you do not\nset the ``DUST_DIR`` variable, then ``mwdust`` will download data to ``~/.mwdust``. \n\nThe code can download all of the necessary data at by running\n\n..  code-block:: python\n\n   from mwdust import download_all\n   download_all()\n\nNote that some of the maps are very large (multiple GB) and some of the downloads \nare slow, so this may take a while.\n\nThe data are put in subdirectories of a directory ``DUST_DIR`` or ``~/.mwdust``, with\nroughly the following lay-out::\n\n    $DUST_DIR/\n       combined15/\n          dust-map-3d.h5\n       combined19/\n          combine19.h5\n       green15/\n          dust-map-3d.h5\n       green17/\n          bayestar2017.h5\n       green19/\n          bayestar2019.h5\n       zucker25/\n      \t  decaps_mean.h5\n          decaps_mean_and_samples.h5\n       maps/\n          SFD_dust_4096_ngp.fits\n          SFD_dust_4096_sgp.fits\n       marshall06/\n          ReadMe\n\t       table1.dat\n       sale14/\n          Amap.dat\n          ReadMe\n\nThe data for the Drimmel et al. (2003) map is installed in the code\ndirectory, because it is not very large.\n\nUsage\n------\n\nAll of the maps can be initialized similar to\n\n..  code-block:: python\n\n   import mwdust\n   drimmel= mwdust.Drimmel03(filter='2MASS H')\n   combined= mwdust.Combined15(filter='2MASS H')\n   combined19= mwdust.Combined19(filter='2MASS H')\n   sfd= mwdust.SFD(filter='2MASS H')\n\nwhich sets up the Drimmel et al. (2003) map, the combined Bovy et\nal. (2016) map, an updated version of the combined map using the Green\net al. (2019) Bayestar19 map, and the SFD map for the *H*-band\nfilter. The maps can be evaluate for a given Galactic longitude *l*,\nGalactic latitude *b*, and an array (or scalar) of distances *D*\n\n..  code-block:: python\n\n   drimmel(60.,0.,3.) # inputs are (l,b,D)\n   array([ 0.38813341])\n   combined(30.,3.,numpy.array([1.,2.,3.,10.]))\n   array([ 0.22304147,  0.55687252,  0.86694602,  1.18779507])\n   # SFD is just the constant SFD extinction\n   sfd(30.,3.,numpy.array([1.,2.,3.]))\n   array([ 1.19977335,  1.19977335,  1.19977335])\n\nand they can be plotted as a function of distance at a given (l,b)\n\n..  code-block:: python\n\n   combined.plot(55.,0.5) # inputs are (l,b)\n\n(plot not shown). Maps that are derived from the ``HierarchicalHealpixMap.py`` class (currently all Green-type maps and\nthe combined maps) can be vectorized to evaluate on array inputs of *l*, *b*, *D*\n\n..  code-block:: python\n\n   combined(numpy.array([30.,40.,50.,60.]),numpy.array([3.,4.,3.,6.]),numpy.array([1.,2.,3.,10.]))\n   array([0.22304147, 0.3780736 , 0.42528571, 0.22258065])\n\nThey can also be plotted on the sky using a Mollweide projection at a given distance using\n\n..  code-block:: python\n\n   combined.plot_mollweide(5.) # input is distance in kpc\n\nNote that this requires ``healpy`` to be installed, so this does not work on Windows.\n\nSupported bandpasses\n---------------------\n\nCurrently only a few filters are supported. \nTo obtain E(B-V), specify ``filter='E(B-V)'``.\nTo check what bandpasses are supported on the ``sf10=True`` scale\n(these are all the bandpasses from Table 6 in `Schlafly \u0026 Finkbeiner\n2011 \u003chttp://adsabs.harvard.edu/abs/2011ApJ...737..103S\u003e`__), do\n\n..  code-block:: python\n\n   from mwdust.util import extCurves  \n   extCurves.avebvsf.keys()\n\nwhich gives\n\n..  code-block:: python\n\n   ['Stromgren u',\n      'Stromgren v',\n      'ACS clear',\n      'CTIO R',\n      'CTIO V',\n      'CTIO U',\n      'CTIO I',\n      ...]\n\nTo check the bandpasses that are supported on the old SFD scale (``sf10=False``), do\n\n..  code-block:: python\n\n   numpy.array(extCurves.avebv.keys())[True-numpy.isnan(extCurves.avebv.values())]\n\nwhich gives\n\n..  code-block:: python\n\n   array(['CTIO R', 'CTIO V', 'CTIO U', 'CTIO I', 'CTIO B', 'DSS-II i',\n      'DSS-II g', 'WISE-1', 'WISE-2', 'DSS-II r', 'UKIRT H', 'UKIRT J',\n      'UKIRT K', 'IRAC-1', 'IRAC-2', 'IRAC-3', 'IRAC-4', '2MASS H',\n      'SDSS r', 'SDSS u', 'SDSS z', 'SDSS g', 'SDSS i', '2MASS Ks',\n      '2MASS J'], dtype='|S14')\n\n\nIf no filter is supplied, *E(B-V)* is returned on the SFD scale if the object is initialized\nwith ``sf10=True`` (which tells the code to use re-scalings from\n`Schlafly \u0026 Finkbeiner 2011\n\u003chttp://adsabs.harvard.edu/abs/2011ApJ...737..103S\u003e`__). ``sf10=True``\nis the default initialization for every map, so be careful in\ninterpreting the raw *E(B-V)* that come out of the code when \nnot setting ``filter`` or when setting ``filter=None``. *Only use*\n``sf10=False`` *when you have an extinction map in true E(B-V)*, **not**\n*SFD E(B-V)*. No map currently included in this package is in this\nsituation, so using ``sf10=False`` is never recommended.\n\nAcknowledging ``mwdust`` and its data\n---------------------------------------\n\nWhen making use of this code in a publication, please cite `Bovy et\nal. (2015a) \u003chttp://arxiv.org/abs/1509.06751\u003e`__. Also cite the relevant papers for the dust\nmap that you use:\n\n* **mwdust.SFD**: `Schlegel et al. (1998) \u003chttp://adsabs.harvard.edu/abs/1998ApJ...500..525S\u003e`__\n\n* **mwdust.Drimmel03**: `Drimmel et al. (2003) \u003chttp://adsabs.harvard.edu/abs/2003A%26A...409..205D\u003e`__\n\n* **mwdust.Marshall06**: `Marshall et al. (2006) \u003chttp://adsabs.harvard.edu/abs/2006A%26A...453..635M\u003e`__\n\n* **mwdust.Sale14**: `Sale et al. (2014) \u003chttp://adsabs.harvard.edu/abs/2014MNRAS.443.2907S\u003e`__\n\n* **mwdust.Green15**: `Green et al. (2015) \u003chttps://ui.adsabs.harvard.edu/abs/2015ApJ...810...25G\u003e`__\n\n* **mwdust.Green17**: `Green et al. (2018) \u003chttps://ui.adsabs.harvard.edu/abs/2018MNRAS.478..651G\u003e`__ (added by `@jan-rybizki \u003chttps://github.com/jan-rybizki\u003e`__)\n\n* **mwdust.Green19**: `Green et al. (2019) \u003chttps://ui.adsabs.harvard.edu/abs/2019arXiv190502734G\u003e`__ (added by `@jan-rybizki \u003chttps://github.com/jan-rybizki\u003e`__)\n\n* **mwdust.Zucker25**: `Zucker et al. (2025) \u003chttps://ui.adsabs.harvard.edu/abs/2025arXiv250302657Z\u003e`__\n\n* **mwdust.Combined15**: Combination of \n  \n  * `Marshall et al. (2006) \u003chttp://adsabs.harvard.edu/abs/2006A%26A...453..635M\u003e`__ (**mwdust.Marshall06**),\n  * `Green et al. (2015) \u003chttp://adsabs.harvard.edu/abs/2015arXiv150701005G\u003e`__ (**mwdust.Green15**), and \n  * `Drimmel et al. (2003) \u003chttp://adsabs.harvard.edu/abs/2003A%26A...409..205D\u003e`__ (**mwdust.Drimmel03**); \n  \n  see `Bovy et al. (2015a) \u003chttp://adsabs.harvard.edu/abs/2015arXiv150906751B\u003e`__.\n\n* **mwdust.Combined19**: Similar to **mwdust.Combined15**, but using **mwdust.Green19** instead of **mwdust.Green15**; see `Bovy et al. (2015a) \u003chttp://adsabs.harvard.edu/abs/2015arXiv150906751B\u003e`__ for details on the combination (added by `@jan-rybizki \u003chttps://github.com/jan-rybizki\u003e`__)\n\n* **mwdust.Zero**: `Bovy et al. (2015b) \u003chttp://adsabs.harvard.edu/abs/2015arXiv150905796B\u003e`__ :smirk:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjobovy%2Fmwdust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjobovy%2Fmwdust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjobovy%2Fmwdust/lists"}