Example #1
0
def run_nis_wfss_spec2(jail, rtdata_module):
    """Run the calwebb_spec2 pipeline"""
    step_params = {
        'input_path':
        'niriss/wfss/nir_wfss_spec2_asn.json',
        'step':
        'calwebb_spec2',
        'args': [
            '--steps.assign_wcs.save_results=true',
            '--steps.bkg_subtract.save_results=true',
            '--steps.imprint_subtract.save_results=true',
            '--steps.msa_flagging.save_results=true',
            '--steps.flat_field.save_results=true',
            '--steps.extract_2d.save_results=true',
            '--steps.srctype.save_results=true',
            '--steps.straylight.save_results=true',
            '--steps.fringe.save_results=true',
            '--steps.pathloss.save_results=true',
            '--steps.barshadow.save_results=true',
            '--steps.wfss_contam.save_results=true',
            '--steps.photom.save_results=true',
            '--steps.resample_spec.save_results=true',
            '--steps.cube_build.save_results=true',
            '--steps.extract_1d.save_results=true',
            '--save_wfss_esec=true',
        ]
    }

    return rt.run_step_from_dict(rtdata_module, **step_params)
Example #2
0
def run_spec2(jail, rtdata_module):
    """Run the Spec2Pipeline on a single exposure"""
    rtdata = rtdata_module

    # Setup the inputs
    asn_name = 'single_nrs1_ifu_spec2_asn.json'
    asn_path = INPUT_PATH + '/' + asn_name

    # Run the pipeline
    step_params = {
        'input_path':
        asn_path,
        'step':
        'calwebb_spec2.cfg',
        'args': [
            '--steps.bkg_subtract.save_results=true',
            '--steps.assign_wcs.save_results=true',
            '--steps.imprint_subtract.save_results=true',
            '--steps.msa_flagging.save_results=true',
            '--steps.extract_2d.save_results=true',
            '--steps.flat_field.save_results=true',
            '--steps.srctype.save_results=true',
            '--steps.straylight.save_results=true',
            '--steps.fringe.save_results=true',
            '--steps.pathloss.save_results=true',
            '--steps.barshadow.save_results=true',
            '--steps.photom.save_results=true',
            '--steps.resample_spec.save_results=true',
            '--steps.cube_build.save_results=true',
            '--steps.extract_1d.save_results=true',
        ]
    }

    rtdata = rt.run_step_from_dict(rtdata, **step_params)
    return rtdata
Example #3
0
def run_nis_wfss_spec3(jail, rtdata_module):
    """Run the calwebb_spec3 pipeline"""
    step_params = {
        'input_path':
        'niriss/wfss/jw00625-o030_20191121t041727_spec3_001_asn.json',
        'step':
        'calwebb_spec3',
        'args': [
            '--steps.extract_1d.save_results=true',
            '--steps.combine_1d.save_results=true',
        ]
    }

    return rt.run_step_from_dict(rtdata_module, **step_params)
def run_spec2_mbkg(jail, rtdata_module):
    """Run Spec2 on MSA data with background slits"""
    rtdata = rtdata_module

    # Get data
    rtdata.get_data('nirspec/mos/nrs_mos_with_bkgslits_msa.fits')
    rtdata.get_data('nirspec/mos/nrs_mos_with_bkgslits_rate.fits')

    # Run the pipeline
    step_params = {
        'step': 'calwebb_spec2',
        'args': [
            '--steps.master_background_mos.skip=false',
            '--steps.master_background_mos.save_background=true'
        ]
    }
    rtdata = rt.run_step_from_dict(rtdata, **step_params)
    return rtdata
def run_spec3_multi(jail, rtdata_module):
    """Run the Spec3Pipeline on multi channel/multi filter data"""

    step_params = {
        'input_path': INPUT_PATH + '/' + 'ifushort_set2_asn3.json',
        'step': 'calwebb_spec3.cfg',
        'args': [
            '--steps.master_background.save_results=true',
            '--steps.mrs_imatch.save_results=true',
            '--steps.outlier_detection.save_results=true',
            '--steps.resample_spec.save_results=true',
            '--steps.cube_build.save_results=true',
            '--steps.extract_1d.save_results=true',
            '--steps.combine_1d.save_results=true',
        ]
    }

    return rt.run_step_from_dict(rtdata_module, **step_params)
Example #6
0
def run_photom(jail, rtdata_module):
    """Run the photom step on an NRS IFU exposure with SRCTYPE=EXTENDED"""
    rtdata = rtdata_module

    # Setup the inputs
    rate_name = 'jwdata0010010_11010_0001_NRS1_pathloss.fits'
    rate_path = INPUT_PATH + '/' + rate_name

    # Run the step
    step_params = {
        'input_path': rate_path,
        'step': 'photom.cfg',
        'args': [
            '--save_results=True',
        ]
    }

    rtdata = rt.run_step_from_dict(rtdata, **step_params)
    return rtdata
def run_spec2_mbkg_user(jail, rtdata_module):
    """Run Spec2 on MSA data with a user-supplied master bkg spectrum"""
    rtdata = rtdata_module

    # Get data
    rtdata.get_data('nirspec/mos/nrs_mos_3pointnod_1_msa.fits')
    rtdata.get_data('nirspec/mos/jw00626030001_02103_00001_nrs1_masterbg1d.fits')
    rtdata.get_data('nirspec/mos/jw00626030001_02103_00001_nrs1_rate.fits')

    # Run the pipeline
    step_params = {
        'step': 'calwebb_spec2',
        'args': [
            '--steps.master_background_mos.skip=false',
            '--steps.master_background_mos.user_background=jw00626030001_02103_00001_nrs1_masterbg1d.fits'
        ]
    }
    rtdata = rt.run_step_from_dict(rtdata, **step_params)
    return rtdata
Example #8
0
def run_spec2(jail, rtdata_module):
    """Run the Spec2Pipeline on a single exposure"""
    rtdata = rtdata_module

    # Setup the inputs
    asn_name = 'ifushort_ch12_rate_asn3.json'
    rtdata.get_data(INPUT_PATH + '/' + asn_name)
    asn_path = rtdata.input
    with open(asn_path, 'r') as asn_fh:
        asn = load_asn(asn_fh)
    member_path = Path(asn['products'][0]['members'][0]['expname'])
    rate_path = member_path.stem
    rate_path = replace_suffix(rate_path, 'rate')
    rate_path = INPUT_PATH + '/' + rate_path + member_path.suffix

    # Run the pipeline
    step_params = {
        'input_path':
        rate_path,
        'step':
        'calwebb_spec2.cfg',
        'args': [
            '--steps.bkg_subtract.save_results=true',
            '--steps.assign_wcs.save_results=true',
            '--steps.imprint_subtract.save_results=true',
            '--steps.msa_flagging.save_results=true',
            '--steps.extract_2d.save_results=true',
            '--steps.flat_field.save_results=true',
            '--steps.srctype.save_results=true',
            '--steps.straylight.save_results=true',
            '--steps.fringe.save_results=true',
            '--steps.pathloss.save_results=true',
            '--steps.barshadow.save_results=true',
            '--steps.photom.save_results=true',
            '--steps.resample_spec.save_results=true',
            '--steps.cube_build.save_results=true',
            '--steps.extract_1d.save_results=true',
        ]
    }

    rtdata = rt.run_step_from_dict(rtdata, **step_params)
    return rtdata, asn_path
Example #9
0
def run_spec3_multi(jail, rtdata_module):
    """Run Spec3Pipeline"""
    rtdata = rtdata_module

    step_params = {
        'input_path': 'nirspec/ifu/single_nrs1-nrs2_spec3_asn.json',
        'step': 'calwebb_spec3.cfg',
        'args': {
            '--steps.master_background.save_results=true',
            '--steps.mrs_imatch.save_results=true',
            '--steps.outlier_detection.save_results=true',
            '--steps.resample_spec.save_results=true',
            '--steps.cube_build.save_results=true',
            '--steps.extract_1d.save_results=true',
            '--steps.combine_1d.save_results=true',
        }
    }

    rtdata = rt.run_step_from_dict(rtdata, **step_params)
    return rtdata
def run_wfss_contam(jail, rtdata_module):
    """Run the wfss_contam step"""
    rtdata = rtdata_module

    # Get input data files
    rtdata.get_data('nircam/wfss/jw01076_nircam_f322w2_i2d.fits')
    rtdata.get_data('nircam/wfss/jw01076_nircam_f322w2_segm.fits')
    rtdata.get_data('nircam/wfss/jw01076003001_01101_00001_nrca5_srctype.fits')

    # Run the step
    step_params = {
        'step':
        'jwst.wfss_contam.WfssContamStep',
        'args': [
            '--save_simulated_image=True',
            '--save_contam_images=True',
            '--skip=False',
        ]
    }
    rtdata = rt.run_step_from_dict(rtdata, **step_params)
    return rtdata