wtbarnes / fiasco

Python interface to the CHIANTI atomic database
http://fiasco.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
20 stars 15 forks source link

Refactor high-level interface for transitions and levels #224

Open wtbarnes opened 1 year ago

wtbarnes commented 1 year ago

There are currently classes for energy levels (Level) as well as a class to hold all transitions (Transitions). However, they aren't terribly useful and also do not interact with one another.

One possible way to refactor this would be to create a Transition class and have Transitions hold many instances of Transition instances. Similarly, each transition could emit a Level class for the upper and lower levels that it represents a transition between. The Transitions class would hold many of the same properties that it currently does, but would derive them from these higher-level classes rather than directly from the underlying data itself.

There may be some performance issues with this approach, e.g. every time we want to list all transition wavelengths, it would not make sense to have to rebuild this Transitions object from scratch.