From f715abc0855b8ee5fbc8bc2807346140a21d1a22 Mon Sep 17 00:00:00 2001 From: Thomas WIlliams Date: Mon, 18 Aug 2025 14:41:15 +0100 Subject: [PATCH] Fix crash for background observations in ``get_short_band_name`` - Fix crash for background observations in ``get_short_band_name`` --- CHANGES.rst | 1 + pjpipe/utils/utils.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 509f86c..3d3c4d5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,7 @@ 1.2.1 (Unreleased) ================== +- Fix crash for background observations in ``get_short_band_name`` - For background association, strip whitespace and lowercase for more robust matching - Imports update - now supports numpy>2.0! - Keep track of expected stripe direction in ``multi_tile_destripe_step`` diff --git a/pjpipe/utils/utils.py b/pjpipe/utils/utils.py index f35e3a6..6486a79 100644 --- a/pjpipe/utils/utils.py +++ b/pjpipe/utils/utils.py @@ -241,6 +241,7 @@ def get_band_ext(band): return band_ext + def get_short_band_name(band): """Get a stripped down short name for a band""" @@ -248,7 +249,7 @@ def get_short_band_name(band): # Strip background if "_bgr" in band_short: - band_short = band_short.replace("_bgr") + band_short = band_short.replace("_bgr", "") # Strip instrument names if "_niriss" in band_short: