Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Project Changelog
Release 1.6.0 (TBD)
-------------------

API changes:
* Add emission model attribute access to line and lineshape . (#294)

New:
* Add Function6D framework. (#478)
* Add e_field attribute to Plasma object for electric field vector. (#465)
Expand Down
8 changes: 8 additions & 0 deletions cherab/core/atomic/line.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ cdef class Line:
specify the n-levels with integers (e.g. (3,2)). For all other ions the full spectroscopic
configuration string should be specified for both states. It is up to the atomic data
provider package to define the exact notation.

:ivar Element element: The atomic element/isotope to which this emission line belongs.
:ivar int charge: The charge state of the element/isotope that emits this line.
:ivar tuple transition: A two element tuple that defines the upper and lower electron
configuration states of the transition. For hydrogen-like ions it may be enough to
specify the n-levels with integers (e.g. (3,2)). For all other ions the full spectroscopic
configuration string should be specified for both states. It is up to the atomic data
provider package to define the exact notation.

.. code-block:: pycon

Expand Down
10 changes: 10 additions & 0 deletions cherab/core/model/plasma/impact_excitation.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ cdef class ExcitationLine(PlasmaModel):

:ivar Plasma plasma: The plasma to which this emission model is attached.
:ivar AtomicData atomic_data: The atomic data provider for this model.
:ivar Line line: The emission line object.
:ivar LineShapeModel lineshape: The line shape model.
"""

def __init__(self, Line line, Plasma plasma=None, AtomicData atomic_data=None, object lineshape=None,
Expand Down Expand Up @@ -75,6 +77,14 @@ cdef class ExcitationLine(PlasmaModel):
def __repr__(self):
return '<ExcitationLine: element={}, charge={}, transition={}>'.format(self._line.element.name, self._line.charge, self._line.transition)

@property
def line(self):
return self._line

@property
def lineshape(self):
return self._lineshape

cpdef Spectrum emission(self, Point3D point, Vector3D direction, Spectrum spectrum):

cdef double ne, ni, te, radiance
Expand Down
10 changes: 10 additions & 0 deletions cherab/core/model/plasma/recombination.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ cdef class RecombinationLine(PlasmaModel):

:ivar Plasma plasma: The plasma to which this emission model is attached.
:ivar AtomicData atomic_data: The atomic data provider for this model.
:ivar Line line: The emission line object.
:ivar LineShapeModel lineshape: The line shape model.
"""

def __init__(self, Line line, Plasma plasma=None, AtomicData atomic_data=None, object lineshape=None,
Expand Down Expand Up @@ -75,6 +77,14 @@ cdef class RecombinationLine(PlasmaModel):
def __repr__(self):
return '<RecombinationLine: element={}, charge={}, transition={}>'.format(self._line.element.name, self._line.charge, self._line.transition)

@property
def line(self):
return self._line

@property
def lineshape(self):
return self._lineshape

cpdef Spectrum emission(self, Point3D point, Vector3D direction, Spectrum spectrum):

cdef double ne, ni, te, radiance
Expand Down
10 changes: 10 additions & 0 deletions cherab/core/model/plasma/thermal_cx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ cdef class ThermalCXLine(PlasmaModel):

:ivar Plasma plasma: The plasma to which this emission model is attached.
:ivar AtomicData atomic_data: The atomic data provider for this model.
:ivar Line line: The emission line object.
:ivar LineShapeModel lineshape: The line shape model.
"""

def __init__(self, Line line, Plasma plasma=None, AtomicData atomic_data=None, object lineshape=None,
Expand Down Expand Up @@ -77,6 +79,14 @@ cdef class ThermalCXLine(PlasmaModel):
def __repr__(self):
return '<ThermalCXLine: element={}, charge={}, transition={}>'.format(self._line.element.name, self._line.charge, self._line.transition)

@property
def line(self):
return self._line

@property
def lineshape(self):
return self._lineshape

cpdef Spectrum emission(self, Point3D point, Vector3D direction, Spectrum spectrum):

cdef:
Expand Down
11 changes: 11 additions & 0 deletions cherab/core/model/plasma/total_radiated_power.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ cdef class TotalRadiatedPower(PlasmaModel):
:param int charge: The charge state of the element/isotope.
:param Plasma plasma: The plasma to which this emission model is attached. Default is None.
:param AtomicData atomic_data: The atomic data provider for this model. Default is None.

:ivar Element element: The atomic element/isotope.
:ivar int charge: The charge state of the element/isotope.
"""

def __init__(self, Element element, int charge, Plasma plasma=None, AtomicData atomic_data=None):
Expand All @@ -68,6 +71,14 @@ cdef class TotalRadiatedPower(PlasmaModel):

# ensure that cache is initialised
self._change()

@property
def element(self):
return self._element

@property
def charge(self):
return self._charge

cpdef Spectrum emission(self, Point3D point, Vector3D direction, Spectrum spectrum):

Expand Down
Loading