コード例 #1
0
ファイル: ADF_SkyMap.py プロジェクト: bbergerud/Nebularium
import sys
sys.path.append('..')
import matplotlib.pyplot as plt
import numpy as np
from nebulous.geom import sphere
from nebulous.cel import cel_den_dict, cel_tem_dict
from nebulous.orl import orl_dict
from nebulous.misc import den_dict, fix_params, mkdir
from nebulous.pdf import pdfs
from nebulous.utils import getDepth

# ==================================================
# Set the nebula parameters
# ==================================================
dim = (30, )
loc = sphere(dim=dim, inRad=0.0, outRad=0.9)
los = getDepth(loc=loc, dim=dim) > 5
convl = False
kernel = 2
den_mean = 1000
tem_mean = 10e3
p = {'sigma': 0.8}
pdf = 'lognormal'
cel_tem = None
cel_den = 'OIII'
orl = 'OII'

# ==================================================
# ==================================================
n_e = pdfs[pdf](dim=dim, loc=loc, mean=den_mean, **p)
tem = tem_mean
コード例 #2
0
plt.rc('text', usetex=True)
title = r"$\mathrm{Exponential \, Distribution}$" + "\n" + r"$\bar{n}_{e} \approx 1000 \, \mathrm{cm}^{-3}$"
xlabel = r"$n_{e} \, \rm\left(cm^{-3}\right) \, [EM]$"
ylabel = r"$n_{e} \, \rm\left(cm^{-3}\right) \, [S \, \textsc{ii}]$"

from nebulous.geom import sphere
from nebulous.cel import cel_den_dict
from nebulous.pdf import pdfs
from nebulous.em import getEM, getSkyDenEM
from nebulous.utils import getDepth

dim = (30, )

fig, ax = plt.subplots(figsize=(6.5, 6))
for inrad, c in zip([0., 0.3, 0.6], ['orange', 'dodgerblue', 'forestgreen']):
    loc = sphere(dim=dim, inRad=inrad)
    depth = getDepth(dim=dim, loc=loc) * 1.
    los = depth > 5

    tem = 10e3
    n_e = pdfs['exponential'](dim=dim, loc=loc, mean=1e3)

    s2 = cel_den_dict['SII']
    s2.getEmissivity(tem=tem, n_e=n_e, loc=loc)
    s2.getSkyEmiss()
    s2.getSkyDen()

    em = getEM(n_e=n_e)
    denEM = getSkyDenEM(em, depth)

    #fig, ax = plt.subplots()