Skip to content

Conversation

@jacobdparker
Copy link
Collaborator

@jacobdparker jacobdparker commented Jan 8, 2026

Adding logic to ion.n_levels to account for cases where more energy levels are described in the ion.elvlc than than are referred to in ion.wgfa or ion.scups. As of now, this only occurs for N 4.

…evels are described in the database than are populated in the model
@jacobdparker jacobdparker requested a review from wtbarnes January 8, 2026 00:48
@wtbarnes
Copy link
Owner

wtbarnes commented Jan 8, 2026

I find this logic a bit confusing. Is it not sufficient to just take the min between n_levels_elvlc and both the max level from the wgfa file and the max level from the scups file?

@wtbarnes
Copy link
Owner

wtbarnes commented Jan 8, 2026

Two additional requests:

  1. Could you also add a test using "N 4" that checks that n_levels correctly returns the maximum number of levels in the wgfa file and not the number of levels in the elvlc file?
  2. Could you add a note in the docstring saying that this property may not necessarily be equal to the number of levels in the elvlc file?

@jacobdparker
Copy link
Collaborator Author

jacobdparker commented Jan 8, 2026

I took the max between n_levels_scups and n_levels_wgfa assuming that if at least one file refered to an energy level, it should be included in the model. This only really matters for Ar 18, where if you took the minimum, level 25 would be excluded. Maybe it should be ...

I find two cases (updated from original post) where n_levels_elvlc is > n_levels_scups and n_levels_wgfa:

N 4
n_levels_elvlc=238
n_levels_wgfa=np.int64(136)
n_levels_scups=np.int64(136)

Ar 6
n_levels_elvlc=202
n_levels_wgfa=np.int64(155)
n_levels_scups=np.int64(155)

I find one case where n_levels_scups > n_levels_wgfa:
Ar 18
n_levels_elvlc=25
n_levels_wgfa=np.int64(24)
n_levels_scups=np.int64(25)

And a few cases where there is now scups or wgfa file:
Ti 22
n_levels_elvlc=64
n_levels_wgfa=0
n_levels_scups=0

Cr 24
n_levels_elvlc=64
n_levels_wgfa=0
n_levels_scups=0

Zn 30
n_levels_elvlc=64
n_levels_wgfa=0
n_levels_scups=0

@wtbarnes
Copy link
Owner

wtbarnes commented Jan 8, 2026

The cases where there are no scups or wgfa files are fine. In those cases, there is effectively no model and so you can't compute a contribution function anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants