Skip to content

Conversation

Copy link

Copilot AI commented Jan 13, 2026

Change Summary

Overview

CoDICE-Lo processing fails in AWS with dimension mismatch error when LUT contains ESA sweep configurations with 104 steps instead of the hardcoded 128:

# Before: Hardcoded 128 steps
esa_steps = constants.NUM_ESA_STEPS  # Always 128
l1a_dataset["esa_step"] = xr.DataArray(np.arange(128), dims=("esa_step",))

# After: Derive from actual voltage data
voltage_data = sci_lut_data["esa_sweep_tab"][f"{esa_table_number}"]
esa_steps = len(voltage_data)  # 104 or 128 depending on configuration
l1a_dataset["esa_step"] = xr.DataArray(np.arange(esa_steps), dims=("esa_step",))

New Dependencies

None

New Files

None

Deleted Files

None

Updated Files

  • imap_processing/codice/codice_l1a_lo_species.py

    • Derive esa_steps from voltage_data length instead of constant
    • Slice acquisition_time_per_step to match actual dimensions
    • Move voltage_data retrieval before esa_steps usage
  • imap_processing/codice/codice_l1a_lo_angular.py

    • Apply same voltage_data-driven esa_steps logic
    • Reorder voltage_data retrieval before data reshaping
  • imap_processing/codice/codice_l1a_lo_priority.py

    • Replace NUM_ESA_STEPS constant with dynamic sizing
    • Slice acquisition time array appropriately
  • imap_processing/codice/codice_l1a_lo_counters_aggregated.py

    • Derive esa_step variable from voltage_data length
    • Remove hardcoded 128 assumption
  • imap_processing/codice/codice_l2.py

    • Update compute_geometric_factors() to detect dataset esa_step dimension and slice lookup tables accordingly
    • Replace hardcoded 128 in energy validation with len(esa_kev)

Testing

Logic verified with unit tests for array slicing. Changes are backward compatible with existing 128-step configurations.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.dev.imap-mission.com
    • Triggering command: /usr/bin/python python -m pytest imap_processing/tests/ialirt/unit/test_process_codice.py::test_create_xarray_dataset_basic -xvs (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

I have this error for codice_lo when I run the code in AWS. Where is this message in the repo?

[ERROR] 2026-01-13T20:09:42.512Z 0e6dc884-c62f-447b-8668-26bc51d00b82 Error processing codice_lo: cannot reindex or align along dimension 'esa_step' because of conflicting dimension sizes: {104, 128} (note: an index is found along that dimension with size=128)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 13, 2026 21:42
Co-authored-by: laspsandoval <46567335+laspsandoval@users.noreply.github.com>
Co-authored-by: laspsandoval <46567335+laspsandoval@users.noreply.github.com>
Co-authored-by: laspsandoval <46567335+laspsandoval@users.noreply.github.com>
…idation

Co-authored-by: laspsandoval <46567335+laspsandoval@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix codice_lo processing error in AWS Fix esa_step dimension mismatch in CoDICE-Lo processing Jan 13, 2026
Copilot AI requested a review from laspsandoval January 13, 2026 21:54
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.

2 participants