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

The Step.get_pars() method doesn't include override_<reffile> parameters #138

Open
jdavies-st opened this issue Jan 24, 2024 · 0 comments
Open

Comments

@jdavies-st
Copy link
Contributor

When a step runs, it logs the parameters used, but it misses the reffile overrides. Using the same Step.get_pars() method that the log message uses, we see:

>>> from jwst.step import GainScaleStep
>>> gain_scale = GainScaleStep()
>>> gain_scale.get_pars()
{'pre_hooks': [],
 'post_hooks': [],
 'output_file': None,
 'output_dir': None,
 'output_ext': '.fits',
 'output_use_model': False,
 'output_use_index': True,
 'save_results': False,
 'skip': False,
 'suffix': None,
 'search_output_file': True,
 'input_dir': ''}

Compared to the command line --help:

$ strun gain_scale --help
usage: strun [-h] [--logcfg LOGCFG] [--verbose] [--debug] [--save-parameters SAVE_PARAMETERS]
             [--disable-crds-steppars] [--pre_hooks] [--post_hooks] [--output_file] [--output_dir] [--output_ext]
             [--output_use_model] [--output_use_index] [--save_results] [--skip] [--suffix] [--search_output_file]
             [--input_dir] [--override_gain]
             cfg_file_or_class [args ...]

GainScaleStep: Rescales countrate data to account for use of a non-standard gain value. All integrations are
multiplied by the factor GAINFACT.

positional arguments:
  cfg_file_or_class     The configuration file or Python class to run
  args                  arguments to pass to step

options:
  -h, --help            show this help message and exit
  --logcfg LOGCFG       The logging configuration file to load
  --verbose, -v         Turn on all logging messages
  --debug               When an exception occurs, invoke the Python debugger, pdb
  --save-parameters SAVE_PARAMETERS
                        Save step parameters to specified file.
  --disable-crds-steppars
                        Disable retrieval of step parameter references files from CRDS
  --pre_hooks           [default=list]
  --post_hooks          [default=list]
  --output_file         File to save output to.
  --output_dir          Directory path for output files
  --output_ext          Output file type [default='.fits']
  --output_use_model    When saving use `DataModel.meta.filename` [default=False]
  --output_use_index    Append index. [default=True]
  --save_results        Force save results [default=False]
  --skip                Skip this step [default=False]
  --suffix              Default suffix for output files
  --search_output_file 
                        Use outputfile define in parent step [default=True]
  --input_dir           Input directory
  --override_gain       Override the gain reference file

Note that the override_gain parameter is not printed out. This is true whether an override has been supplied or not.

So somehow the merged config grabbed by get_pars() is missing the reffile overrides.

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

No branches or pull requests

1 participant