Fix krypton calculation - #31
Merged
Merged
Conversation
MishaVeldhoen
requested changes
Apr 23, 2026
MishaVeldhoen
left a comment
Collaborator
There was a problem hiding this comment.
Hey Tom, good fixes overall! My main worry is about the silent grid extrapolation due to clipping, and publishing of OpenADAS data.
I also find (more generally) some parts of the code are a bit hard to read because the JSON config has a compact structure, the details of which leak into the code itself. E.g., filename can be an int, or a list, which reads unnaturally. Could be fixed in a next PR where we fix up config parsing with dataclasses or pydantic models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses an issue where the radiated power$L_z$ was returning zero for Krypton.
The Issue
The atomic data files from OpenADAS for Krypton have slightly different electron temperatures at a single position
returns
When merging xr.DataArrays into an xr.Dataset, a silent
xr.merge(..., join="outer")is used. This fills NaNs where data is "missing", and this goes on to corrupt the entire Lz calculation.To fix this, we now interpolate before combining the rate coefficients into a single dataset, and then use
xr.merge(..., join="exact")which will raise an error if the axes are not perfectly aligned.In addition, this model slightly changes the plotting, to make it a bit easier to see when Mavrin data isn't defined.


Github Actions are extended to run
poetry run radasfor all species on new releases, or if manually triggered by a user.