core icon indicating copy to clipboard operation
core copied to clipboard

All excitation and recombination lines of an element as plasma models?

Open leferi99 opened this issue 10 months ago • 2 comments

I need all OpenADAS Ne lines for a Ne-doped SPI simulation in AUG, and I managed to change the cherab.openadas.repository.populate() function so that it downloads all Ne PEC files ('adf15/pec96#ne/pec96#ne_pju#ne0.dat' and so on can be downloaded, or maybe even the 'ne_pjr' files). When I wanted to add the excitation and recombination lines as plasma models to my Cherab simulation, I couldn't find a way to add all the lines easily, so I parsed the downloaded OpenADAS .json files to get the transitions and added them one by one. I was wondering if there is an easier way and if not I would suggest implementing something like this for cases where a plasma contains some higher-Z impurities and there are significant changes in its temperature.

Also, another related question is how to download additional OpenADAS files without changing the cherab.openadas.repository.create.py file? I found this in another issue for carbon 'bnd' files:

from cherab.openadas.install import install_adf15
from cherab.core.atomic import carbon

install_adf15(carbon, 5, 'adf15/pec96#c/pec96#c_bnd#c5.dat', download=True, header_format='hydrogen')

Can I do this for Neon PEC data as well? They are also in 'adf15'.

leferi99 avatar Feb 14 '25 15:02 leferi99

It's currently necessary to add all the lines you want individually, using cherab.core.atomic.Line and specifying the element, charge and transition. However, a utility function which would scan for and add all lines with available data for a given species would be useful indeed. Doing it in a general way with sufficient configuration for all use cases may however prove challenging, and once you do this for many species it can become very computationally expensive so is likely to be sufficiently rare that an end-user solution is more appropriate.

Also, another related question is how to download additional OpenADAS files without changing the cherab.openadas.repository.create.py file? I found this in another issue for carbon 'bnd' files:

Yes you can do this for Neon too. The populate function just loops over a subset of OpenADAS data: see the comment at the top of the populate function.

install a common selection of open adas files

So there's nothing to stop you calling install_adf15 for the Neon lines you want. These install functions convert the ADAS format into a more consistent format for Cherab to use - since the OpenADAS representation is slightly different for the different types of files which makes it a bit awkward to use them raw - and saves the reformatted data in JSON files in a defined file structure that the framework can use to work out the path to a given set of data.

jacklovell avatar Mar 24 '25 15:03 jacklovell

Having a functionality which would help you search a given atomic data repository for available data would indeed be helpful and there is already an issue about it: #230

However, I would only suggest listing the available rates, transitions, etc. and not to automatically generate plasma model lists. That could lead to all sorts of nightmares and I think from data engineering point of view it would actually be a bad habit. There should always be some kind of information what generated given results. Now, it is up to the users to configure their models and store their scripts to keep track. If we would add this automatic generation, the simulation results would be given by the state of the used atomic data repository.

I understand that it is not that difficult to actually parse a repository, get the list, generate models and that it is annoying that every user has to do it on its own. I however think that it is important that in this case it is not Cherab allowing for the mess to happen.

To add the automatic generation of emission models I think we would have to add serialisation of emission models to allow users to keep track. This step would however be probably quite demanding and would put unnecessary requirements on all current and future models. I just think it is not worth it.

Mateasek avatar Apr 16 '25 22:04 Mateasek

I will close this issue for inactivity. Please reopen if you feel it wasn't answered @leferi99.

Mateasek avatar Nov 30 '25 20:11 Mateasek