Skip to content

lengoctram/DustPOL_py

Repository files navigation

title
DustPOL_py: a numerical modeling for linear dust polarization

DustPOL_py - numerical modelling - v1.8

DustPOL_py computes multi-wavelength polarization of starlight absorption and thermal dust emission based on:

  • Radiative Torque alignment (RAT-A)
  • Magnetically enhanced RAT (MRAT)
  • Radiative Torque Disruption (RAT-D)
  • Paramagnetic relaxation alignment (DG)

Features

  • Polarization spectra for diffuse ISM, molecular clouds, dense cores, protostars (POS and LOS).
  • Wavelength coverage: from far-UV to near-/mid-/far-IR and to submm bands
  • Built-in analysis and plotting routines.
  • High-performance computation (ProcessPoolExecutor or joblib), with fallbacks.
  • Flexible parameter overrides via code for fitting workflows.
  • Multiple grain compositions: silicate, graphite, PAH and astrodust, and their combinations.
  • Multiple grain size distributions: MRN, WD01, HD23

Manuals and GUI (not yet updated)

Installation

** It is recommended to use a virtual environment to prevent conflicts with existing Python packages. **

0- Silicon chip

conda create -n DustPOL_py
conda activate DustPOL_py
conda config --env --set subdir osx-arm64
conda install python=3.12 (and other libraries)

0- Intel chip

conda create -n DustPOL_py
conda activate DustPOL_py
conda config --env --set subdir osx-64
conda install python=3.12 (and other libraries)

1- Download the source files

  • Clone:

    git clone https://github.com/lengoctram/DustPOL_py.git

  • Or Download directly from github

2- Go to the directory

    cd DustPOL_py-main

3- From the terminal, type

  • recommended (if make works)

    make install
    
  • Note (to un-install)

    make clean 
    
  • or

    pip install .
    
  • or

    pip install -e .
    

Authors

Le Ngoc Tram, Hyeseung Lee, and Thiem Hoang

Contributors

Pham N. Diep, Nguyen B. Ngoc, Bao Truong, Ngan Lê

Dependencies

1- Python 3

2- Numpy

3- Matplotlib

4- Scipy

5- Astropy

6- Joblib for parallelization (installation: https://joblib.readthedocs.io/en/latest/installing.html)

7- Concurrency for parallelization

8- Pandas

Bugs

Please reach out to us at nle@strw.leidenuniv.nl

macOS multiprocessing notes

  • On macOS, Python might use “spawn”. Interactive IPython/Jupyter sessions may fail with ProcessPoolExecutor due to main.spec=None.
  • Solutions:
    • Run scripts as modules (python examples/4-2-basic_model_protostar_POS.py) under a main guard.
    • In interactive environments, the library can fallback to joblib backend='loky'.

More information and citations

1- Tram et al. (2025) https://www.aanda.org/articles/aa/pdf/2025/11/aa53917-25.pdf

2- Tram et al. (2024) https://www.aanda.org/articles/aa/pdf/2024/09/aa50127-24.pdf

3- Tram et al. (2021) https://ui.adsabs.harvard.edu/abs/2021ApJ...906..115T

4- Lee et al. (2020) https://ui.adsabs.harvard.edu/abs/2020ApJ...896...44L

Special thanks

L. Tram wishes to express his gratitude to Prof. Karl M. Menten and Dr. Yannick Giraud-Heraud, who have sadly passed away, for their support and encouragement.

About

numerical modelling (source code)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors