Skip to content

fix(prediction): resolve streaming FITS extension errors for Euclid data#8

Open
gomezzz wants to merge 3 commits intomainfrom
fix/streaming-fits-extension-resolution
Open

fix(prediction): resolve streaming FITS extension errors for Euclid data#8
gomezzz wants to merge 3 commits intomainfrom
fix/streaming-fits-extension-resolution

Conversation

@gomezzz
Copy link
Copy Markdown
Collaborator

@gomezzz gomezzz commented Mar 9, 2026

Summary

  • Fix FITS extension resolution: Always resolve filter names (VIS, NIR-Y, NIR-H) from catalogue file paths for multi-extension cutana streaming, setting fits_extensions to ["PRIMARY"] for source mosaics. Fixes Extension CHANNEL_1 not found errors when cutout-level extension names/indices were passed directly to cutana.

  • Dict-form channel_combination: Support dict-form channel_combination (e.g. {"VIS": [1,0,0], "NIR-Y": [0,1,0]}) for order-independent channel mapping, preventing channel jumbling when streaming catalogues have different file ordering than training data. validate_config converts dict to numpy array for fitsbolt compatibility while preserving the original dict for streaming.

  • Regression tests: 17 new tests covering filter name resolution, FITS extension config, and dict channel_combination support.

Test plan

  • All 381 tests pass (17 new + 364 existing)
  • Lint clean (ruff check)
  • Manual verification with Euclid Q1 mosaic data

…dict channel_combination

Always resolve filter names from catalogue file paths for multi-extension
streaming, setting fits_extensions to ["PRIMARY"] for source mosaics.
Fixes "Extension CHANNEL_1 not found" errors when cutout-level extension
names were passed to cutana for mosaic files.

Also adds dict-form channel_combination support (e.g. {"VIS": [1,0,0]})
for order-independent channel mapping, preventing channel jumbling when
streaming catalogues have different file ordering than training data.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2026

Overall Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py80100% 
data_io
   SessionIOHandler.py3544786%112, 129–130, 174–175, 185–186, 253–254, 319–320, 323, 363–365, 407, 425–427, 449, 451–452, 456–458, 523, 598, 619, 633–634, 636–637, 639–641, 785–790, 804, 808–809, 813–815
   find_images_in_folder.py210100% 
   load_images.py912869%51–53, 58–60, 81, 93, 110, 140–147, 150, 156–157, 189, 248, 256, 277, 285, 292–294
   metadata_handler.py80890%70–71, 117, 122–123, 170–172
   save_config.py33390%92–94
datasets
   AnomalyDetectionDataset.py2483984%126–127, 356, 362–363, 365, 369, 371–372, 374, 395–396, 398, 404–405, 409, 422–423, 484–485, 491–496, 498–499, 503–506, 508–510, 512–514, 525
   BasicDataset.py52492%59, 61, 97, 103
   Label.py50100% 
   SSL_Dataset.py68395%136, 139, 209
   __init__.py00100% 
   data_utils.py56296%80, 199
datasets/augmentation
   randaugment.py921188%222, 225–226, 245, 328–330, 332–335
   randaugment_multispectral.py772468%33, 77–79, 92–93, 106–107, 134–135, 166, 170, 174, 248, 253, 270–272, 274–277, 280–281
image_processing
   transforms.py57394%46–47, 76
models
   FixMatch.py2142986%108, 201–202, 217, 222, 254, 281–282, 285, 288–290, 293, 301, 306–307, 366, 404, 430–434, 495, 497–498, 502, 519–520
pipeline
   SessionTracker.py122397%127, 219–220
   session.py5358584%131–134, 384–387, 432, 445, 597, 654, 656–657, 665, 668, 679, 687, 717, 721, 725–726, 730, 735–736, 743, 747–748, 760, 770–771, 773, 777, 791–792, 794–796, 798, 801–802, 860–861, 863–866, 868–872, 878, 884, 889–893, 895, 903, 906–907, 923, 964–965, 971–972, 976–978, 980, 1005, 1031, 1065–1066, 1074, 1085, 1093, 1097, 1101, 1106, 1109, 1153, 1156
utils
   accuracy.py130100% 
   consistency_loss.py180100% 
   create_model_string.py40100% 
   cross_entropy_loss.py90100% 
   cutana_stream_utils.py70987%64–65, 88, 108, 118–122
   get_cosine_schedule_with_warmup.py11190%39
   get_default_cfg.py610100% 
   get_net_builder.py49785%81–82, 89, 92, 146–147, 151
   get_optimizer.py21290%54, 58
   print_cfg.py45491%89, 95, 117, 119
   set_log_level.py150100% 
   set_seeds.py13284%25–26
   validate_config.py1401986%180, 199, 214, 228, 244, 248, 264, 290, 301–305, 309, 311–312, 396–398
TOTAL258233387% 

Tests Skipped Failures Errors Time
382 0 💤 0 ❌ 0 🔥 1m 0s ⏱️

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.

1 participant