From d1a775c76bf329c23253d27a9f5a28ad40957b1c Mon Sep 17 00:00:00 2001 From: Erik Rosolowsky Date: Thu, 4 Feb 2021 16:31:49 -0700 Subject: [PATCH] Fix indexing for propagating PV and PS cards. --- spectral_cube/wcs_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spectral_cube/wcs_utils.py b/spectral_cube/wcs_utils.py index f8e090627..225c5312c 100644 --- a/spectral_cube/wcs_utils.py +++ b/spectral_cube/wcs_utils.py @@ -163,15 +163,15 @@ def reindex_wcs(wcs, inds): pv_cards = [] for i, j in enumerate(inds): for k, m, v in wcs.wcs.get_pv(): - if k == j: - pv_cards.append((i, m, v)) + if k == (j + 1): + pv_cards.append((i + 1, m, v)) outwcs.wcs.set_pv(pv_cards) ps_cards = [] for i, j in enumerate(inds): for k, m, v in wcs.wcs.get_ps(): - if k == j: - ps_cards.append((i, m, v)) + if k == (j + 1): + ps_cards.append((i + 1, m, v)) outwcs.wcs.set_ps(ps_cards)