From 18c9a3c27e1e39e42b5390b42194e12d6875c282 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 24 Jun 2016 14:20:37 +0800 Subject: Add calc_mass_potential.py: currently only calculate the gas mass profile --- calc_mass_potential.py | 329 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 329 insertions(+) create mode 100755 calc_mass_potential.py diff --git a/calc_mass_potential.py b/calc_mass_potential.py new file mode 100755 index 0000000..22c3ccd --- /dev/null +++ b/calc_mass_potential.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python3 +# +# Weitian LI +# Created: 2016-06-24 +# Updated: 2016-06-24 +# + +""" +Calculate the (gas and gravitational) mass profile and gravitational +potential profile from the electron number density profile. +The temperature profile is required. + +References: +[1] Ettori et al, 2013, Space Science Review, 177, 119-154 + + +Sample configuration file: +------------------------------------------------------------ +## Configuration for `calc_mass_potential.py` +## Date: 2016-06-24 + +# redshift used for pixel to distance conversion +redshift = + +# electron density profile +ne_profile = ne_profile.txt + +# cooling function profile +cf_profile = coolfunc_profile.txt +# unit of the CF profile radius (default: pixel) +cf_unit = "pixel" + +# temperature profile +t_profile = t_profile.txt +# unit of the T profile radius (default: pixel) +t_unit = "pixel" + +# number of data points for the output profile calculation +num_dp = 100 + +# output gas mass profile +m_gas_profile = mass_gas_profile.txt + +------------------------------------------------------------ +""" + +import argparse + +import numpy as np +import astropy.units as au +import scipy.interpolate as interpolate +import scipy.integrate as integrate +from configobj import ConfigObj + +from astro_params import AstroParams, ChandraPixel +from projection import Projection + + +class DensityProfile: + """ + Utilize the 3D (electron number or gas mass) density profile to + calculate the following quantities: + * 2D projected surface brightness (requires cooling function profile) + * gas mass profile (integrated, M_gas(