jwst
jwst copied to clipboard
stpipe.Step does not respect --save_results=False
When a step or pipeline is run from the command line via strun
, it does not respect --save_results=False
for the single step, or in the case of the pipeline, the final returned result.
Example below using a step.
Data in /user/jdavies/test_writing_bryan/
(jwst_dev) rey> collect_pipeline_cfgs ./config
(jwst_dev) rey> strun config/flat_field.cfg jw00017001001_01101_00001_NRCA1_ramp_fit.fits
2018-11-01 12:32:18,950 - stpipe.flat_field - INFO - FlatFieldStep instance created.
2018-11-01 12:32:18,975 - stpipe.flat_field - INFO - Step flat_field running with args ('jw00017001001_01101_00001_NRCA1_ramp_fit.fits',).
2018-11-01 12:32:34,401 - stpipe.flat_field - INFO - Saved model in jw00017001001_01101_00001_NRCA1_ramp_fit_flat_field.fits
2018-11-01 12:32:34,401 - stpipe.flat_field - INFO - Step flat_field done
(jwst_dev) rey> ls
config/ jw00017001001_01101_00001_NRCA1_ramp_fit_flat_field.fits
jw00017001001_01101_00001_NRCA1_ramp_fit.fits
(jwst_dev) rey> rm jw00017001001_01101_00001_NRCA1_ramp_fit_flat_field.fits
(jwst_dev) rey> strun config/flat_field.cfg jw00017001001_01101_00001_NRCA1_ramp_fit.fits --save_results=False
2018-11-01 12:33:06,878 - stpipe.flat_field - INFO - FlatFieldStep instance created.
2018-11-01 12:33:06,898 - stpipe.flat_field - INFO - Step flat_field running with args ('jw00017001001_01101_00001_NRCA1_ramp_fit.fits',).
2018-11-01 12:33:11,136 - stpipe.flat_field - INFO - Saved model in jw00017001001_01101_00001_NRCA1_ramp_fit_flat_field.fits
2018-11-01 12:33:11,136 - stpipe.flat_field - INFO - Step flat_field done
(jwst_dev) rey> ls
config/ jw00017001001_01101_00001_NRCA1_ramp_fit_flat_field.fits
jw00017001001_01101_00001_NRCA1_ramp_fit.fits
I would think that writing out of files should be controlled here https://github.com/spacetelescope/jwst/blob/39a2149e2e8a4e7c2c3925370c9f3632b00ebca7/jwst/stpipe/step.py#L442
But that doesn't seem to be the case because of https://github.com/spacetelescope/jwst/blob/39a2149e2e8a4e7c2c3925370c9f3632b00ebca7/jwst/stpipe/cmdline.py#L256
This was pointed out by @bhilbert4.