Lv2Step

This is a light wrapper around the level 2 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.

API

class pjpipe.Lv2Step(target, band, in_dir, out_dir, dr_version, step_ext, is_bgr, procs, bgr_check_type='parallel_off', bgr_background_name='off', bgr_observation_types=None, process_bgr_like_science=False, jwst_parameters=None, updated_flats_dir=None, overwrite=False)[source]

Wrapper around the level 2 JWST pipeline

Parameters:
  • target – Target to consider

  • band – Band to consider

  • in_dir – Input directory

  • out_dir – Output directory

  • step_ext – .fits extension for the files going into the step

  • is_bgr – Whether we’re processing background observations or not

  • procs – Number of processes to run in parallel

  • 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

  • bgr_observation_types – List of observation types with dedicated backgrounds. Defaults to None, i.e. no observations have backgrounds

  • 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

  • updated_flats_dir – Directory with the updated flats to use instead of default ones. Defaults to None, which will use the pipeline default flats

  • overwrite – Whether to overwrite or not. Defaults to False

create_asn_files(files, procs=1)[source]

Setup asn lv2 files

Parameters:
  • files (*) – List of files to include in the asn file

  • procs (*) – If greater than 1, will write out an asn file per observation. Defaults to 1

do_step()[source]

Run the level 2 pipeline

get_asn_json(sci_tab, bgr_tab)[source]

Build the JSON file from the science and background tables

parallel_lv2(asn_file)[source]

Parallelise running lv2 processing

Parameters:

asn_file – Association files to run

propagate_metadata(files)[source]

Propagate metadata through to the output files

Parameters:

files – List of files to loop over

run_step(asn_files, procs=1)[source]

Wrap parallelism around the level 2 pipeline

Parameters:
  • asn_files – List of association files to loop over

  • procs – Number of processes to run. Defaults to 1