Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle CMFGEN J level removal more cleanly #409

Open
andrewfullard opened this issue Sep 23, 2024 · 2 comments · May be fixed by #428
Open

Handle CMFGEN J level removal more cleanly #409

andrewfullard opened this issue Sep 23, 2024 · 2 comments · May be fixed by #428

Comments

@andrewfullard
Copy link
Contributor

Currently we completely drop the J values in a rather messy way. We should store and (potentially) use them.

@manas-dhyani
Copy link

Hi @andrewfullard ,

I’m working on issue #409 to clean up how J values are handled in CMFGEN data. Currently, in the cross_sections_squeeze function (carsus/io/cmfgen.py), J values are removed from ion_levels["label"] with the following code:

python

if ion_levels["label"].str.contains(r"\[").any():
    # Remove the "[J]" term from J-splitted levels labels
    ion_levels["label"] = ion_levels["label"].str.rstrip("]")

    # Drop the [J] term completely to avoid shape mismatch. Something to perhaps store in the future
    ion_levels["label"] = ion_levels["label"].str.split("[", expand=True)[0]
However, J values are not stored anywhere.

I have a few questions regarding how to proceed:

  1. Where should J values be stored? Should I add a new "J" column in ion_levels, or should they be integrated into level_number?
  2. How should J values be stored? As integers/floats or as strings?
  3. Where is ion_levels originally created? I need to modify it to store J values but want to confirm the correct file and function.

Looking forward to your guidance!

@andrewfullard
Copy link
Contributor Author

  1. A column in ion_levels isn't really possible because of the shape mismatch issue. A separate dataframe may be needed
  2. Integer
  3. You will need to go looking through the code to find out. It is probably in the CMFGEN data reader.

@manas-dhyani manas-dhyani linked a pull request Mar 1, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants