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

clean_flicker_noise skipped when called as a standalone step #9258

Open
stscijgbot-jp opened this issue Mar 7, 2025 · 5 comments
Open

clean_flicker_noise skipped when called as a standalone step #9258

stscijgbot-jp opened this issue Mar 7, 2025 · 5 comments

Comments

@stscijgbot-jp
Copy link
Collaborator

Issue JP-3912 was created on JIRA by Bryan Hilbert:

While running some pipeline steps on some dark current exposures today, I noticed some odd behavior with the clean_flicker_noise step. When I called the individual step, it still ended up being skipped unless I explicitly set skip=False. 

Here is my call:

        f = CleanFlickerNoiseStep.call(filename,
                                       n_sigma=15,
                                       fit_by_channel=True,
                                       background_method='model',
                                       save_background=True,
                                       save_mask=True,
                                       save_results=True
                                       )

And the resulting log messages are below. Note that in the list of input parameter values, skip is set to True, and indeed, the step is skipped. Only if I add skip=False to my call above is the step executed. 

 

2025-03-07 15:46:29,428 - stpipe.CleanFlickerNoiseStep - INFO - CleanFlickerNoiseStep instance created.                                                                                

2025-03-07 15:46:29,546 - stpipe.CleanFlickerNoiseStep - INFO - Step CleanFlickerNoiseStep running with args ('../jw06626001001_02201_00001_nrcalong_no_donotuse_cropped20groups_jump.fi

ts',).                                                                                                                                              

2025-03-07 15:46:29,547 - stpipe.CleanFlickerNoiseStep - INFO - Step CleanFlickerNoiseStep parameters are:                                                                              

  pre_hooks: []                                                                                                                                                                         

  post_hooks: []                                                                                                                                                                        

  output_file: None                                                                                                                                                                     

  output_dir: None                                                                                                                                                                      

  output_ext: .fits                                                                                                                                                                     

  output_use_model: False                                                                                                                                                               

  output_use_index: True                                                                                                                                                                

  save_results: True                                                                                                                                                                    

  skip: True                                                                                                                                                                            

  suffix: None                                                                                                                                                                          

  search_output_file: True                                                                                                                                                              

  input_dir: ''                                                                                                                                                                         

  fit_method: median                                                                                                                                                                    

  fit_by_channel: True                                                                                                                                                                  

  background_method: model                                                                                                                                                              

  background_box_size: None                                                                                                                                                             

  mask_science_regions: False                                                                                                                                                           

  n_sigma: 15                                                                                                                                                                           

  fit_histogram: False                                                                                                                                                                  

  single_mask: True                                                                                                                                                                     

  user_mask: None                                                                                                                                                                       

  save_mask: True                                                                                                                                                                       

  save_background: True                                                                                                                                                                 

  save_noise: False                                                                                                                                                                     

2025-03-07 15:46:29,549 - stpipe.CleanFlickerNoiseStep - INFO - Step skipped.                                                                                                           

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

I think that's known behavior- I've seen this with some other off-by-default steps as well.  Not sure if there's an easy way to handle this other than setting skip=False when running the step standalone?  Tagging Tyler Pauly 

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Tyler Pauly on JIRA:

This is the designed behavior - because the step has been added to the detector1 pipeline, its default behavior is that skip is set to True. This is so that parameter references can be delivered by instrument teams to enable it on a case-by-case basis. The alternative, to have skip default to False, would require parameter reference file updates to set it to True for every mode until testing demonstrates a positive outcome.

Once testing is complete, we could request that those parameter reference updates are made - the ideal scenario would be for skip to have a default value of False to avoid this confusing situation. But as it is still considered to be RTT rather than science-ready, having it skip by default is not entirely unreasonable.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

I don't think we'd want to rely on param ref files turning the step off.  More the question, could the code detect when it is being called directly rather than as part of a pipeline?

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Tyler Pauly on JIRA:

I think we'd need to test to be sure, but my understanding is that any parameter-specific behavior we'd insert into the pipeline code would overwrite fetched values from CRDS. This why pipelines use .run() in the internals - the classes have already been instantiated and configured according to the params fetched, then overridden if necessary by user prompts.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

Right, I think the aim would be if the pipeline could tell that a single step is being called directly (whether through strun or a python .call() approach) it seems generally clear that the user wants to run that step regardless of what the regular skip settings are.  It may not be worth pursuing this, but worth asking how complicated that might be (and if it might end up biting us in some unexpected way).

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

1 participant