Skip to main content

An all-sky 3D dust map based on Gaia and LAMOST.

Project description

Read this in: English | 中文

dustmaps3d

🌌 An all-sky 3D dust extinction map based on Gaia and LAMOST

📄 Wang et al. (2025), An all-sky 3D dust map based on Gaia and LAMOST
📌 DOI: 10.12149/101620

📦 A Python package for easy access to the 3D dust map
📌 DOI: 10.12149/101619


📦 Installation

Install via pip:

pip install dustmaps3d

Note: Installing the package does not include the data file.
The ~400 MB model data will be automatically downloaded from GitHub on first use.
⚠️ If you experience network issues when downloading from GitHub,
you can manually download the data from NADC:
🔗 https://nadc.china-vo.org/res/r101619/


🚀 Usage

from dustmaps3d import dustmaps3d

l = [120.0]
b = [30.0]
d = [1.5]

EBV, dust, sigma, max_d = dustmaps3d(l, b, d)

print(f"EBV: {EBV[0]:.4f} [mag]")
print(f"Dust: {dust[0]:.4f} [mag/kpc]")
print(f"Sigma: {sigma[0]:.4f} [mag]")
print(f"Max distance: {max_d.iloc[0]:.4f} kpc")

Batch example with FITS:

import numpy as np
from astropy.table import Table
from dustmaps3d import dustmaps3d

def main():
    data = Table.read('input.fits')   
    l = data['l'].astype(float)
    b = data['b'].astype(float)
    d = data['distance'].astype(float)

    # To enable multi-process parallelization, specify the 'n_process' parameter with the desired number of processes (e.g., n_process=4). If omitted, the function will run in single-threaded mode and does not require wrapping inside a main() function.
    EBV, dust, sigma, max_d = dustmaps3d(l, b, d, n_process=4)

    data['EBV_3d'] = EBV
    data['dust'] = dust
    data['sigma'] = sigma
    data['max_distance'] = max_d
    data.write('output.fits', overwrite=True)


# When using multiprocessing, wrap the main routine in this conditional statement to ensure compatibility with Windows operating system.
if __name__ == '__main__':
    main()

🧠 Function Description

dustmaps3d(l, b, d, n_process=None)

Estimates 3D dust extinction and related quantities for given galactic coordinates and distances.

Input Type Description Unit
l np.ndarray Galactic longitude degrees
b np.ndarray Galactic latitude degrees
d np.ndarray Distance kpc
n_process int, optional Number of processes for parallel computing

Returns:

Output Type Description Unit
EBV np.ndarray E(B–V) extinction mag
dust np.ndarray Dust density (d(EBV)/dx) mag/kpc
sigma np.ndarray Estimated uncertainty in E(B–V) mag
max_d np.ndarray Maximum reliable distance kpc

If d contains NaN, it will be automatically replaced by the maximum reliable distance along that line of sight (max_d).

If the input d exceeds max_d, it indicates the point lies beyond the model's reliable range. The returned values in this case are extrapolated and not guaranteed to be accurate.


⚡ Performance

  • Fully vectorized and optimized with NumPy
  • Supports multiprocessing with n_process argument
  • On a modern personal computer, evaluating 100 million stars takes only ~100 seconds

📂 Data Version

This version uses data_v2.1.parquet, released under v2.1


📜 Citation

If you use this model or the Python package, please cite both:

  • Wang, T. (2025), An all-sky 3D dust map based on Gaia and LAMOST. DOI: 10.12149/101620
  • dustmaps3d: A Python package for easy access to the 3D dust map. DOI: 10.12149/101619

🛠️ License

This project is open-source and distributed under the MIT License.


📫 Contact

If you have any questions, suggestions, or encounter issues using this package,
please feel free to contact the authors via GitHub issues or email.

🔗 GitHub Repository

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dustmaps3d-2.1.7.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dustmaps3d-2.1.7-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file dustmaps3d-2.1.7.tar.gz.

File metadata

  • Download URL: dustmaps3d-2.1.7.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for dustmaps3d-2.1.7.tar.gz
Algorithm Hash digest
SHA256 96e2f75fbcb22327a0303eebcc4855988e41b4f6652548a4a4f813fff45b06a6
MD5 493eeac436de584dbdf0fe48874a4bd1
BLAKE2b-256 a82d914e7b1fa5baf8c9b13f7b121109096b0058079a5171c3413de8145fef72

See more details on using hashes here.

File details

Details for the file dustmaps3d-2.1.7-py3-none-any.whl.

File metadata

  • Download URL: dustmaps3d-2.1.7-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for dustmaps3d-2.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6efcfa19c57c958be7d68f3b30900b7e18f3bfc7d4e955a0521f09f43c6772d0
MD5 90d538381244ccebff4ac4e545c137f2
BLAKE2b-256 80d311e3dc0333cbfa75777826fd5bd6fb48a60989112e0f8e0c67aba7fd67fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page