Skip to content

Commit

Permalink
Update usage as post-hook in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavies-st authored Jan 29, 2024
1 parent 1a452f3 commit 3c15968
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,30 @@ Algorithms for cleaning JWST data.

## Usage

The steps in snowblind run like any other pipeline steps. From the command line:
The steps in snowblind run like any other pipeline steps. From the command line you can run the step on the result file from JumpStep:

strun snowblind jw001234_010203_00001_nrcalong_jump.fits --suffix=snowblind

In Python:
Or you can run it as a post-hook in a full pipeline

from snowblind import SnowblindStep
strun calwebb_detector1 jw001234_010203_00001_nrcalong_uncal.fits --steps.jump.post_hooks="snowblind.SnowblindStep","snowblind.JumpPlusStep"

In Python, we can insert `SnowblindStep` and `JumpPlusStep` after `JumpStep` as a post-hook:

from snowblind import SnowblindStep, JumpPlusStep
from jwst.pipeline import Detector1Pipeline
from jwst.step import RampFitStep
from jwst.step import GainScaleStep


steps = {
"jump": {
"save_results": True,
},
"ramp_fit": {
"skip": True,
},
"gain_scale": {
"skip": True,
"post_hooks": [
"snowblind.SnowblindStep",
"snowblind.JumpPlusStep",
],
},
}

Detector1Pipeline.call("jw001234_010203_00001_nrcalong_uncal.fits", steps=steps)
SnowblindStep.call("jw001234_010203_00001_nrcalong_jump.fits", save_results=True, suffix="snowblind")
rate, rateints = RampFitStep.call("jw001234_010203_00001_nrcalong_snowblind.fits")
rate = GainScaleStep.call(rate)
rate.save(rate.meta.filename.replace("snowblind", "rate"))
Detector1Pipeline.call("jw001234_010203_00001_nrcalong_uncal.fits", steps=steps, save_results=True)

More to come on the other steps available.

0 comments on commit 3c15968

Please sign in to comment.