From 20685f9b1bc94d1f160e122f00ef1d0ad8c5f030 Mon Sep 17 00:00:00 2001 From: Will Barnes Date: Wed, 19 Jul 2023 15:19:42 -0400 Subject: [PATCH] handle quantity as tuple in all instruments --- synthesizAR/instruments/hinode.py | 2 ++ synthesizAR/instruments/physical.py | 2 ++ synthesizAR/instruments/sdo.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/synthesizAR/instruments/hinode.py b/synthesizAR/instruments/hinode.py index 06cdaab..1417f87 100644 --- a/synthesizAR/instruments/hinode.py +++ b/synthesizAR/instruments/hinode.py @@ -14,6 +14,7 @@ from synthesizAR.util import SpatialPair from synthesizAR.instruments import InstrumentBase, ChannelBase +from synthesizAR.util.decorators import return_quantity_as_tuple __all__ = ['InstrumentHinodeEIS', 'InstrumentHinodeXRT'] @@ -91,6 +92,7 @@ def get_header(self, channel, *args): return header @staticmethod + @return_quantity_as_tuple def calculate_intensity_kernel(loop, channel, **kwargs): K_T = np.interp(loop.electron_temperature, channel.temperature, diff --git a/synthesizAR/instruments/physical.py b/synthesizAR/instruments/physical.py index e22ba5a..55a92a1 100644 --- a/synthesizAR/instruments/physical.py +++ b/synthesizAR/instruments/physical.py @@ -199,6 +199,7 @@ class InstrumentLOSVelocity(InstrumentQuantityBase): name = 'los_velocity' @staticmethod + @return_quantity_as_tuple def calculate_intensity_kernel(loop, *args, **kwargs): observer = kwargs.get('observer') if observer is None: @@ -210,5 +211,6 @@ class InstrumentTemperature(InstrumentQuantityBase): name = 'temperature' @staticmethod + @return_quantity_as_tuple def calculate_intensity_kernel(loop, *args, **kwargs): return loop.electron_temperature diff --git a/synthesizAR/instruments/sdo.py b/synthesizAR/instruments/sdo.py index 2adde2f..7b8cd9e 100644 --- a/synthesizAR/instruments/sdo.py +++ b/synthesizAR/instruments/sdo.py @@ -14,6 +14,7 @@ from scipy.interpolate import interp1d, interpn from synthesizAR.instruments import InstrumentBase +from synthesizAR.util.decorators import return_quantity_as_tuple __all__ = ['InstrumentSDOAIA', 'aia_kernel_quick'] @@ -78,6 +79,7 @@ def get_instrument_name(self, channel): return f'{self.detector}_{channel.telescope_number}' @staticmethod + @return_quantity_as_tuple def calculate_intensity_kernel(loop, channel, **kwargs): em_model = kwargs.get('emission_model', None) if em_model: