Skip to content

Conversation

@laspsandoval
Copy link
Contributor

@laspsandoval laspsandoval commented Dec 10, 2025

Change Summary

Overview

Formatting to get codice_lo into a format that can be inserted into DynamoDB.

Updated Files

  • process_codice.py
    • Formatting to get codice_lo into a format that can be inserted into DynamoDB.

Testing

  • test_process_codice.py

@laspsandoval laspsandoval self-assigned this Dec 10, 2025
@laspsandoval laspsandoval added Ins: CoDICE Related to the CoDICE instrument Level: L2 Level 2 processing I-ALiRT labels Dec 10, 2025
@laspsandoval laspsandoval added this to the December 2025 milestone Dec 10, 2025
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.

I have a few suggestions that I think might make this a little cleaner without all the case handlings.

  • Stick to numpy arrays. So try to initialize an empty array with the expected shape.
    pseudo_density_arr = np.empty((len(constants.LO_IALIRT_VARIABLE_NAMES), len(intensity))
    Then you can ignore the division by zero and let nan's fall out automatically and replace with fills later if you want. (remove all if 0 branches)

  • Use an IntEnum for your species names. Then you can lookup into arrays with pseudo_density_arr[LoSpecies.O_7_plus, :] rather than pseudo_density_dict[species_list[3]] with kind of two redirects in there which is confusing for me to follow without looking back up what index is what in the species list.

Comment on lines +328 to +330
pseudo_density_dict[species_list[3]]
+ pseudo_density_dict[species_list[4]]
+ pseudo_density_dict[species_list[5]]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought I commented on this somewhere else earlier but couldn't find it immediately. I think this would be much easier to follow with an IntEnum to index into the named species.

class Species(IntEnum):
    OXYGEN = 0
    CARBON2 = 1
    ...

pseudo_density_arr[Species.OXYGEN]

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

Labels

I-ALiRT Ins: CoDICE Related to the CoDICE instrument Level: L2 Level 2 processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants