From 4b63a263daf2091a16a47c92362f6e1acf93bf7a Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 20 Nov 2024 22:56:07 -0500 Subject: [PATCH] I swear I'm not doing this on purpose... I was passing the start parameters incorrectly to the model to get the raw output unit. (by the way, beforehand I was actually using the model self call method, which actually auto-converts the output to the set unit of the model, so wasn't helping us here). For issue #1267 --- xga/products/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xga/products/base.py b/xga/products/base.py index d7fc2512..6a5c9a07 100644 --- a/xga/products/base.py +++ b/xga/products/base.py @@ -1,5 +1,5 @@ # This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS). -# Last modified by David J Turner (turne540@msu.edu) 20/11/2024, 22:53. Copyright (c) The Contributors +# Last modified by David J Turner (turne540@msu.edu) 20/11/2024, 22:56. Copyright (c) The Contributors import inspect import os @@ -826,7 +826,7 @@ def find_to_replace(start_pos: np.ndarray, par_lims: np.ndarray) -> np.ndarray: # Trying to read out the raw output unit of the model with current start parameters, rather than the # final unit set by each model - this is to make sure we're doing regression on data of the right unit - raw_mod_unit = model.model(self.radii[0], model.start_pars).unit + raw_mod_unit = model.model(self.radii[0], *model.start_pars).unit # I'm just defining these here so that the lines don't get too long for PEP standards y_data = (self.values.copy() - self._background).to(raw_mod_unit).value @@ -1032,7 +1032,7 @@ def nlls_fit(self, model: BaseModel1D, num_samples: int, show_warn: bool) -> Tup # Trying to read out the raw output unit of the model with current start parameters, rather than the # final unit set by each model - this is to make sure we're doing regression on data of the right unit - raw_mod_unit = model.model(self.radii[0], model.start_pars).unit + raw_mod_unit = model.model(self.radii[0], *model.start_pars).unit y_data = (self.values.copy() - self._background).to(raw_mod_unit).value y_errs = self.values_err.copy().to(raw_mod_unit).value