Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create C framework in STCAL ramp fitting #7735

Closed
stscijgbot-jp opened this issue Jul 17, 2023 · 7 comments
Closed

Create C framework in STCAL ramp fitting #7735

stscijgbot-jp opened this issue Jul 17, 2023 · 7 comments

Comments

@stscijgbot-jp
Copy link
Collaborator

Issue JP-3121 was created on JIRA by Kenneth MacDonald:

Create C framework in STCAL to prepare for refactoring part of ramp fitting in C.

@hbushouse
Copy link
Collaborator

Fixed by #8355

@stscijgbot-jp
Copy link
Collaborator Author

stscijgbot-jp commented May 22, 2024

Comment by Howard Bushouse on JIRA:

Fixed by #8355

and by spacetelescope/stcal#156

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

Howard Bushouse So can we now pass an argument to the jwst ramp_fitting code to tell it to use the C version?  What's the relevant flag?

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Kenneth MacDonald on JIRA:

David Law there are two ways you can use the C extension.  If you feel comfortable changing the code you can hard code the use_c variable True in ols_fit.py.  

https://github.com/spacetelescope/stcal/blob/6739c1c6b0559943bd4ac29e90e009541e217f00/src/stcal/ramp_fitting/ols_fit.py#L665

This way allows you to run the pipeline using the C extension.  Unfortunately, since the OLS is currently hard coded this is the only way to run the C extension as a part of the pipeline.

The second way is programmatically.  To run the C extension code programmatically requires an already computed jump file ready to run ramp fitting.  To run the C code on the jump file instantiate the ramp fit step ramp_fit_step = RampFitStep() class, set ramp_fit_step.algorithm = "OLS_C", then run rate, rateints = ramp_fit_step.process(jump_file_name).  The process method needs to be called.  If you run the call or run method, the algorithm is hard coded as "OLS", which will default to the python code.

 

algorithm = 'ols' # Only algorithm allowed for Build 7.1

 

However, this morning I was given authorization to change the above spec for the RampFitStep to change the choice of algorithm.  I will change the spec today.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Melanie Clarke on JIRA:

Ticket for the spec change is JP-3632.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

Great, thanks both.  I'm comfortable changing the code to test it, but exposing the parameter makes it much simpler for the instrument teams and any external users to take advantage of it.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

Kenneth MacDonald I just tested providing average_dark_current in combination with the C ramp fitting code in the tagged 1.7.1 version of stcal.  Looks like things are behaving as expected.  I think that means that we can close this ticket since it's merged and working.  Further discussion on passing arguments to change the algorithm, or broader long-term testing can take place on JP-3632 and https://jira.stsci.edu/browse/JP-3594

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants