From 3705c377ddc7167bc9d6030ede6fe4f2a905ef06 Mon Sep 17 00:00:00 2001 From: Ken MacDonald <68608562+kmacdonald-stsci@users.noreply.github.com> Date: Thu, 23 May 2024 10:08:29 -0400 Subject: [PATCH] JP-3632: Change the Spec of Ramp Fitting to Select Algorithm (#8503) --- CHANGES.rst | 5 +++++ docs/jwst/ramp_fitting/arguments.rst | 5 +++++ jwst/ramp_fitting/ramp_fit_step.py | 5 +++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index b017d00388..eab5ef1ead 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -124,6 +124,11 @@ ramp_fitting to use uint16 instead of uint8, in order to avoid potential overflow/wraparound problems. [#8377] +- Changed the spec for ramp fitting that allows for selecting + the algorithm "OLS" to use the python implementation of ramp + fitting or "OLS_C" to use the C extension implementation of + ramp fitting. [#8503] + resample -------- diff --git a/docs/jwst/ramp_fitting/arguments.rst b/docs/jwst/ramp_fitting/arguments.rst index d3756f8f0f..12f646a16a 100644 --- a/docs/jwst/ramp_fitting/arguments.rst +++ b/docs/jwst/ramp_fitting/arguments.rst @@ -2,6 +2,11 @@ Arguments ========= The ramp fitting step has the following optional arguments that can be set by the user: +* ``--algorithm``: A string to select the desired algorithm. The available + values are "OLS" to select the python implementation of the Ordinary + Least Squares algorithm and "OLS_C" to select the C extension + implementation of OLS. The algorithm defaults to "OLS". + * ``--save_opt``: A True/False value that specifies whether to write the optional output product. Default is False. diff --git a/jwst/ramp_fitting/ramp_fit_step.py b/jwst/ramp_fitting/ramp_fit_step.py index 4541a17548..b28339ee55 100644 --- a/jwst/ramp_fitting/ramp_fit_step.py +++ b/jwst/ramp_fitting/ramp_fit_step.py @@ -385,6 +385,7 @@ class RampFitStep(Step): class_alias = "ramp_fit" spec = """ + algorithm = option('OLS', 'OLS_C', default='OLS') # Can be 'OLS_C' to select the C extension int_name = string(default='') save_opt = boolean(default=False) # Save optional output opt_name = string(default='') @@ -399,8 +400,8 @@ class RampFitStep(Step): # As of 04/26/17, the only allowed algorithm is 'ols', and the # only allowed weighting is 'optimal'. - algorithm = 'ols' # Only algorithm allowed for Build 7.1 -# algorithm = 'gls' # 032520 + # algorithm = 'ols' # Only algorithm allowed for Build 7.1 + # algorithm = 'gls' # 032520 weighting = 'optimal' # Only weighting allowed for Build 7.1