Closed vsnever closed 3 years ago
I built these search functions to simplify element handling:
You can lookup the element by name, atomic number etc....
Yes @CnlPepper, it's exactly what I was looking for, thank you. I'll update the code and make the PR then.
@jacklovell, could you please provide me with any balance.nc
file for testing? All examples in SOLPS-ITER are in md5.
Current representation of species in SOLPSSimulation
class as a list of strings (symbol + charge) in unsafe. Let's say we have He3 in the plasma, for the neutral He3, re.match(_SPECIES_REGEX, sp).groups()
will return ('He', 30)
. It's better to keep the species as the list of (symbol, charge) tuples or even (Element
/Isotope
, charge) tuples. In the latter case, we can avoid try-except for Element
/Isotope
when initialising Species
.
Fixed in #35.
I suggest that instead of using _popular_species dict when reading the data from raw or balance files, we should search for the matches in
cherab.core.atomic.elements
. First, get all isotopes with a given nuclear charge, second, from them find the one with the closest atomic mass to the given one.Similarly,
_species_symbol_map
dict must be replaced with the search for the matching element symbol incherab.core.atomic.elements
. Extracting the nuclear charge from the balance file also must be improved the same way.