Skip to main content

A code for modeling spinning dust radiation

Project description

SpyDust

SpyDust is an advanced Python package for modeling spinning dust radiation in astrophysical environments. Building upon previous models (the IDL SPDUST), SpyDust offers enhanced capabilities and corrections, making it a valuable tool for researchers in astrophysics and related fields.

For a detailed understanding of the underlying models and theoretical background, refer to the publication: SpyDust: an improved and extended implementation for modeling spinning dust radiation.


Features

  • Comprehensive Grain Shape Modeling: Considers a wide range of grain geometries, providing corresponding grain dynamics, directional radiation fields, and angular momentum transports.

  • Updated Physical Processes: Incorporates corrections and extensions, including updated expressions for the effects of electrical dipole radiation back-reaction and plasma drag on angular momentum dissipation.

  • Parallisation: Functions can be run in parallel (implemented by mpi4py) by simply setting the corresponding keyword to True.

  • SPDUST as is mode: Provides a submodule, SPDUST_as_is, which is exactly the full equivalent of the IDL spdust. Just in case the user wants to stick with the spdust simulation.

  • Example notebooks: Provide some Jupyter notebooks to help users get started with this package.


Requirements

SpyDust requires Python 3.7 or higher (up to Python 3.9) and the following dependencies:

Required:

  • numpy
  • scipy
  • mpi4py

Optional:

  • pandas: This is not needed for spinning dust spectra, but if free free emission is also desired (using free_free.py), then it is needed.

Installation

You can install SpyDust using pip:

pip install SpyDust --no-deps

Otherwise, you can directly `git clone' this repo and set up the environment by yourself.


Usage

Import the package in your project and explore its functionalities for modeling spinning dust radiation. Data files required for computations are bundled with the package.


Example usage:

Here is an example of using the `SpyDust.SpyDust' function to generate a spectrum for a sample CNM environment:

CNM_params = {'nh' : 30, 'T': 100., 'Chi': 1, 'xh': 1.2e-3, 'xC': 3e-4, 'y' : 0, 'gamma': 0, 'dipole': 9.3, 'line':7}

# The parameters are as follows: 
# 'nH': total hydrogen number density (cm3), 
# 'T': gas temperature (K), 
# 'chi': intensity of the radiation field relative to the average interstellar radiation field, 
# 'xh': hydrogen ionization fraction, 
# 'xC': ionized carbon fractional abundance, 
# 'y': molecular hydrogen fractional abundance, 
# 'gamma': H2 formation efficiency, 
# 'dipole': rms dipole moment for dust grains.

min_freq=1 # in GHz
max_freq=300 # in GHz
n_freq=500

spectrum = SpyDust.SpyDust(CNM_params, min_freq=min_freq, max_freq=max_freq, n_freq=n_freq, single_beta=True)
# Here the boolean keyword `single_beta' means: for any given grain size, consider only one value of the shape parameter beta.

Instead of using the SpyDust rotation distribution method described in the paper, you can generate spectra using your own arbitrary distributions of configuration parameters as inputs to the `SpyDust.SED' function.


Resources


History

  • Version 1.0.0: Initial release of SpyDust, introducing comprehensive grain shape modeling, updated physical processes, and degeneracy analysis tools.

  • Version 1.0.1: Numba dependency removed and installation issues fixed.

TODO (Future Versions)

  • Future upgrades will include features such as the SED fitting tool (based on perturbation statistics tools like moment expansion) and improve the treatment of the grain rotation distribution.

Resources

  • Author: Zheng Zhang
  • License: This project is licensed under the MIT License - see the LICENSE file for details.
  • Collaboration: SpyDust GitHub Collaboration
  • Spdust Documentation: We refer users to the website of spdust for better documentation of environmental parameters

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

spydust-1.2.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

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

spydust-1.2-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file spydust-1.2.tar.gz.

File metadata

  • Download URL: spydust-1.2.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spydust-1.2.tar.gz
Algorithm Hash digest
SHA256 cc7eed935c51aa6adaac92b4f97d4f51a4b3ace2d191fab6d9a66df6e22986f9
MD5 2ee933b12708a55113e4e89b31cffc79
BLAKE2b-256 80ad3455c97878b26292aeb73045912c6788a8efcde5dabced15b23b8194ccdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for spydust-1.2.tar.gz:

Publisher: python-publish.yml on SpyDust/SpyDust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spydust-1.2-py3-none-any.whl.

File metadata

  • Download URL: spydust-1.2-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spydust-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dfe107e5e2b51f6a06b5893e03c9ded603235f9f8448d37a7f22c86c99de0537
MD5 d90268b806a609af0d4d8a9f3171c3fd
BLAKE2b-256 2bb0c71f47375947ca47c37111bf0bba19d2136061d449c3633cb9f8757443d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for spydust-1.2-py3-none-any.whl:

Publisher: python-publish.yml on SpyDust/SpyDust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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