Skip to content

Commit

Permalink
Merge branch 'main' into investigate_continuum_deficit
Browse files Browse the repository at this point in the history
  • Loading branch information
jvshields authored Feb 12, 2024
2 parents 6e5911d + 348be6a commit d8d4ce8
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 43 deletions.
Binary file modified docs/physics/media/bound_free_absorbtion-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions docs/physics/media/bound_free_absorbtion.tex
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
\documentclass[convert,tikz]{standalone}
\documentclass[convert,margin=5mm,tikz]{standalone}
\usepackage{tikz-feynman}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\filldraw[fill=blue, draw=blue, outer sep = 3px] (0,0) circle (15px) node[label=below right:Nucleus]{};%{\small Nucleus};
\path[densely dotted, draw=blue] (0,0) circle (105px);
\filldraw[fill=blue, draw=blue, outer sep = 3px] (0,0) circle (10px) node[label=below right:Nucleus]{};%{\small Nucleus};
\path[densely dotted, draw=blue] (0,0) circle (70px);
% \filldraw[fill=blue, draw=blue] (-79px, 70px) circle (3px) node[anchor=north west]{\tiny \(e^-\)};
\node[circle,minimum size=5px, radius=5px,fill=blue, draw=blue, label=below right:\(e^-\)] (e1) at (-79px, 70px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (-180px, 90px) node[anchor=south east]{\tiny Photon} -- (e1);
\node[circle, radius=5px,fill=blue, draw=blue, label=below:\phantom{\(e^-\)}] (e2) at (10px, 200px) {} ;
\node[circle,minimum size=5px, radius=5px,fill=blue, draw=blue, label=below right:\(e^-\)] (e1) at (-35px, 60px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (-120px, 60px) node[anchor=south east]{\small Photon} -- (e1);
\node[circle, radius=5px,fill=blue, draw=blue, label=below:\phantom{\(e^-\)}] (e2) at (6px, 130px) {} ;
\draw[->, draw=blue] (e1) -- (e2);
\end{tikzpicture}
\end{document}
Binary file modified docs/physics/media/electron_scattering-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/physics/media/electron_scattering.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
%\filldraw[fill=blue, draw=blue, outer sep = 7px] (0,0) circle (7px) node[label=right:\(e^-\)]{} ;
% \path[densely dotted, draw=blue] (0,0) circle (105px);
% \filldraw[fill=blue, draw=blue] (-79px, 70px) circle (3px) node[anchor=north west]{\tiny \(e^-\)};
\node[circle, fill=blue, draw=blue,label={right:\(e^-\)}] (e1) at (-41px, 63px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (-180px, 90px) node[anchor=south east]{} -- (e1);
\node[] (e2) at (10px, 200px) {} ;
\node[circle, fill=blue, radius=5px, draw=blue,label={right:\(e^-\)}] (e1) at (-50px, 63px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (-230px, 90px) node[anchor=south east]{} -- (e1);
\node[] (e2) at (50px, 230px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (e1) -- (e2);
\end{tikzpicture}
\end{document}
Binary file modified docs/physics/media/free_free_absorbtion-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/physics/media/free_free_absorbtion.tex
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
\documentclass[convert,tikz]{standalone}
\documentclass[convert, margin=5mm,tikz]{standalone}
\usepackage{tikz-feynman}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\filldraw[fill=blue, draw=blue, outer sep = 25px] (0,0) circle (50px) node[label=right:Ion]{};
\node[circle,minimum size=5px, radius=5px,fill=blue, draw=blue, label=right:\(e^-\)] (e1) at (-79px, 70px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (-180px, 70px) node[anchor=south east]{} -- (e1);
\filldraw[fill=blue, draw=blue, outer sep = 15px] (0,0) circle (30px) node[label=right:Ion]{};
\node[circle,minimum size=5px, radius=5px,fill=blue, draw=blue, label=right:\(e^-\)] (e1) at (-50px, 45px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (-120px, 45px) node[anchor=south east]{} -- (e1);
\end{tikzpicture}
\end{document}
Binary file modified docs/physics/media/line_interaction-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions docs/physics/media/line_interaction.tex
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
\documentclass[convert,tikz]{standalone}
\documentclass[convert, margin=5mm, tikz]{standalone}
\usepackage{tikz-feynman}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\filldraw[fill=blue, draw=blue, outer sep = 3px] (0,0) circle (15px) node[label=below right:Nucleus]{};%{\small Nucleus};
\path[densely dotted, draw=blue] (0,0) circle (150px);
\path[densely dotted, draw=blue] (0,0) circle (200px);
\filldraw[fill=blue, draw=blue, outer sep = 3px] (0,0) circle (10px) node[label=below right:Nucleus]{};%{\small Nucleus};
\path[densely dotted, draw=blue] (0,0) circle (70px);
\path[densely dotted, draw=blue] (0,0) circle (90px);
% \filldraw[fill=blue, draw=blue] (-79px, 70px) circle (3px) node[anchor=north west]{\tiny \(e^-\)};
\node[circle,minimum size=5px, radius=5px,fill=blue, draw=blue, label=below right:\(e^-\)] (e1) at (-80px, 125px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (-400px, 90px) node[anchor=south east]{} -- (e1);
\node[circle, radius=5px,fill=blue, draw=blue, label=below:\phantom{\(e^-\)}] (e2) at (10px, 200px) {} ;
\node[circle,minimum size=5px, radius=5px,fill=blue, draw=blue, label=below right:\(e^-\)] (e1) at (-35px, 60px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (-150px, 60px) node[anchor=south east]{} -- (e1);
\node[circle, radius=5px,fill=blue, draw=blue, label=below:\phantom{\(e^-\)}] (e2) at (10px, 90px) {} ;
\draw[->, draw=blue] (e1) -- (e2);
\end{tikzpicture}
\end{document}
Binary file modified docs/physics/media/model_and_plasma-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions docs/physics/media/model_and_plasma.tex
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
\documentclass[convert,tikz]{standalone}
\documentclass[convert,margin=5mm,tikz]{standalone}
\usepackage{tikz-feynman}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[ultra thick] (0,0) circle (200px);
\draw[ultra thick] (0,0) circle (175px);
\draw[ultra thick] (0,0) circle (150px);
\draw[ultra thick] (0,0) circle (125px);
\filldraw[fill=orange!50!white, draw=orange, ultra thick] (0,0) circle (100px);
\draw[] (0,0) circle (115px);
\draw[] (0,0) circle (105px);
\draw[] (0,0) circle (95px);
\draw[] (0,0) circle (85px);
\filldraw[fill=orange!50!white, draw=orange, ultra thick] (0,0) circle (75px);
\node[] (inner) {Inner boundary of atmosphere} (0, 0);
\node[] at (8, -5) (outer) {Outer boundary of atmosphere};
\node[] at (5.5, -3) (outer) {Outer boundary of atmosphere};
\end{tikzpicture}
\end{document}
Binary file modified docs/physics/media/rayleigh_scattering-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions docs/physics/media/rayleigh_scattering.tex
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
\documentclass[convert,tikz]{standalone}
\documentclass[convert, margin=5mm, tikz]{standalone}
\usepackage{tikz-feynman}
\usepackage{tikz}
%\usetikzlibrary{animations}
\begin{document}
\begin{tikzpicture}
\filldraw[fill=blue, draw=blue, outer sep = 35px] (0,0) circle (75px) node[label=right:Atom/Molecule]{};%{\small Nucleus};
\filldraw[fill=blue, draw=blue, outer sep = 12px] (0,0) circle (30px) node[label=right:Atom/Molecule]{};%{\small Nucleus};
% \path[densely dotted, draw=blue] (0,0) circle (105px);
% \filldraw[fill=blue, draw=blue] (-79px, 70px) circle (3px) node[anchor=north west]{\tiny \(e^-\)};
\node[] (e1) at (-41px, 63px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (-180px, 90px) node[anchor=south east]{} -- (e1);
\node[] (e2) at (10px, 200px) {} ;
\node[] (e1) at (-15px, 25px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (-80px, 50px) node[anchor=south east]{} -- (e1);
\node[] (e2) at (10px, 80px) {} ;
\draw[->,decorate, decoration=snake, draw=yellow] (e1) -- (e2);
\end{tikzpicture}
\end{document}
5 changes: 4 additions & 1 deletion stardis/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ def run_stardis(config_fname, tracing_lambdas_or_nus):
]
)
+ 1,
)
),
line_interaction_type="macroatom",
nlte_species=[],
continuum_interaction_species=[],
)
# plasma
stellar_plasma = create_stellar_plasma(stellar_model, adata, config)
Expand Down
5 changes: 4 additions & 1 deletion stardis/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def example_stellar_plasma(
]
)
+ 1,
)
),
line_interaction_type="macroatom",
nlte_species=[],
continuum_interaction_species=[],
)
return create_stellar_plasma(
example_stellar_model, example_kurucz_atomic_data, example_config
Expand Down
5 changes: 2 additions & 3 deletions stardis/radiation_field/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class RadiationField:
"""
Class containing information about the radiation field.
###TODO Radiation field temperature should be a separate attribute, for the case of differing gas and radiation.
###TODO Implement a source function class. Doesn't need to be done until we have another source function than just blackbody.
Parameters
----------
Expand All @@ -30,5 +29,5 @@ class RadiationField:
def __init__(self, frequencies, source_function, stellar_model):
self.frequencies = frequencies
self.source_function = source_function
self.opacities = Opacities()
self.F_nu = np.zeros((len(stellar_model.geometry.r), len(frequencies)))
self.opacities = Opacities(frequencies, stellar_model)
self.F_nu = np.zeros((stellar_model.no_of_depth_points, len(frequencies)))
15 changes: 9 additions & 6 deletions stardis/radiation_field/opacities/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import numpy as np


class Opacities:
"""
Holds opacity information.
Expand All @@ -11,15 +14,15 @@ class Opacities:
Added as an attribute when calc_total_alphas() is called.
"""

def __init__(self):
def __init__(self, frequencies, stellar_model):
self.opacities_dict = {}
self.total_alphas = np.zeros(
(stellar_model.no_of_depth_points, len(frequencies))
)

###TODO: Better implementation for this
def calc_total_alphas(self):
for i, item in enumerate(self.opacities_dict.items()):
for item in self.opacities_dict.items():
if "gammas" not in item[0] and "doppler" not in item[0]:
if i == 0:
self.total_alphas = item[1]
else:
self.total_alphas += item[1]
self.total_alphas += item[1]
return self.total_alphas

0 comments on commit d8d4ce8

Please sign in to comment.