Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

Disp variables (DispTelList_T, Disp_T, DispXoff_T, etc.) were directly copied from column positions without mapping through tel_list_matrix, causing misalignment when telescope IDs are non-contiguous (e.g., [0, 2, 5]).

Changes

  • Remove special-case handling for Disp variables in _flatten_variable_columns
  • Apply same tel_list_matrix mapping to Disp variables as other per-telescope variables
  • Ensures correct alignment: column position → telescope ID → distance sort

Example

For telescopes [0, 2, 5] with Disp values [10, 20, 30]:

Before: Values incorrectly assigned to telescope IDs [0, 1, 2]
After: Values correctly assigned to telescope IDs [0, 2, 5]

# Previously: Disp variables had special handling
if var.startswith("Disp"):
    base[:, :n_cols] = data[:, :n_cols]  # Direct copy, wrong

# Now: Unified mapping for all variables
full_matrix[row_indices[valid_mask], tel_ids[valid_mask]] = data[
    row_indices[valid_mask], col_indices[valid_mask]
]  # Correct mapping via tel_list_matrix

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

Co-authored-by: GernotMaier <14001688+GernotMaier@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on 'Order by distance' PR Fix Disp variable mapping to use tel_list_matrix before distance sorting Jan 21, 2026
Copilot AI requested a review from GernotMaier January 21, 2026 17:53
@GernotMaier GernotMaier marked this pull request as ready for review January 21, 2026 17:59
@GernotMaier GernotMaier merged commit daecb20 into order-by-distance Jan 21, 2026
2 checks passed
@GernotMaier GernotMaier deleted the copilot/sub-pr-36 branch January 21, 2026 18:00
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