示例#1
0
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()
    ax.scatter(denEM[los],
示例#2
0
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
示例#3
0
import numpy as np
import pandas as pd

from nebulous.geom import sphere
from nebulous.cel import cel_tem_dict
from nebulous.orl import orl_dict
from nebulous.pdf import pdfs
from nebulous.utils import getDepth
from nebulous.misc import fix_params, mkdir

# ==================================================
# set the nebula parameters
# ==================================================
dim = (30, 30, 30)
loc = sphere(dim=dim, inRad=0.3, outRad=0.9)
depth = getDepth(loc=loc, dim=dim)
los = depth > 5


# ==================================================
# Function that runs the simulation
# ==================================================
def simul(ion, pdf, params, tem_mean, den_mean, grid=25, convl=True, kernel=1):

    # ==================================================
    # Grab the appropriate diagnostic
    # ==================================================
    if ion in cel_tem_dict.keys():
        ion_tem = cel_tem_dict[ion]
    elif ion == 'BJ':
        ion_tem = orl_dict[ion]