Lv3Step
This is a light wrapper around the level 3 pipeline stage of the official pipeline. For more details, see the official documentation.
If you have background observations, you should ensure these are being correctly picked up by using bgr_check_type
and bgr_background_name.
After the main pipeline run, two optional post-processing steps are available. These are independent of each other and can be enabled separately:
do_drizzle: Drizzle individual exposures onto the mosaic WCS, producing one*_i2d_single.fitsfile per exposure. Resample parameters are read fromjwst_parameters["resample"].do_blot: Blot the final i2d mosaic back to each exposure’s detector frame, producing one*_i2d_blot.fitsfile per exposure. The fill value for pixels outside the blotted footprint is controlled byblot_fillval.
Example 1 – Drizzle individual exposures onto the mosaic WCS only:
[parameters.lv3]
do_drizzle = true
Example 2 – Blot the mosaic to every exposure’s detector frame only:
[parameters.lv3]
do_blot = true
blot_fillval = "nan"
Example 3 – Both drizzle and blot:
[parameters.lv3]
do_drizzle = true
do_blot = true
API
- class pjpipe.Lv3Step(target, band, in_dir, out_dir, dr_version, is_bgr, step_ext, procs, tweakreg_degroup_nircam_modules=False, tweakreg_degroup_nircam_short_chips=False, tweakreg_group_dithers=None, tweakreg_degroup_dithers=None, skymatch_group_dithers=None, skymatch_degroup_dithers=None, bgr_check_type='parallel_off', bgr_background_name='off', process_bgr_like_science=False, jwst_parameters=None, do_drizzle=False, do_blot=False, blot_fillval=nan, overwrite=False)[source]
Wrapper around the level 3 JWST pipeline
- Parameters:
target – Target to consider
band – Band to consider
in_dir – Input directory
out_dir – Output directory
dr_version – Data processing version
is_bgr – Whether we’re processing background observations or not
step_ext – .fits extension for the files going into the step
procs – Number of processes to run in parallel
tweakreg_degroup_nircam_modules – Whether to degroup NIRCam A and B modules. Currently, the WCS is inconsistent between the two, so should probably be set to True if you see “ghosting” in the final mosaic. Defaults to False
tweakreg_degroup_nircam_short_chips – Whether to degroup NIRCam short 1/2/3/4 chips. There may be some shifts between these, so should ideally find a shift for each chip. Defaults to False
tweakreg_group_dithers – List of ‘miri’, ‘nircam_long’, ‘nircam_short’ of whether to group up dithers for tweakreg. Defaults to None, which will keep at default
tweakreg_degroup_dithers – List of ‘miri’, ‘nircam_long’, ‘nircam_short’ of whether to degroup dithers for tweakreg. Defaults to None, which will keep at default.
skymatch_group_dithers – List of ‘miri’, ‘nircam_long’, ‘nircam_short’ of whether to group up dithers for skymatch. Defaults to None, which will keep at default
skymatch_degroup_dithers – List of ‘miri’, ‘nircam_long’, ‘nircam_short’ of whether to degroup dithers for skymatch. Defaults to None, which will keep at default.
bgr_check_type – Method to check if obs is science or background. Options are given by BGR_CHECK_TYPES. Defaults to ‘parallel_off’
bgr_background_name – If bgr_check_type is ‘check_in_name’ or ‘filename’, this is the string to match
process_bgr_like_science – If True, will process background images as if they are science images. Defaults to False
jwst_parameters – Parameter dictionary to pass to the level 2 pipeline. Defaults to None, which will run the observatory defaults
do_drizzle – If True, drizzle individual frames to the i2d mosaic WCS after the main pipeline run. Note: creates a lot of files. Defaults to False.
do_blot – If True, blot the final i2d mosaic to the detector frame of each exposure, producing one
*_i2d_blot.fitsfile per exposure. Independent of do_drizzle. Defaults to False.blot_fillval – Fill value for pixels outside the blotted footprint. Defaults to np.nan
overwrite – Whether to overwrite or not. Defaults to False
- create_asn_file(files)[source]
Setup asn lv3 file
- do_step()[source]
Run the level 3 pipeline
- propagate_metadata(files)[source]
Propagate metadata through to the output files
- Parameters:
files – List of files to loop over
- run_step(asn_file)[source]
Run the level 3 step
- Parameters:
asn_file – Path to association JSON file