From 99a82bbcc65cfd349c4c07b3e562a79b31aef08a Mon Sep 17 00:00:00 2001 From: Drew Leonard Date: Fri, 8 Mar 2024 13:01:16 +0000 Subject: [PATCH] Make transform_at_index not cache again because it makes the answers wrong --- dkist/wcs/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dkist/wcs/models.py b/dkist/wcs/models.py index ebba9094..430edb09 100755 --- a/dkist/wcs/models.py +++ b/dkist/wcs/models.py @@ -1,6 +1,6 @@ from abc import ABC from typing import Union, Literal, Iterable -from functools import cache +# from functools import cache from itertools import product import numpy as np @@ -157,7 +157,7 @@ def __init__(self, *args, crval_table=None, pc_table=None, projection=m.Pix2Sky_ raise TypeError("The projection keyword should be a Pix2SkyProjection model class.") self.projection = projection - @cache + # @cache def transform_at_index(self, ind, crpix=None, cdelt=None, lon_pole=None): """ Generate a spatial model based on an index for the pc and crval tables. @@ -220,7 +220,7 @@ def _map_transform(self, *arrays, crpix, cdelt, lon_pole, inverse=False): ranges = [np.unique(ind) for ind in inds] for ind in product(*ranges): # Scalar parameters are reshaped to be length one arrays by modeling - sct = self.transform_at_index(ind) + sct = self.transform_at_index(ind, crpix=crpix[0], cdelt=cdelt[0], lon_pole=lon_pole[0]) # Call this transform for all values of x, y where z == zind masks = [inds[i] == ind[i] for i in range(len(ind))]