Skip to content

Conversation

@laspsandoval
Copy link
Contributor

@laspsandoval laspsandoval commented Dec 11, 2025

Change Summary

Overview

This is to accommodate the new lut.

Updated Files

  • process_swapi.py
    • Checks for sweep number and then latest timestamp.
  • imap_swapi_esa-unit-conversion_20251201_v001.csv
    • New lut.

Testing

  • test_process_swapi.py
  • conftest.py
  • iois_1_packets_2025_343_00_00_17

@laspsandoval laspsandoval self-assigned this Dec 11, 2025
@laspsandoval laspsandoval added Ins: SWAPI Related to the SWAPI instrument I-ALiRT labels Dec 11, 2025
@laspsandoval laspsandoval added this to the December 2025 milestone Dec 11, 2025
@laspsandoval laspsandoval marked this pull request as draft December 11, 2025 00:16
@laspsandoval laspsandoval marked this pull request as ready for review December 11, 2025 00:22
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this can be removed and tested with the utilities from the main repository can't it?
#2503 (comment)

Bring in the esa_unit_conversion_table fixture and change sweep#2 to 3 and then you verify that your lookup on 3 is valid without adding a new file and needing to update it for 4 and 5 which SWAPI is now at as well.

def test_solve_full_sweep_energy_id3(esa_unit_conversion_table, lut_notes_table):
    """Test the solve_full_sweep_energy function for sweep id 3 case"""
    # Modify the current conversion table we have to have entries for sweep id 3
    esa_unit_conversion_table = esa_unit_conversion_table.copy(deep=True)
    esa_unit_conversion_table.loc[
        esa_unit_conversion_table["Sweep #"] == 2, "Sweep #"
    ] = 3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do it with everything except
def test_optimize_parameters():

The energy values are different. To change this one I would need to request new validation values from the instrument team.

Copy link
Collaborator

@greglucas greglucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this looks good now, just one minor suggestion if it works. Thank you, Laura!

Comment on lines +36 to +37
@pytest.fixture(scope="session")
def esa_unit_conversion_table() -> pd.DataFrame:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might be able to import the fixture from the other test module so you don't have to duplicate it here.

from imap_processing.tests.swapi...

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

Labels

I-ALiRT Ins: SWAPI Related to the SWAPI instrument

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants