Skip to content

Implementation

Will Barnes edited this page Oct 25, 2017 · 2 revisions

A few notes on the current implementation and ideas for the future.

IonBase

The IonBase object is the main interface to the atomic data. It simply provides a list of properties corresponding to the different CHIANTI filetypes (e.g. elvlc, wgfa, etc.). It provides no methods for calculating any derived quantities from the data. The idea is that this class will serve as the base class for various classes in fiasco and gives others a base to build on if they just want access to the CHIANTI data without the baggage of all of the methods.

Ion (partially implemented)

Subclass of IonBase and provides all methods for calculating derived quantities from the CHIANTI data. Similar to the ion object in ChiantiPy. This is the fundamental unit for the fiasco library.

Element (somewhat implemented)

This object provides a logical grouping of Ion objects. The Element object should be implemented with a string and a particular temperature. Then, the element can be indexed, using either integers or strings, to construct ion objects. Note that in its current conception, Element does not store instances of Ion, but merely provides a convenient interface for creating Ion instances.

IonCollection (not yet implemented)

Several calculations can take input from multiple ions (and thus elements), including:

  • radiative losses
  • intensity/spectrum

The idea is that these element and ion groups can be composed in two ways: either by adding two ions or two elements together or directly by instantiating the objects with either a list of element/ion names or just a list of the objects themselves. Then, these objects will have methods attached to them for computing the above quantities. So in pseudocode,

ion1 = Ion('ion1',temperature)
ion2 = Ion('ion2',temperature)
iongroup_12 = ion1+ion2
spec_12 = iongroup_12.spectrum()
# or 
iongroup_12 = IonGroup(['ion1','ion2'],temperature)
# or
iongroup_12 = IonGroup([ion1,ion2])

The same would be true for elements, though in the element case, an IonGroup would be created for all of the ions of that particular element (so maybe there is only an IonGroup object then...). This allows the user to easily compose spectra of as many elements/ions as they want.