Skip to content

dnarayanan/live_dust_util

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

live_dust_util

live_dust_util is a tool to analyze dusty galaxies from AREPO simulations with live dust models and SMUGGLE stellar formation and feedback model in Python

Get

You can download it via

git clone https://github.com/lq3552/live_dust_util.git

Build

live_dust_util requires:

  • python(>=3.5)
  • numpy(>=1.12.0)
  • matplotlib(>=3.5.0)
  • yt(>=3.4.1)

You can install it by setup.py:

python -m pip install .

or, if you need root access,

sudo python -m pip install .

Basic usage

To extract extinction curves from GIZMO snapshots:

from live_dust_util import GrainSizeDistribution as GSD
from live_dust_util import ExtinctionLaw as Ext

snap_num = 0
snapshot = Snap(snap_num, "snap_dir")
gsd = GSD(snapshot, a = grain_size_bins, p_c = center_of_galaxy, r_s = radii_lower_bound, r_e = radii_upper_bound)
extinction_law = Ext(gsd, wavelength, 
					 op_a = "gain_size_bin_for_optical_properties.txt",
					 op_gra = "optical_properties_for_graphites.txt",
					 op_sil = "optical_properties_for_silicates.txt"
					)

or for snapshots written in parelell, if you want to load a specific sub-snapshot

snap_num = "0".zfill(3)
snap_rank = "1"
snapshot = Snap(snap_num + '.' + snap_rank, "snap_dir")

Combination of sub-snapshots is not yet supported.

To analyze dusty galaxy properties or statistics, such as the dust-mass function:

from live_dust_util import Galaxy
gal = Galaxy(snapshot, a = grain_size_bins, p_c = center_of_galaxy, r_s = radii_lower_bound, r_e = radii_upper_bound)
Md = gal.dataset["MassesByType"]["PartType3"]

To analyze radial profiles:

import live_dust_util.RadialProfile as RadP
rad_prof = RadP(snap, wavelength,
				a = grain_size_bins,
				op_a = "gain_size_bin_for_optical_properties.txt",
				op_gra = "optical_properties_for_graphites.txt",
				op_sil = "optical_properties_for_silicates.txt"
				p_c = center_of_galaxy,
				r_s = radii_lower_bound,
				r_e = radii_upper_bound,
				n_bins = n_bins
			   )
rad_bins = rad_prof.rad
rad_density = rad_prof.data_radial["GasDensity"]

Examples

For more practical examples, please refer to scripts in example

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%