From 3c15968c5a3260d6bffe6f446801012be188085b Mon Sep 17 00:00:00 2001 From: James Davies Date: Mon, 29 Jan 2024 13:55:13 +0100 Subject: [PATCH] Update usage as post-hook in README.md --- README.md | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a1ee891..103c68f 100644 --- a/README.md +++ b/README.md @@ -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.