NIRSpec Tutorial 1: Data Reductions for BREADS

Configuring the BREADS pipeline analysis

For performance reasons, we configure these various environement variables to prevent numpy from internally parallelizing certain function calls internally which are used during parallelized steps in the analysis pipeline. This cell must be run before numpy is imported for them to be recognized.

[1]:
import os

os.environ["OMP_NUM_THREADS"] = "1"        # export OMP_NUM_THREADS=1
os.environ["OPENBLAS_NUM_THREADS"] = "1"   # export OPENBLAS_NUM_THREADS=1
os.environ["MKL_NUM_THREADS"] = "1"        # export MKL_NUM_THREADS=1
os.environ["VECLIB_MAXIMUM_THREADS"] = "1" # export VECLIB_MAXIMUM_THREADS=1
os.environ["NUMEXPR_NUM_THREADS"] = "1"    # export NUMEXPR_NUM_THREADS=1

This cell must be modified! Specify the directory where you previously stored the data products

[2]:
base_path = '/astro/epsig/tutorial/'

Creating even more subdirectories for organizing data products.

[3]:
data_path = base_path+'data/'
raw_path = data_path+'raw/'
output_path = base_path+'outputs/'
PSF_path = base_path+'PSFs/'

create_paths = [base_path,data_path,raw_path,output_path,PSF_path]
for path in create_paths:
    if not os.path.exists(path):
        os.mkdir(path)

This cell must be modified! The JWST pipeline requires configuring an environment variable CRDS_PATH for storing various calibration reference data, while the BREADS pipeline requires installation of STPSF/WEBBPSF for computing synthethic point spread functions used during the modelling.

[4]:
os.environ['STPSF_PATH'] = '/fast/jruffio/data/stpsf-data/'

Time to import a bunch of stuff.

[5]:
import time
import jwst
print('JWST pipeline version',jwst.__version__) # Print out what pipeline version we're using

from multiprocess import Pool
import numpy as np
import datetime
from copy import copy
from glob import glob

from astropy.io import fits
from astropy import constants as const
from astropy.table import Table
import astropy.units as u

from  scipy.interpolate import interp1d
from scipy.interpolate import LinearNDInterpolator

import matplotlib.pyplot as plt
import matplotlib

from breads.jwst_tools.reduction_utils import find_files_to_process
from breads.jwst_tools.reduction_utils import run_stage1,run_stage2
from breads.jwst_tools.reduction_utils import run_coordinate_recenter
from breads.jwst_tools.reduction_utils import run_noise_clean
from breads.jwst_tools.reduction_utils import compute_normalized_stellar_spectrum
from breads.jwst_tools.reduction_utils import compute_starlight_subtraction
from breads.jwst_tools.reduction_utils import get_combined_regwvs
from breads.jwst_tools.reduction_utils import get_2D_point_cloud_interpolator
from breads.jwst_tools.reduction_utils import save_combined_regwvs

from breads.instruments.jwst_IFUs import build_cube
from breads.utils import rotate_coordinates

numthreads = 4#os.cpu_count()
JWST pipeline version 1.20.2
/home/jruffio/anaconda3/envs/breads_2026/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm

The follwing saves the pre-configured non-uniform nodes defined by Ruffio et al. 2025.

[6]:
wv_nodes_dict = {'nrs1': np.array([2.859, 2.879, 2.899, 2.919, 2.939, 2.959, 2.979, 2.999, 3.019,
                                   3.039, 3.059, 3.079, 3.099, 3.119, 3.139, 3.159, 3.189, 3.219,
                                   3.249, 3.279, 3.309, 3.339, 3.369, 3.399, 3.429, 3.459, 3.499,
                                   3.539, 3.579, 3.619, 3.659, 3.699, 3.739, 3.779, 3.839, 3.899,
                                   3.959, 4.019, 4.079, 4.139]),
                 'nrs2': np.array([4.081, 4.141, 4.201, 4.261, 4.321, 4.361, 4.401, 4.441, 4.481,
                                   4.521, 4.561, 4.601, 4.641, 4.671, 4.701, 4.731, 4.761, 4.791,
                                   4.821, 4.851, 4.881, 4.911, 4.941, 4.971, 4.991, 5.011, 5.031,
                                   5.051, 5.071, 5.091, 5.111, 5.131, 5.151, 5.171, 5.191, 5.211,
                                   5.231, 5.251, 5.271, 5.291])}

np.save(base_path+'nonuniform_nodes.npy',wv_nodes_dict)
wv_nodes_dict
[6]:
{'nrs1': array([2.859, 2.879, 2.899, 2.919, 2.939, 2.959, 2.979, 2.999, 3.019,
        3.039, 3.059, 3.079, 3.099, 3.119, 3.139, 3.159, 3.189, 3.219,
        3.249, 3.279, 3.309, 3.339, 3.369, 3.399, 3.429, 3.459, 3.499,
        3.539, 3.579, 3.619, 3.659, 3.699, 3.739, 3.779, 3.839, 3.899,
        3.959, 4.019, 4.079, 4.139]),
 'nrs2': array([4.081, 4.141, 4.201, 4.261, 4.321, 4.361, 4.401, 4.441, 4.481,
        4.521, 4.561, 4.601, 4.641, 4.671, 4.701, 4.731, 4.761, 4.791,
        4.821, 4.851, 4.881, 4.911, 4.941, 4.971, 4.991, 5.011, 5.031,
        5.051, 5.071, 5.091, 5.111, 5.131, 5.151, 5.171, 5.191, 5.211,
        5.231, 5.251, 5.271, 5.291])}

This cell configures various aspects in the analysis.

  • targetname: SIMBAD resolve-able name for the host to obtain sky coordinates

  • grating: ‘G395H’ is supported for now. Other gratings are WIP.

  • mask_charge_transfer_radius: either ‘None’ or float (in arcsec) half-width of rectangular region to mask around stellar charge bleed. 0.1 is a reasonable value

  • model_charge_transfer: boolean. (Experimental) subtraction of unilluminated pixels in rate files using Lorentzian-based model.

[7]:
targetname = 'HD 19467'
grating = 'G395H'
mask_charge_transfer_radius = None
model_charge_transfer = False

Running the pipeline

Below is a behemoth of a function which combines multiple steps in the analysis chain into a single call. The intention is to use this function to conveniently to loop over both detectors nrs1 and nrs2 and various sequence numbers while running the same code. It could also be used to iterate over other parameters such as targetname if you have multiple datasets on different objects. For pedagogical purposes it would be preferable to split it apart for more localized explanations, however, what follows will be (1) the broad purposes of this function (2) the long function itself and (3) calling the function with a simple loop over both detectors.

Step 0: Preparations

  • The detector argument selects the node specification from the dictionary loaded ealier

  • The filename_filter and detector are used to construct the glob string to find the observation files

  • Paths to various /data/ subdirectories are created for intermediate data products, including unique idenfiers for charge transfer modelling or joint sequence modelling to avoid mixtures.

Step 1: JWST pipeline

  • Stages 1 and 2 of the JWST pipeline are run on the observations found with the glob string.

  • The exact parameters passed to the pipeline are hard coded inside the run_stage1 and run_stage2 functions

Step 2: Sky coordinate calibration

  • This is a two-step iterative process to correct the JWST pipeline provided coordinates.

  • Inside run_coordiante_recenter, fitpsf is used to find the best-fit coordinates for the star as a function of wavelength by fitting a PSF model to the stage 2 calibrated data.

  • The first iteration is initialized at (0,0), while the second iteration is initialized at the best fit centroid of the previous step.

Step 3: 1/f noise clean (and) charge transfer modelling

  • The coordinate corrections are applied to the post-stage 1 rate files.

  • A simple linear 1/f noise correction is applied to the rate data to remove striping artifacts

  • If model_charge_transfer=True, then a more complicated lorentzian-based model of the charge bleeding profile is also subtracted from the rate files. This step is experiemental and the Lorentzian model is still in development. For the tutorial we have disabled it for this analysis since HD 19467 B is widely separated it is non-issue. But for targets very close in ( < 0.3” separation) this could be very helpful.

Step 4: JWST stage 2 pipeline again (post charge bleed model)

  • Stage 2 of the JWST pipeline is run to produce cal files which have 1/f noise and charge bleeding corrections applied

Step 5: Computing the (high pass filtered) stellar spectrum

  • compute_normalized_stellar_spectrum is called on the cal files to obtain the high-frequency components of the starlight model.

  • The argument ra_dec_point_sources can be used to mask out the region corresponding to the planet signal or other interlopers in the FOV. This argument expects an (ra,dec) tuple in units of milliarcseconds. However, this argument is skipped here.

Step 6: Subtracting starlight model (spline and high frequency components)

  • compute_starlight_subtraction is called on cal files using the starlight spectrum computed previously. This combines the spline continuum model with the high frequency stellar spectrum to produce continuum-subtracted detector data.

Step 7: Creating the point-cloud interpolator (for unsubtracted PSF visualization)

  • get_combined_regwvs is used with the arugment use_starsub=False to interpolate the non-star-subtracted detector data onto a regular wavelength grid and to stack the sequence of data objects into single instance

  • if JOINT=False and we are only modelling a single sequence we call regwvs_combdataobj.set_coords2ifu() to transform from sky to IFU coordinates, otherwise the JOINT modelling remains in sky coordinates to stack observations at different roll angles / dither positions properly.

  • get_2D_point_cloud_interpolator is called to transform the stacked detector data into an interpolation function internally relying on matplotlib.tri.LinearTriInterpolator to make a linear interpolation triangular mesh of the non-uniform spaced point cloud data

  • save_combined_regwvs is called to save this object into the /PSFs/ subfolder for later access, while the analysis_chain() function returns the pointcloud_interp object so we can directly call it later in this script.

Step 8: Preparing for build_cube

  • get_combined_regwvs is called with use_starsub=True. This will do the same regular wavelength interpolation and sequence stacking from Step 7 but this time on the detector data with the starlight subtracted. This forms the primary input for the final step for building the spectral cube.

  • Similarly, if JOINT=False and we are only modelling a single sequence we call regwvs_starsub_combdataobj.set_coords2ifu() to transform from sky to IFU coordinates, otherwise the JOINT modelling remains in sky coordinates to stack obserations at different roll angles / dither positions properly.

  • The parameters for ra_vec and dec_vec which are the coordinate position inputs to build_cube as 1D vectors are extracted from the minimum/maximum coordinates of the combined data object. For the joint modelling these values are hard coded and may need to be modified for different datasets.

  • The WebbPSF/STPSF model is computed/reloaded to prepare for the final step.

Step 9: Running build_cube

  • build_cube in essence is performing spectral extraction on the starlight-subtracted/regular-wavelength-interpolated detector sequences

  • At each position in the outer product of ra_vec and dec_vec, the WebbPSF model is fit to the data in a region of size aper_radius (arcsec)

  • The final cubes built are saved in the /outputs/ subdirectory and form the primary data product which will be analyzed in subsequent notebooks

  • debug_init,debug_end = None,None is the setting to run the full analysis, however, specifying interger wavelength indices can be used to analyze smaller subsets of the data or for debugging purposes.

[ ]:

[8]:
def analysis_chain():

    ###### Step 0 ######

    wv_nodes = wv_nodes_dict[detector]

    uncal_filename_filter = filename_filter+'_*_'+detector+'_uncal.fits'
    cal_filename_filter   = filename_filter+'_*_'+detector+'_cal.fits'

    if model_charge_transfer:
        MCT_path_append = '_MCT'
    else:
        MCT_path_append = ''

    if JOINT:
        joint_path_append = '_joint'
    else:
        joint_path_append = ''

    uncal_files = find_files_to_process(raw_path, filetype=uncal_filename_filter)
    stage1_outdir = os.path.join(data_path, grating + "_stage1")
    stage2_outdir = os.path.join(data_path, grating+"_stage2")
    utils_before_cleaning_dir = os.path.join(data_path, grating+"_utils_before_cleaning")
    stage1_clean_outdir = os.path.join(data_path, grating+"_stage1_cleaned"+MCT_path_append)
    stage2_clean_outdir = os.path.join(data_path, grating+"_stage2_cleaned"+MCT_path_append)
    utils_dir = os.path.join(data_path, grating+"_utils"+MCT_path_append)

    ###### Step 1 ######

    rate_files = run_stage1(uncal_files, stage1_outdir, overwrite=False, maximum_cores="1")
    cal_files = run_stage2(rate_files, stage2_outdir, skip_cubes=True, overwrite=False)

    ###### Step 2 ######
    mypool = Pool(processes=numthreads)

    poly_p_RA,poly_p_dec = run_coordinate_recenter(cal_files,utils_before_cleaning_dir,
                                                    init_centroid = (0,0),wv_sampling=None, N_wvs_nodes=40,
                                                    mask_charge_transfer_radius = mask_charge_transfer_radius,
                                                    IWA=0.3,OWA=1.0,
                                                    debug_init=None,debug_end=None,
                                                    mppool = mypool,
                                                    save_plots=True,
                                                    overwrite=False,
                                                    filename_suffix = "_webbpsf_init",
                                                    targetname=targetname)

    poly_p_RA,poly_p_dec = run_coordinate_recenter(cal_files,utils_before_cleaning_dir,
                                                 init_centroid = (poly_p_RA[-1],poly_p_dec[-1]),wv_sampling=None, N_wvs_nodes=40,
                                                 mask_charge_transfer_radius = mask_charge_transfer_radius,
                                                 IWA=0.3,OWA=1.0,
                                                 debug_init=None,debug_end=None,
                                                 mppool = mypool,
                                                 save_plots=True,
                                                 overwrite=False,
                                                 filename_suffix = "_webbpsf",
                                                 targetname=targetname)

    ###### Step 3 ######

    if model_charge_transfer:
        print('!NOISE CLEAN! starting in: {}'.format(stage1_clean_outdir))
    new_rate_files = run_noise_clean(rate_files, stage2_outdir, stage1_clean_outdir,
                                  N_nodes=40,
                                  model_charge_transfer=model_charge_transfer, utils_dir=utils_before_cleaning_dir,
                                  coords_offset=(poly_p_RA,poly_p_dec), overwrite=False)

    ###### Step 4 ######

    cleaned_cal_files = run_stage2(new_rate_files, stage2_clean_outdir, skip_cubes=True, overwrite=False)

    ###### Step 5 ######

    combined_star_func = compute_normalized_stellar_spectrum(cleaned_cal_files, utils_dir,
                                                            coords_offset=(poly_p_RA,poly_p_dec),
                                                            wv_nodes=wv_nodes,
                                                            mask_charge_transfer_radius = mask_charge_transfer_radius,
                                                            mppool=mypool,
                                                            ra_dec_point_sources=None, overwrite=False,
                                                            targetname=targetname)
    ###### Step 6 ######

    dataobj_list = compute_starlight_subtraction(cleaned_cal_files, utils_dir, combined_star_func=combined_star_func,
                                                  coords_offset=(poly_p_RA,poly_p_dec), mppool=mypool, targetname=targetname, wv_nodes=wv_nodes)

    ###### Step 7 ######

    regwvs_combdataobj = get_combined_regwvs(dataobj_list,
                                             mask_charge_transfer_radius=mask_charge_transfer_radius,
                                             use_starsub=False)
    if JOINT:
        pass #remain in sky coords
        out_filename = os.path.join(PSF_path,targetname+"_"+grating+"_"+detector+"_2d_point_cloud"+joint_path_append+".fits")
    else:
        regwvs_combdataobj.set_coords2ifu()
        out_filename = os.path.join(PSF_path,targetname+"_"+grating+"_"+detector+"_2d_point_cloud.fits")

    # 2D interpolator object median wavelength
    wv_sampling = regwvs_combdataobj.wv_sampling
    wv0 = np.nanmedian(regwvs_combdataobj.wavelengths)
    wv0_id = np.argmin(np.abs(wv_sampling-wv0))
    pointcloud_interp = get_2D_point_cloud_interpolator(regwvs_combdataobj,wv0)
    save_combined_regwvs(regwvs_combdataobj, out_filename)

    ###### Step 8 ######

    if JOINT:
        dramin, dramax = -2, 2
        ddecmin, ddecmax = -2, 2
    else:
        dramin, dramax = np.nanmin(regwvs_combdataobj.dra_as_array),np.nanmax(regwvs_combdataobj.dra_as_array)
        ddecmin, ddecmax = np.nanmin(regwvs_combdataobj.ddec_as_array),np.nanmax(regwvs_combdataobj.ddec_as_array)
    print(dramin, dramax, ddecmin, ddecmax)
    ra_vec = np.linspace(dramin,dramax,60)
    dec_vec = np.linspace(ddecmin,ddecmax,60)
    print(ra_vec, dec_vec)

    cleaned_cal_files = find_files_to_process(stage2_clean_outdir, filetype=cal_filename_filter)

    splitbasename = os.path.basename(cleaned_cal_files[0]).split("_")
    filename_suffix = "_webbpsf"
    poly2d_centroid_filename = os.path.join(utils_before_cleaning_dir, splitbasename[0] + "_" + splitbasename[1] + "_" + splitbasename[3] + "_poly2d_centroid" + filename_suffix + ".txt")

    if JOINT:
        cube_filename = os.path.join(output_path,splitbasename[0]+"_"+splitbasename[1]+"_"+splitbasename[3]+"_spectral_cube_ish"+joint_path_append+".fits")
    else:
        cube_filename = os.path.join(output_path,splitbasename[0]+"_"+splitbasename[1]+"_"+splitbasename[3]+"_spectral_cube_ish.fits")

    # regwvs WITH starsub
    regwvs_starsub_combdataobj = get_combined_regwvs(dataobj_list,
                                                     mask_charge_transfer_radius=mask_charge_transfer_radius,
                                                     use_starsub=True)
    if JOINT:
        pass #remain in sky coords
    else:
        regwvs_starsub_combdataobj.set_coords2ifu()

    # Fit a model PSF (WebbPSF) to the combined point cloud of dataobj_list
    debug_init,debug_end = None,None
    #debug_init,debug_end = 1000,1100 # min max wavelength indices for partial extraction
    aper_radius = 0.15

    webbpsf_reload = regwvs_starsub_combdataobj.reload_webbpsf_model()
    if webbpsf_reload is None:
        webbpsf_reload = regwvs_starsub_combdataobj.compute_webbpsf_model(
            wv_sampling=regwvs_starsub_combdataobj.wv_sampling,
            image_mask=None,
            pixelscale=0.1, oversample=10,
            parallelize=True, mppool=mypool,
            save_utils=True)
    wpsfs, wpsfs_header, wepsfs, webbpsf_wvs, webbpsf_X, webbpsf_Y, wpsf_oversample, wpsf_pixelscale = webbpsf_reload
    webbpsf_X = np.tile(webbpsf_X[None, :, :], (wepsfs.shape[0], 1, 1))
    webbpsf_Y = np.tile(webbpsf_Y[None, :, :], (wepsfs.shape[0], 1, 1))

    ###### Step 9 ######

    t0 = time.time()
    flux_cube,fluxerr_cube,ra_grid, dec_grid = \
        build_cube(regwvs_starsub_combdataobj, # combined point cloud
                   wepsfs, webbpsf_X, webbpsf_Y, # webbPSF model for flux extraction
                   ra_vec, dec_vec, # spatial sampling of final cube
                   out_filename=cube_filename,linear_interp=True,mppool=mypool,aper_radius=aper_radius,
                   debug_init=debug_init,debug_end=debug_end)
    t1 = time.time()
    print('build cube ran in {} seconds...'.format(np.round(t1-t0)))

    return pointcloud_interp,ra_vec,dec_vec

Now it is time to actually call the analysis_chain() function. There are a couple of variables which are iterated over

  • JOINT: boolean. If True, combine multiple sequences using sky coordinates before constructing the spectral cube. If False, requires specifying seq_num and will only analyze a single sequence using IFU coordinates instead.

  • seq_num: part of the filename identifier after the program id. The joint analysis uses 012, 013, and 014 and accomplishes this with the glob wildcard.

Additionally, if you are adapting this script to run on different datasets than the test dataset, the filename filter will need to be modified to match.

The cell first individually analyzes sequences 012, 013, 014, constructing cubes in IFU coordinates by iterating over the sequence numbers and detector strings with JOINT = False. Lastly, the cell combines all the sequences in sky coordinates using JOINT = True and modifying the filename filter to include the glob wildcard '01[2,3,4]' in place of the sequence number.

[11]:
for seq_num,JOINT in [('013',False)]: # For a partial test run, otherwise use the line below to run the full analysis on all sequences and both detectors
# for seq_num,JOINT in [('012',False),('013',False),('014',False),('01[2,3,4]',True)]:
    filename_filter = 'jw01414'+seq_num+'001_02101'
    for detector in ['nrs1','nrs2']: # or ['nrs1','nrs2'] for processing both detectors
        pointcloud_interp,ra_vec,dec_vec = analysis_chain()
2026-02-20 17:53:45,566 - stpipe.step - INFO - PARS-DARKCURRENTSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-darkcurrentstep_0005.asdf
2026-02-20 17:53:45,595 - stpipe.step - INFO - PARS-JUMPSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-jumpstep_0003.asdf
2026-02-20 17:53:45,605 - stpipe.pipeline - INFO - PARS-DETECTOR1PIPELINE parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-detector1pipeline_0004.asdf
2026-02-20 17:53:45,617 - stpipe.step - INFO - Detector1Pipeline instance created.
2026-02-20 17:53:45,618 - stpipe.step - INFO - GroupScaleStep instance created.
2026-02-20 17:53:45,619 - stpipe.step - INFO - DQInitStep instance created.
2026-02-20 17:53:45,619 - stpipe.step - INFO - EmiCorrStep instance created.
2026-02-20 17:53:45,620 - stpipe.step - INFO - SaturationStep instance created.
2026-02-20 17:53:45,620 - stpipe.step - INFO - IPCStep instance created.
2026-02-20 17:53:45,621 - stpipe.step - INFO - SuperBiasStep instance created.
2026-02-20 17:53:45,622 - stpipe.step - INFO - RefPixStep instance created.
2026-02-20 17:53:45,622 - stpipe.step - INFO - RscdStep instance created.
2026-02-20 17:53:45,623 - stpipe.step - INFO - FirstFrameStep instance created.
2026-02-20 17:53:45,623 - stpipe.step - INFO - LastFrameStep instance created.
2026-02-20 17:53:45,624 - stpipe.step - INFO - LinearityStep instance created.
2026-02-20 17:53:45,624 - stpipe.step - INFO - DarkCurrentStep instance created.
2026-02-20 17:53:45,625 - stpipe.step - INFO - ResetStep instance created.
2026-02-20 17:53:45,626 - stpipe.step - INFO - PersistenceStep instance created.
2026-02-20 17:53:45,626 - stpipe.step - INFO - ChargeMigrationStep instance created.
2026-02-20 17:53:45,627 - stpipe.step - INFO - JumpStep instance created.
2026-02-20 17:53:45,628 - stpipe.step - INFO - CleanFlickerNoiseStep instance created.
2026-02-20 17:53:45,629 - stpipe.step - INFO - RampFitStep instance created.
2026-02-20 17:53:45,629 - stpipe.step - INFO - GainScaleStep instance created.
2026-02-20 17:53:45,874 - stpipe.step - INFO - Step Detector1Pipeline running with args ('/stow/jruffio/data/JWST/tutorial/data/raw/jw01414013001_02101_00001_nrs1_uncal.fits',).
Searching in /stow/jruffio/data/JWST/tutorial/data/raw/ for files matching jw01414013001_02101_*_nrs1_uncal.fits
        Found 2 input files to process
        jw01414013001_02101_00001_nrs1_uncal.fits
        jw01414013001_02101_00002_nrs1_uncal.fits
Stage 1 Processing file 1 of 2.
2026-02-20 17:53:45,892 - stpipe.step - INFO - Step Detector1Pipeline parameters are:
  pre_hooks: []
  post_hooks: []
  output_file: None
  output_dir: /stow/jruffio/data/JWST/tutorial/data/G395H_stage1
  output_ext: .fits
  output_use_model: False
  output_use_index: True
  save_results: True
  skip: False
  suffix: None
  search_output_file: True
  input_dir: ''
  save_calibrated_ramp: False
  steps:
    group_scale:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    dq_init:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    emicorr:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      algorithm: joint
      nints_to_phase: None
      nbins: None
      scale_reference: True
      onthefly_corr_freq: None
      use_n_cycles: 3
      fit_ints_separately: False
      user_supplied_reffile: None
      save_intermediate_results: False
    saturation:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      n_pix_grow_sat: 0
      use_readpatt: True
    ipc:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
    superbias:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    refpix:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      odd_even_columns: True
      use_side_ref_pixels: True
      side_smoothing_length: 11
      side_gain: 1.0
      odd_even_rows: True
      ovr_corr_mitigation_ftr: 3.0
      preserve_irs2_refpix: False
      irs2_mean_subtraction: False
      refpix_algorithm: median
      sigreject: 4.0
      gaussmooth: 1.0
      halfwidth: 30
    rscd:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    firstframe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      bright_use_group1: True
    lastframe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    linearity:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    dark_current:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      dark_output: None
      average_dark_current: 0.0082
    reset:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    persistence:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      input_trapsfilled: ''
      flag_pers_cutoff: 40.0
      save_persistence: False
      save_trapsfilled: True
      modify_input: False
    charge_migration:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      signal_threshold: 25000.0
    jump:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      rejection_threshold: 4.0
      three_group_rejection_threshold: 6.0
      four_group_rejection_threshold: 5.0
      maximum_cores: '1'
      flag_4_neighbors: True
      max_jump_to_flag_neighbors: 1000
      min_jump_to_flag_neighbors: 30
      after_jump_flag_dn1: 0
      after_jump_flag_time1: 0
      after_jump_flag_dn2: 0
      after_jump_flag_time2: 0
      expand_large_events: True
      min_sat_area: 1
      min_jump_area: 5
      expand_factor: 2
      use_ellipses: False
      sat_required_snowball: True
      min_sat_radius_extend: 2.5
      sat_expand: 2
      edge_size: 25
      mask_snowball_core_next_int: True
      snowball_time_masked_next_int: 4000
      find_showers: False
      max_shower_amplitude: 4.0
      extend_snr_threshold: 0.0
      extend_min_area: 0
      extend_inner_radius: 0
      extend_outer_radius: 0.0
      extend_ellipse_expand_ratio: 0.0
      time_masked_after_shower: 0
      min_diffs_single_pass: 10
      max_extended_radius: 200
      minimum_groups: 3
      minimum_sigclip_groups: 100
      only_use_ints: True
    clean_flicker_noise:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      autoparam: False
      fit_method: median
      fit_by_channel: False
      background_method: median
      background_box_size: None
      mask_science_regions: False
      apply_flat_field: False
      n_sigma: 2.0
      fit_histogram: False
      single_mask: True
      user_mask: None
      save_mask: False
      save_background: False
      save_noise: False
    ramp_fit:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      algorithm: OLS_C
      int_name: ''
      save_opt: False
      opt_name: ''
      suppress_one_group: True
      firstgroup: None
      lastgroup: None
      maximum_cores: '1'
    gain_scale:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
2026-02-20 17:53:45,917 - stpipe.pipeline - INFO - Prefetching reference files for dataset: 'jw01414013001_02101_00001_nrs1_uncal.fits' reftypes = ['dark', 'gain', 'linearity', 'mask', 'readnoise', 'refpix', 'reset', 'rscd', 'saturation', 'sirskernel', 'superbias']
2026-02-20 17:53:45,920 - stpipe.pipeline - INFO - Prefetch for DARK reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dark_0489.fits'.
2026-02-20 17:53:45,920 - stpipe.pipeline - INFO - Prefetch for GAIN reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_gain_0023.fits'.
2026-02-20 17:53:45,920 - stpipe.pipeline - INFO - Prefetch for LINEARITY reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_linearity_0022.fits'.
2026-02-20 17:53:45,921 - stpipe.pipeline - INFO - Prefetch for MASK reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_mask_0078.fits'.
2026-02-20 17:53:45,922 - stpipe.pipeline - INFO - Prefetch for READNOISE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_readnoise_0038.fits'.
2026-02-20 17:53:45,922 - stpipe.pipeline - INFO - Prefetch for REFPIX reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_refpix_0019.fits'.
2026-02-20 17:53:45,923 - stpipe.pipeline - INFO - Prefetch for RESET reference file is 'N/A'.
2026-02-20 17:53:45,923 - stpipe.pipeline - INFO - Prefetch for RSCD reference file is 'N/A'.
2026-02-20 17:53:45,923 - stpipe.pipeline - INFO - Prefetch for SATURATION reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_saturation_0031.fits'.
2026-02-20 17:53:45,924 - stpipe.pipeline - INFO - Prefetch for SIRSKERNEL reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_sirskernel_0001.asdf'.
2026-02-20 17:53:45,924 - stpipe.pipeline - INFO - Prefetch for SUPERBIAS reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_superbias_0507.fits'.
2026-02-20 17:53:45,925 - jwst.pipeline.calwebb_detector1 - INFO - Starting calwebb_detector1 ...
2026-02-20 17:53:46,300 - stpipe.step - INFO - Step group_scale running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:53:46,362 - jwst.group_scale.group_scale_step - INFO - NFRAMES and FRMDIVSR are equal; correction not needed
2026-02-20 17:53:46,363 - jwst.group_scale.group_scale_step - INFO - Step will be skipped
2026-02-20 17:53:46,365 - stpipe.step - INFO - Step group_scale done
2026-02-20 17:53:46,512 - stpipe.step - INFO - Step dq_init running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:53:46,520 - jwst.dq_init.dq_init_step - INFO - Using MASK reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_mask_0078.fits
2026-02-20 17:53:46,893 - stpipe.step - INFO - Step dq_init done
2026-02-20 17:53:47,039 - stpipe.step - INFO - Step saturation running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:53:47,118 - jwst.saturation.saturation_step - INFO - Using SATURATION reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_saturation_0031.fits
2026-02-20 17:53:47,119 - jwst.saturation.saturation_step - INFO - Using SUPERBIAS reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_superbias_0507.fits
2026-02-20 17:53:47,852 - jwst.saturation.saturation - INFO - Using read_pattern with nframes 1
2026-02-20 17:53:48,248 - jwst.saturation.saturation - INFO - Detected 91633 saturated pixels
2026-02-20 17:53:48,280 - jwst.saturation.saturation - INFO - Detected 1 A/D floor pixels
2026-02-20 17:53:48,288 - stpipe.step - INFO - Step saturation done
2026-02-20 17:53:48,434 - stpipe.step - INFO - Step ipc running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:53:48,435 - stpipe.step - INFO - Step skipped.
2026-02-20 17:53:48,565 - stpipe.step - INFO - Step superbias running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:53:48,640 - jwst.superbias.superbias_step - INFO - Using SUPERBIAS reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_superbias_0507.fits
2026-02-20 17:53:48,744 - stpipe.step - INFO - Step superbias done
2026-02-20 17:53:48,891 - stpipe.step - INFO - Step refpix running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:53:48,999 - jwst.refpix.irs2_subtract_reference - INFO - Total bad reference pixels flagged: 28
2026-02-20 17:53:49,045 - jwst.refpix.irs2_subtract_reference - INFO - Total bad reference pixels replaced: 28
2026-02-20 17:53:49,048 - jwst.refpix.refpix_step - INFO - Using refpix reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_refpix_0019.fits
2026-02-20 17:53:49,651 - jwst.refpix.irs2_subtract_reference - INFO - Working on integration 1 out of 1
2026-02-20 17:54:06,102 - stpipe.step - INFO - Step refpix done
2026-02-20 17:54:06,243 - stpipe.step - INFO - Step linearity running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:54:06,286 - jwst.linearity.linearity_step - INFO - Using Linearity reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_linearity_0022.fits
2026-02-20 17:54:06,860 - stdatamodels.dynamicdq - WARNING - Keyword BAD_LIN_CORR does not correspond to an existing DQ mnemonic, so will be ignored
2026-02-20 17:54:07,219 - stpipe.step - INFO - Step linearity done
2026-02-20 17:54:07,364 - stpipe.step - INFO - Step dark_current running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:54:07,380 - jwst.dark_current.dark_current_step - INFO - Using DARK reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dark_0489.fits
2026-02-20 17:54:38,834 - jwst.dark_current.dark_current_step - INFO - Using Poisson noise from average dark current 0.0082 e-/sec
2026-02-20 17:54:38,834 - stcal.dark_current.dark_sub - INFO - Science data nints=1, ngroups=15, nframes=1, groupgap=0
2026-02-20 17:54:38,835 - stcal.dark_current.dark_sub - INFO - Dark data nints=1, ngroups=200, nframes=1, groupgap=0
2026-02-20 17:54:39,319 - stpipe.step - INFO - Step dark_current done
2026-02-20 17:54:39,475 - stpipe.step - INFO - Step charge_migration running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:54:39,476 - stpipe.step - INFO - Step skipped.
2026-02-20 17:54:39,626 - stpipe.step - INFO - Step jump running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:54:39,679 - jwst.jump.jump_step - INFO - CR rejection threshold = 4 sigma
2026-02-20 17:54:39,680 - jwst.jump.jump_step - INFO - Maximum cores to use = 1
2026-02-20 17:54:39,683 - jwst.jump.jump_step - INFO - Using GAIN reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_gain_0023.fits
2026-02-20 17:54:39,685 - jwst.jump.jump_step - INFO - Using READNOISE reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_readnoise_0038.fits
2026-02-20 17:54:40,112 - stcal.jump.jump - INFO - Executing two-point difference method
2026-02-20 17:54:42,359 - stcal.jump.jump - INFO - Flagging Snowballs
2026-02-20 17:54:42,728 - stcal.jump.jump - INFO - Total snowballs = 449
2026-02-20 17:54:42,729 - stcal.jump.jump - INFO - Total elapsed time = 2.61534 sec
2026-02-20 17:54:42,746 - jwst.jump.jump_step - INFO - The execution time in seconds: 3.106448
2026-02-20 17:54:42,748 - stpipe.step - INFO - Step jump done
2026-02-20 17:54:42,897 - stpipe.step - INFO - Step clean_flicker_noise running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:54:42,898 - stpipe.step - INFO - Step skipped.
2026-02-20 17:54:43,031 - stpipe.step - INFO - Step ramp_fit running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:54:43,095 - jwst.ramp_fitting.ramp_fit_step - INFO - Using READNOISE reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_readnoise_0038.fits
2026-02-20 17:54:43,096 - jwst.ramp_fitting.ramp_fit_step - INFO - Using GAIN reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_gain_0023.fits
2026-02-20 17:54:43,127 - jwst.ramp_fitting.ramp_fit_step - INFO - Using algorithm = OLS_C
2026-02-20 17:54:43,127 - jwst.ramp_fitting.ramp_fit_step - INFO - Using weighting = optimal
2026-02-20 17:54:43,565 - stcal.ramp_fitting.ols_fit - INFO - Number of multiprocessing slices: 1
2026-02-20 17:54:46,513 - stcal.ramp_fitting.ols_fit - INFO - Ramp Fitting C Time: 2.9438271522521973
2026-02-20 17:54:46,568 - stpipe.step - INFO - Step ramp_fit done
2026-02-20 17:54:46,717 - stpipe.step - INFO - Step gain_scale running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:54:46,739 - jwst.gain_scale.gain_scale - INFO - Rescaling by 1.0
2026-02-20 17:54:46,745 - stpipe.step - INFO - Step gain_scale done
2026-02-20 17:54:46,892 - stpipe.step - INFO - Step gain_scale running with args (<CubeModel(1, 2048, 2048) from jw01414013001_02101_00001_nrs1_uncal.fits>,).
2026-02-20 17:54:46,913 - jwst.gain_scale.gain_scale - INFO - Rescaling by 1.0
2026-02-20 17:54:46,919 - stpipe.step - INFO - Step gain_scale done
2026-02-20 17:54:47,034 - stpipe.step - INFO - Saved model in /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00001_nrs1_rateints.fits
2026-02-20 17:54:47,035 - jwst.pipeline.calwebb_detector1 - INFO - ... ending calwebb_detector1
2026-02-20 17:54:47,036 - jwst.stpipe.core - INFO - Results used CRDS context: jwst_1464.pmap
2026-02-20 17:54:47,130 - stpipe.step - INFO - Saved model in /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00001_nrs1_rate.fits
2026-02-20 17:54:47,131 - stpipe.step - INFO - Step Detector1Pipeline done
2026-02-20 17:54:47,131 - jwst.stpipe.core - INFO - Results used jwst version: 1.20.2
2026-02-20 17:54:47,173 - stpipe.step - INFO - PARS-DARKCURRENTSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-darkcurrentstep_0005.asdf
2026-02-20 17:54:47,182 - stpipe.step - INFO - PARS-JUMPSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-jumpstep_0003.asdf
2026-02-20 17:54:47,191 - stpipe.pipeline - INFO - PARS-DETECTOR1PIPELINE parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-detector1pipeline_0004.asdf
2026-02-20 17:54:47,204 - stpipe.step - INFO - Detector1Pipeline instance created.
2026-02-20 17:54:47,204 - stpipe.step - INFO - GroupScaleStep instance created.
2026-02-20 17:54:47,205 - stpipe.step - INFO - DQInitStep instance created.
2026-02-20 17:54:47,206 - stpipe.step - INFO - EmiCorrStep instance created.
2026-02-20 17:54:47,206 - stpipe.step - INFO - SaturationStep instance created.
2026-02-20 17:54:47,207 - stpipe.step - INFO - IPCStep instance created.
2026-02-20 17:54:47,208 - stpipe.step - INFO - SuperBiasStep instance created.
2026-02-20 17:54:47,209 - stpipe.step - INFO - RefPixStep instance created.
2026-02-20 17:54:47,209 - stpipe.step - INFO - RscdStep instance created.
2026-02-20 17:54:47,210 - stpipe.step - INFO - FirstFrameStep instance created.
2026-02-20 17:54:47,210 - stpipe.step - INFO - LastFrameStep instance created.
2026-02-20 17:54:47,211 - stpipe.step - INFO - LinearityStep instance created.
2026-02-20 17:54:47,212 - stpipe.step - INFO - DarkCurrentStep instance created.
2026-02-20 17:54:47,212 - stpipe.step - INFO - ResetStep instance created.
2026-02-20 17:54:47,213 - stpipe.step - INFO - PersistenceStep instance created.
2026-02-20 17:54:47,213 - stpipe.step - INFO - ChargeMigrationStep instance created.
2026-02-20 17:54:47,215 - stpipe.step - INFO - JumpStep instance created.
2026-02-20 17:54:47,215 - stpipe.step - INFO - CleanFlickerNoiseStep instance created.
2026-02-20 17:54:47,216 - stpipe.step - INFO - RampFitStep instance created.
2026-02-20 17:54:47,217 - stpipe.step - INFO - GainScaleStep instance created.
        Stage 1 Runtime so far: 61.6115 seconds
Stage 1 Processing file 2 of 2.
2026-02-20 17:54:47,364 - stpipe.step - INFO - Step Detector1Pipeline running with args ('/stow/jruffio/data/JWST/tutorial/data/raw/jw01414013001_02101_00002_nrs1_uncal.fits',).
2026-02-20 17:54:47,381 - stpipe.step - INFO - Step Detector1Pipeline parameters are:
  pre_hooks: []
  post_hooks: []
  output_file: None
  output_dir: /stow/jruffio/data/JWST/tutorial/data/G395H_stage1
  output_ext: .fits
  output_use_model: False
  output_use_index: True
  save_results: True
  skip: False
  suffix: None
  search_output_file: True
  input_dir: ''
  save_calibrated_ramp: False
  steps:
    group_scale:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    dq_init:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    emicorr:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      algorithm: joint
      nints_to_phase: None
      nbins: None
      scale_reference: True
      onthefly_corr_freq: None
      use_n_cycles: 3
      fit_ints_separately: False
      user_supplied_reffile: None
      save_intermediate_results: False
    saturation:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      n_pix_grow_sat: 0
      use_readpatt: True
    ipc:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
    superbias:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    refpix:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      odd_even_columns: True
      use_side_ref_pixels: True
      side_smoothing_length: 11
      side_gain: 1.0
      odd_even_rows: True
      ovr_corr_mitigation_ftr: 3.0
      preserve_irs2_refpix: False
      irs2_mean_subtraction: False
      refpix_algorithm: median
      sigreject: 4.0
      gaussmooth: 1.0
      halfwidth: 30
    rscd:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    firstframe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      bright_use_group1: True
    lastframe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    linearity:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    dark_current:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      dark_output: None
      average_dark_current: 0.0082
    reset:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    persistence:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      input_trapsfilled: ''
      flag_pers_cutoff: 40.0
      save_persistence: False
      save_trapsfilled: True
      modify_input: False
    charge_migration:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      signal_threshold: 25000.0
    jump:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      rejection_threshold: 4.0
      three_group_rejection_threshold: 6.0
      four_group_rejection_threshold: 5.0
      maximum_cores: '1'
      flag_4_neighbors: True
      max_jump_to_flag_neighbors: 1000
      min_jump_to_flag_neighbors: 30
      after_jump_flag_dn1: 0
      after_jump_flag_time1: 0
      after_jump_flag_dn2: 0
      after_jump_flag_time2: 0
      expand_large_events: True
      min_sat_area: 1
      min_jump_area: 5
      expand_factor: 2
      use_ellipses: False
      sat_required_snowball: True
      min_sat_radius_extend: 2.5
      sat_expand: 2
      edge_size: 25
      mask_snowball_core_next_int: True
      snowball_time_masked_next_int: 4000
      find_showers: False
      max_shower_amplitude: 4.0
      extend_snr_threshold: 0.0
      extend_min_area: 0
      extend_inner_radius: 0
      extend_outer_radius: 0.0
      extend_ellipse_expand_ratio: 0.0
      time_masked_after_shower: 0
      min_diffs_single_pass: 10
      max_extended_radius: 200
      minimum_groups: 3
      minimum_sigclip_groups: 100
      only_use_ints: True
    clean_flicker_noise:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      autoparam: False
      fit_method: median
      fit_by_channel: False
      background_method: median
      background_box_size: None
      mask_science_regions: False
      apply_flat_field: False
      n_sigma: 2.0
      fit_histogram: False
      single_mask: True
      user_mask: None
      save_mask: False
      save_background: False
      save_noise: False
    ramp_fit:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      algorithm: OLS_C
      int_name: ''
      save_opt: False
      opt_name: ''
      suppress_one_group: True
      firstgroup: None
      lastgroup: None
      maximum_cores: '1'
    gain_scale:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
2026-02-20 17:54:47,405 - stpipe.pipeline - INFO - Prefetching reference files for dataset: 'jw01414013001_02101_00002_nrs1_uncal.fits' reftypes = ['dark', 'gain', 'linearity', 'mask', 'readnoise', 'refpix', 'reset', 'rscd', 'saturation', 'sirskernel', 'superbias']
2026-02-20 17:54:47,408 - stpipe.pipeline - INFO - Prefetch for DARK reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dark_0489.fits'.
2026-02-20 17:54:47,408 - stpipe.pipeline - INFO - Prefetch for GAIN reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_gain_0023.fits'.
2026-02-20 17:54:47,409 - stpipe.pipeline - INFO - Prefetch for LINEARITY reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_linearity_0022.fits'.
2026-02-20 17:54:47,409 - stpipe.pipeline - INFO - Prefetch for MASK reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_mask_0078.fits'.
2026-02-20 17:54:47,410 - stpipe.pipeline - INFO - Prefetch for READNOISE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_readnoise_0038.fits'.
2026-02-20 17:54:47,410 - stpipe.pipeline - INFO - Prefetch for REFPIX reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_refpix_0019.fits'.
2026-02-20 17:54:47,411 - stpipe.pipeline - INFO - Prefetch for RESET reference file is 'N/A'.
2026-02-20 17:54:47,411 - stpipe.pipeline - INFO - Prefetch for RSCD reference file is 'N/A'.
2026-02-20 17:54:47,411 - stpipe.pipeline - INFO - Prefetch for SATURATION reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_saturation_0031.fits'.
2026-02-20 17:54:47,413 - stpipe.pipeline - INFO - Prefetch for SIRSKERNEL reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_sirskernel_0001.asdf'.
2026-02-20 17:54:47,413 - stpipe.pipeline - INFO - Prefetch for SUPERBIAS reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_superbias_0507.fits'.
2026-02-20 17:54:47,414 - jwst.pipeline.calwebb_detector1 - INFO - Starting calwebb_detector1 ...
2026-02-20 17:54:47,788 - stpipe.step - INFO - Step group_scale running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:54:47,850 - jwst.group_scale.group_scale_step - INFO - NFRAMES and FRMDIVSR are equal; correction not needed
2026-02-20 17:54:47,851 - jwst.group_scale.group_scale_step - INFO - Step will be skipped
2026-02-20 17:54:47,852 - stpipe.step - INFO - Step group_scale done
2026-02-20 17:54:47,998 - stpipe.step - INFO - Step dq_init running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:54:48,007 - jwst.dq_init.dq_init_step - INFO - Using MASK reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_mask_0078.fits
2026-02-20 17:54:48,234 - stpipe.step - INFO - Step dq_init done
2026-02-20 17:54:48,382 - stpipe.step - INFO - Step saturation running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:54:48,460 - jwst.saturation.saturation_step - INFO - Using SATURATION reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_saturation_0031.fits
2026-02-20 17:54:48,461 - jwst.saturation.saturation_step - INFO - Using SUPERBIAS reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_superbias_0507.fits
2026-02-20 17:54:48,545 - jwst.saturation.saturation - INFO - Using read_pattern with nframes 1
2026-02-20 17:54:48,943 - jwst.saturation.saturation - INFO - Detected 88604 saturated pixels
2026-02-20 17:54:48,974 - jwst.saturation.saturation - INFO - Detected 0 A/D floor pixels
2026-02-20 17:54:48,983 - stpipe.step - INFO - Step saturation done
2026-02-20 17:54:49,128 - stpipe.step - INFO - Step ipc running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:54:49,129 - stpipe.step - INFO - Step skipped.
2026-02-20 17:54:49,262 - stpipe.step - INFO - Step superbias running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:54:49,337 - jwst.superbias.superbias_step - INFO - Using SUPERBIAS reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_superbias_0507.fits
2026-02-20 17:54:49,442 - stpipe.step - INFO - Step superbias done
2026-02-20 17:54:49,589 - stpipe.step - INFO - Step refpix running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:54:49,698 - jwst.refpix.irs2_subtract_reference - INFO - Total bad reference pixels flagged: 48
2026-02-20 17:54:49,744 - jwst.refpix.irs2_subtract_reference - INFO - Total bad reference pixels replaced: 48
2026-02-20 17:54:49,747 - jwst.refpix.refpix_step - INFO - Using refpix reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_refpix_0019.fits
2026-02-20 17:54:49,926 - jwst.refpix.irs2_subtract_reference - INFO - Working on integration 1 out of 1
2026-02-20 17:55:06,385 - stpipe.step - INFO - Step refpix done
2026-02-20 17:55:06,529 - stpipe.step - INFO - Step linearity running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:55:06,571 - jwst.linearity.linearity_step - INFO - Using Linearity reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_linearity_0022.fits
2026-02-20 17:55:06,617 - stdatamodels.dynamicdq - WARNING - Keyword BAD_LIN_CORR does not correspond to an existing DQ mnemonic, so will be ignored
2026-02-20 17:55:06,974 - stpipe.step - INFO - Step linearity done
2026-02-20 17:55:07,122 - stpipe.step - INFO - Step dark_current running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:55:07,138 - jwst.dark_current.dark_current_step - INFO - Using DARK reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dark_0489.fits
2026-02-20 17:55:08,269 - jwst.dark_current.dark_current_step - INFO - Using Poisson noise from average dark current 0.0082 e-/sec
2026-02-20 17:55:08,270 - stcal.dark_current.dark_sub - INFO - Science data nints=1, ngroups=15, nframes=1, groupgap=0
2026-02-20 17:55:08,271 - stcal.dark_current.dark_sub - INFO - Dark data nints=1, ngroups=200, nframes=1, groupgap=0
2026-02-20 17:55:08,754 - stpipe.step - INFO - Step dark_current done
2026-02-20 17:55:08,899 - stpipe.step - INFO - Step charge_migration running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:55:08,901 - stpipe.step - INFO - Step skipped.
2026-02-20 17:55:09,031 - stpipe.step - INFO - Step jump running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:55:09,083 - jwst.jump.jump_step - INFO - CR rejection threshold = 4 sigma
2026-02-20 17:55:09,084 - jwst.jump.jump_step - INFO - Maximum cores to use = 1
2026-02-20 17:55:09,086 - jwst.jump.jump_step - INFO - Using GAIN reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_gain_0023.fits
2026-02-20 17:55:09,089 - jwst.jump.jump_step - INFO - Using READNOISE reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_readnoise_0038.fits
2026-02-20 17:55:09,256 - stcal.jump.jump - INFO - Executing two-point difference method
2026-02-20 17:55:11,490 - stcal.jump.jump - INFO - Flagging Snowballs
2026-02-20 17:55:11,813 - stcal.jump.jump - INFO - Total snowballs = 382
2026-02-20 17:55:11,814 - stcal.jump.jump - INFO - Total elapsed time = 2.55744 sec
2026-02-20 17:55:11,831 - jwst.jump.jump_step - INFO - The execution time in seconds: 2.787854
2026-02-20 17:55:11,833 - stpipe.step - INFO - Step jump done
2026-02-20 17:55:11,978 - stpipe.step - INFO - Step clean_flicker_noise running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:55:11,979 - stpipe.step - INFO - Step skipped.
2026-02-20 17:55:12,110 - stpipe.step - INFO - Step ramp_fit running with args (<RampModel(1, 15, 3200, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:55:12,175 - jwst.ramp_fitting.ramp_fit_step - INFO - Using READNOISE reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_readnoise_0038.fits
2026-02-20 17:55:12,175 - jwst.ramp_fitting.ramp_fit_step - INFO - Using GAIN reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_gain_0023.fits
2026-02-20 17:55:12,206 - jwst.ramp_fitting.ramp_fit_step - INFO - Using algorithm = OLS_C
2026-02-20 17:55:12,206 - jwst.ramp_fitting.ramp_fit_step - INFO - Using weighting = optimal
2026-02-20 17:55:12,678 - stcal.ramp_fitting.ols_fit - INFO - Number of multiprocessing slices: 1
2026-02-20 17:55:15,532 - stcal.ramp_fitting.ols_fit - INFO - Ramp Fitting C Time: 2.8500783443450928
2026-02-20 17:55:15,587 - stpipe.step - INFO - Step ramp_fit done
2026-02-20 17:55:15,732 - stpipe.step - INFO - Step gain_scale running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:55:15,752 - jwst.gain_scale.gain_scale - INFO - Rescaling by 1.0
2026-02-20 17:55:15,758 - stpipe.step - INFO - Step gain_scale done
2026-02-20 17:55:15,902 - stpipe.step - INFO - Step gain_scale running with args (<CubeModel(1, 2048, 2048) from jw01414013001_02101_00002_nrs1_uncal.fits>,).
2026-02-20 17:55:15,922 - jwst.gain_scale.gain_scale - INFO - Rescaling by 1.0
2026-02-20 17:55:15,928 - stpipe.step - INFO - Step gain_scale done
2026-02-20 17:55:16,049 - stpipe.step - INFO - Saved model in /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00002_nrs1_rateints.fits
2026-02-20 17:55:16,050 - jwst.pipeline.calwebb_detector1 - INFO - ... ending calwebb_detector1
2026-02-20 17:55:16,051 - jwst.stpipe.core - INFO - Results used CRDS context: jwst_1464.pmap
2026-02-20 17:55:16,146 - stpipe.step - INFO - Saved model in /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00002_nrs1_rate.fits
2026-02-20 17:55:16,147 - stpipe.step - INFO - Step Detector1Pipeline done
2026-02-20 17:55:16,147 - jwst.stpipe.core - INFO - Results used jwst version: 1.20.2
        Stage 1 Runtime so far: 90.6279 seconds
Stage 1 Total Runtime: 90.6280 seconds
2026-02-20 17:55:17,858 - stpipe.step - INFO - PARS-RESAMPLESPECSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-resamplespecstep_0001.asdf
2026-02-20 17:55:17,872 - stpipe.step - INFO - PARS-RESAMPLESPECSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-resamplespecstep_0001.asdf
2026-02-20 17:55:17,891 - stpipe.step - INFO - Spec2Pipeline instance created.
2026-02-20 17:55:17,892 - stpipe.step - INFO - AssignWcsStep instance created.
2026-02-20 17:55:17,893 - stpipe.step - INFO - BadpixSelfcalStep instance created.
2026-02-20 17:55:17,893 - stpipe.step - INFO - MSAFlagOpenStep instance created.
2026-02-20 17:55:17,894 - stpipe.step - INFO - NSCleanStep instance created.
2026-02-20 17:55:17,895 - stpipe.step - INFO - BackgroundStep instance created.
2026-02-20 17:55:17,896 - stpipe.step - INFO - ImprintStep instance created.
2026-02-20 17:55:17,896 - stpipe.step - INFO - Extract2dStep instance created.
2026-02-20 17:55:17,900 - stpipe.step - INFO - MasterBackgroundMosStep instance created.
2026-02-20 17:55:17,901 - stpipe.step - INFO - FlatFieldStep instance created.
2026-02-20 17:55:17,902 - stpipe.step - INFO - PathLossStep instance created.
2026-02-20 17:55:17,902 - stpipe.step - INFO - BarShadowStep instance created.
2026-02-20 17:55:17,903 - stpipe.step - INFO - PhotomStep instance created.
2026-02-20 17:55:17,903 - stpipe.step - INFO - PixelReplaceStep instance created.
2026-02-20 17:55:17,905 - stpipe.step - INFO - ResampleSpecStep instance created.
2026-02-20 17:55:17,906 - stpipe.step - INFO - Extract1dStep instance created.
2026-02-20 17:55:17,907 - stpipe.step - INFO - WavecorrStep instance created.
2026-02-20 17:55:17,908 - stpipe.step - INFO - FlatFieldStep instance created.
2026-02-20 17:55:17,909 - stpipe.step - INFO - SourceTypeStep instance created.
2026-02-20 17:55:17,909 - stpipe.step - INFO - StraylightStep instance created.
2026-02-20 17:55:17,910 - stpipe.step - INFO - FringeStep instance created.
2026-02-20 17:55:17,911 - stpipe.step - INFO - ResidualFringeStep instance created.
2026-02-20 17:55:17,911 - stpipe.step - INFO - PathLossStep instance created.
2026-02-20 17:55:17,912 - stpipe.step - INFO - BarShadowStep instance created.
2026-02-20 17:55:17,913 - stpipe.step - INFO - WfssContamStep instance created.
2026-02-20 17:55:17,913 - stpipe.step - INFO - PhotomStep instance created.
2026-02-20 17:55:17,914 - stpipe.step - INFO - PixelReplaceStep instance created.
2026-02-20 17:55:17,915 - stpipe.step - INFO - ResampleSpecStep instance created.
2026-02-20 17:55:17,916 - stpipe.step - INFO - CubeBuildStep instance created.
2026-02-20 17:55:17,917 - stpipe.step - INFO - Extract1dStep instance created.
Plots saved to /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/plots_stage1_jw01414013001_nrs1.pdf
Stage 2 Processing file 1 of 2.
2026-02-20 17:55:18,070 - stpipe.step - INFO - Step Spec2Pipeline running with args ('/stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00001_nrs1_rate.fits',).
2026-02-20 17:55:18,098 - stpipe.step - INFO - Step Spec2Pipeline parameters are:
  pre_hooks: []
  post_hooks: []
  output_file: None
  output_dir: /stow/jruffio/data/JWST/tutorial/data/G395H_stage2
  output_ext: .fits
  output_use_model: False
  output_use_index: True
  save_results: True
  skip: False
  suffix: None
  search_output_file: True
  input_dir: ''
  save_bsub: False
  fail_on_exception: True
  save_wfss_esec: False
  steps:
    assign_wcs:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      sip_approx: True
      sip_max_pix_error: 0.01
      sip_degree: None
      sip_max_inv_pix_error: 0.01
      sip_inv_degree: None
      sip_npoints: 12
      slit_y_low: -0.55
      slit_y_high: 0.55
      nrs_ifu_slice_wcs: False
    badpix_selfcal:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      flagfrac_lower: 0.001
      flagfrac_upper: 0.001
      kernel_size: 15
      force_single: False
      save_flagged_bkg: False
    msa_flagging:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    nsclean:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      fit_method: fft
      fit_by_channel: False
      background_method: None
      background_box_size: None
      mask_spectral_regions: True
      n_sigma: 5.0
      fit_histogram: False
      single_mask: False
      user_mask: None
      save_mask: False
      save_background: False
      save_noise: False
    bkg_subtract:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      bkg_list: None
      save_combined_background: False
      sigma: 3.0
      maxiters: None
      soss_source_percentile: 35.0
      soss_bkg_percentile: None
      wfss_mmag_extract: None
      wfss_maxiter: 5
      wfss_rms_stop: 0.0
      wfss_outlier_percent: 1.0
    imprint_subtract:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    extract_2d:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      slit_names: None
      source_ids: None
      extract_orders: None
      grism_objects: None
      tsgrism_extract_height: None
      wfss_extract_half_height: 5
      wfss_mmag_extract: None
      wfss_nbright: 1000
    master_background_mos:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      sigma_clip: 3.0
      median_kernel: 1
      force_subtract: False
      save_background: False
      user_background: None
      inverse: False
      steps:
        flat_field:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          save_interpolated_flat: False
          user_supplied_flat: None
          inverse: False
        pathloss:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
          user_slit_loc: None
        barshadow:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
        photom:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
          apply_time_correction: True
        pixel_replace:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: True
          output_use_index: True
          save_results: False
          skip: True
          suffix: None
          search_output_file: True
          input_dir: ''
          algorithm: fit_profile
          n_adjacent_cols: 3
        resample_spec:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          pixfrac: 1.0
          kernel: square
          fillval: NaN
          weight_type: exptime
          output_shape: None
          pixel_scale_ratio: 1.0
          pixel_scale: None
          output_wcs: ''
          single: False
          blendheaders: True
          in_memory: True
        extract_1d:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          subtract_background: None
          apply_apcorr: True
          extraction_type: box
          use_source_posn: None
          position_offset: 0.0
          model_nod_pair: True
          optimize_psf_location: True
          smoothing_length: None
          bkg_fit: None
          bkg_order: None
          log_increment: 50
          save_profile: False
          save_scene_model: False
          save_residual_image: False
          center_xy: None
          ifu_autocen: False
          bkg_sigma_clip: 3.0
          ifu_rfcorr: True
          ifu_set_srctype: None
          ifu_rscale: None
          ifu_covar_scale: 1.0
          soss_atoca: True
          soss_threshold: 0.01
          soss_n_os: 2
          soss_wave_grid_in: None
          soss_wave_grid_out: None
          soss_estimate: None
          soss_rtol: 0.0001
          soss_max_grid_size: 20000
          soss_tikfac: None
          soss_width: 40.0
          soss_bad_pix: masking
          soss_modelname: None
          soss_order_3: True
    wavecorr:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    flat_field:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      save_interpolated_flat: False
      user_supplied_flat: None
      inverse: False
    srctype:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      source_type: None
    straylight:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      clean_showers: False
      shower_plane: 3
      shower_x_stddev: 18.0
      shower_y_stddev: 5.0
      shower_low_reject: 0.1
      shower_high_reject: 99.9
      save_shower_model: False
    fringe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    residual_fringe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: residual_fringe
      search_output_file: False
      input_dir: ''
      save_intermediate_results: False
      ignore_region_min: None
      ignore_region_max: None
    pathloss:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
      user_slit_loc: None
    barshadow:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
    wfss_contam:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      save_simulated_image: False
      save_contam_images: False
      maximum_cores: none
      orders: None
      magnitude_limit: None
      wl_oversample: 2
      max_pixels_per_chunk: 50000
    photom:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
      apply_time_correction: True
    pixel_replace:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      algorithm: fit_profile
      n_adjacent_cols: 3
    resample_spec:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      pixfrac: 1.0
      kernel: square
      fillval: NaN
      weight_type: exptime
      output_shape: None
      pixel_scale_ratio: 1.0
      pixel_scale: None
      output_wcs: ''
      single: False
      blendheaders: True
      in_memory: True
    cube_build:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: True
      suffix: s3d
      search_output_file: False
      input_dir: ''
      pipeline: 3
      channel: all
      band: all
      grating: all
      filter: all
      output_type: None
      scalexy: 0.0
      scalew: 0.0
      weighting: drizzle
      coord_system: skyalign
      ra_center: None
      dec_center: None
      cube_pa: None
      nspax_x: None
      nspax_y: None
      rois: 0.0
      roiw: 0.0
      weight_power: 2.0
      wavemin: None
      wavemax: None
      single: False
      skip_dqflagging: False
      offset_file: None
      debug_spaxel: -1 -1 -1
    extract_1d:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      subtract_background: None
      apply_apcorr: True
      extraction_type: box
      use_source_posn: None
      position_offset: 0.0
      model_nod_pair: True
      optimize_psf_location: True
      smoothing_length: None
      bkg_fit: None
      bkg_order: None
      log_increment: 50
      save_profile: False
      save_scene_model: False
      save_residual_image: False
      center_xy: None
      ifu_autocen: False
      bkg_sigma_clip: 3.0
      ifu_rfcorr: True
      ifu_set_srctype: None
      ifu_rscale: None
      ifu_covar_scale: 1.0
      soss_atoca: True
      soss_threshold: 0.01
      soss_n_os: 2
      soss_wave_grid_in: None
      soss_wave_grid_out: None
      soss_estimate: None
      soss_rtol: 0.0001
      soss_max_grid_size: 20000
      soss_tikfac: None
      soss_width: 40.0
      soss_bad_pix: masking
      soss_modelname: None
      soss_order_3: True
2026-02-20 17:55:18,126 - stpipe.pipeline - INFO - Prefetching reference files for dataset: 'jw01414013001_02101_00001_nrs1_rate.fits' reftypes = ['area', 'barshadow', 'bkg', 'camera', 'collimator', 'dflat', 'disperser', 'distortion', 'fflat', 'filteroffset', 'flat', 'fore', 'fpa', 'fringe', 'ifufore', 'ifupost', 'ifuslicer', 'mrsxartcorr', 'msa', 'msaoper', 'ote', 'pathloss', 'photom', 'regions', 'sflat', 'specwcs', 'wavecorr', 'wavelengthrange']
2026-02-20 17:55:18,130 - stpipe.pipeline - INFO - Prefetch for AREA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_area_0034.fits'.
2026-02-20 17:55:18,130 - stpipe.pipeline - INFO - Prefetch for BARSHADOW reference file is 'N/A'.
2026-02-20 17:55:18,131 - stpipe.pipeline - INFO - Prefetch for BKG reference file is 'N/A'.
2026-02-20 17:55:18,131 - stpipe.pipeline - INFO - Prefetch for CAMERA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_camera_0010.asdf'.
2026-02-20 17:55:18,132 - stpipe.pipeline - INFO - Prefetch for COLLIMATOR reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_collimator_0010.asdf'.
2026-02-20 17:55:18,132 - stpipe.pipeline - INFO - Prefetch for DFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dflat_0001.fits'.
2026-02-20 17:55:18,133 - stpipe.pipeline - INFO - Prefetch for DISPERSER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_disperser_0083.asdf'.
2026-02-20 17:55:18,133 - stpipe.pipeline - INFO - Prefetch for DISTORTION reference file is 'N/A'.
2026-02-20 17:55:18,134 - stpipe.pipeline - INFO - Prefetch for FFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fflat_0174.fits'.
2026-02-20 17:55:18,134 - stpipe.pipeline - INFO - Prefetch for FILTEROFFSET reference file is 'N/A'.
2026-02-20 17:55:18,135 - stpipe.pipeline - INFO - Prefetch for FLAT reference file is 'N/A'.
2026-02-20 17:55:18,135 - stpipe.pipeline - INFO - Prefetch for FORE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fore_0065.asdf'.
2026-02-20 17:55:18,135 - stpipe.pipeline - INFO - Prefetch for FPA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fpa_0011.asdf'.
2026-02-20 17:55:18,136 - stpipe.pipeline - INFO - Prefetch for FRINGE reference file is 'N/A'.
2026-02-20 17:55:18,136 - stpipe.pipeline - INFO - Prefetch for IFUFORE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifufore_0015.asdf'.
2026-02-20 17:55:18,137 - stpipe.pipeline - INFO - Prefetch for IFUPOST reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifupost_0016.asdf'.
2026-02-20 17:55:18,137 - stpipe.pipeline - INFO - Prefetch for IFUSLICER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifuslicer_0015.asdf'.
2026-02-20 17:55:18,138 - stpipe.pipeline - INFO - Prefetch for MRSXARTCORR reference file is 'N/A'.
2026-02-20 17:55:18,138 - stpipe.pipeline - INFO - Prefetch for MSA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msa_0011.asdf'.
2026-02-20 17:55:18,139 - stpipe.pipeline - INFO - Prefetch for MSAOPER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msaoper_0011.json'.
2026-02-20 17:55:18,139 - stpipe.pipeline - INFO - Prefetch for OTE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ote_0013.asdf'.
2026-02-20 17:55:18,140 - stpipe.pipeline - INFO - Prefetch for PATHLOSS reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pathloss_0003.fits'.
2026-02-20 17:55:18,140 - stpipe.pipeline - INFO - Prefetch for PHOTOM reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_photom_0016.fits'.
2026-02-20 17:55:18,141 - stpipe.pipeline - INFO - Prefetch for REGIONS reference file is 'N/A'.
2026-02-20 17:55:18,141 - stpipe.pipeline - INFO - Prefetch for SFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_sflat_0219.fits'.
2026-02-20 17:55:18,141 - stpipe.pipeline - INFO - Prefetch for SPECWCS reference file is 'N/A'.
2026-02-20 17:55:18,142 - stpipe.pipeline - INFO - Prefetch for WAVECORR reference file is 'N/A'.
2026-02-20 17:55:18,142 - stpipe.pipeline - INFO - Prefetch for WAVELENGTHRANGE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_wavelengthrange_0008.asdf'.
2026-02-20 17:55:18,143 - jwst.pipeline.calwebb_spec2 - INFO - Starting calwebb_spec2 ...
2026-02-20 17:55:18,143 - jwst.pipeline.calwebb_spec2 - INFO - Processing product /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00001_nrs1
2026-02-20 17:55:18,144 - jwst.pipeline.calwebb_spec2 - INFO - Working on input /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00001_nrs1_rate.fits ...
2026-02-20 17:55:18,334 - stpipe.step - INFO - Step assign_wcs running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:55:18,384 - jwst.assign_wcs.nirspec - INFO - gwa_ytilt is 0.144672647 deg
2026-02-20 17:55:18,384 - jwst.assign_wcs.nirspec - INFO - gwa_xtilt is 0.319160342 deg
2026-02-20 17:55:18,385 - jwst.assign_wcs.nirspec - INFO - theta_y correction: 0.0001127116201274071 deg
2026-02-20 17:55:18,386 - jwst.assign_wcs.nirspec - INFO - theta_x correction: 8.739014225467499e-05 deg
2026-02-20 17:55:18,450 - jwst.assign_wcs.nirspec - INFO - Applied Barycentric velocity correction : 0.9999124176092914
2026-02-20 17:55:19,801 - jwst.assign_wcs.nirspec - INFO - Created a NIRSPEC nrs_ifu pipeline with references {'distortion': None, 'filteroffset': None, 'specwcs': None, 'regions': None, 'wavelengthrange': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_wavelengthrange_0008.asdf', 'camera': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_camera_0010.asdf', 'collimator': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_collimator_0010.asdf', 'disperser': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_disperser_0083.asdf', 'fore': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fore_0065.asdf', 'fpa': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fpa_0011.asdf', 'msa': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msa_0011.asdf', 'ote': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ote_0013.asdf', 'ifupost': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifupost_0016.asdf', 'ifufore': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifufore_0015.asdf', 'ifuslicer': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifuslicer_0015.asdf'}
2026-02-20 17:55:24,398 - stcal.alignment.util - INFO - Update S_REGION to POLYGON ICRS  46.826578143 -13.764355816 46.827850044 -13.764355816 46.827850044 -13.763091425 46.826578143 -13.763091425
2026-02-20 17:55:27,749 - jwst.assign_wcs.assign_wcs - INFO - COMPLETED assign_wcs
2026-02-20 17:55:27,753 - stpipe.step - INFO - Step assign_wcs done
2026-02-20 17:55:28,040 - stpipe.step - INFO - Step badpix_selfcal running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>, [], []).
2026-02-20 17:55:28,041 - stpipe.step - INFO - Step skipped.
2026-02-20 17:55:28,299 - stpipe.step - INFO - Step msa_flagging running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:55:30,074 - jwst.msaflagopen.msaflagopen_step - INFO - Using reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msaoper_0011.json
2026-02-20 17:55:30,151 - jwst.msaflagopen.msaflag_open - INFO - 23 failed open shutters
2026-02-20 17:55:35,464 - stpipe.step - INFO - Step msa_flagging done
2026-02-20 17:55:36,151 - stpipe.step - INFO - Step nsclean running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:55:36,153 - jwst.nsclean.nsclean_step - WARNING - The 'nsclean' step is a deprecated alias to 'clean_flicker_noise' and will be removed in future builds.
2026-02-20 17:55:36,160 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Input exposure type is NRS_IFU, detector=NRS1
2026-02-20 17:55:38,458 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Flagging failed-open MSA shutters for scene masking
2026-02-20 17:55:38,459 - stpipe.step - INFO - MSAFlagOpenStep instance created.
2026-02-20 17:55:47,076 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Creating mask
2026-02-20 17:55:47,077 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Finding slice pixels for an IFU image
2026-02-20 17:55:48,363 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Masking the fixed slit region for IFU data.
2026-02-20 17:55:48,504 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Cleaning image jw01414013001_02101_00001_nrs1_rate.fits
2026-02-20 17:55:49,679 - stpipe.step - INFO - Step nsclean done
2026-02-20 17:55:50,613 - stpipe.step - INFO - Step imprint_subtract running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>, []).
2026-02-20 17:55:50,615 - stpipe.step - INFO - Step skipped.
2026-02-20 17:55:50,984 - stpipe.step - INFO - Step bkg_subtract running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>, []).
2026-02-20 17:55:50,985 - stpipe.step - INFO - Step skipped.
2026-02-20 17:55:51,356 - stpipe.step - INFO - Step srctype running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:55:54,034 - jwst.srctype.srctype - INFO - Input EXP_TYPE is NRS_IFU
2026-02-20 17:55:54,035 - jwst.srctype.srctype - INFO - Input SRCTYAPT = POINT
2026-02-20 17:55:54,035 - jwst.srctype.srctype - INFO - Using input source type = POINT
2026-02-20 17:55:54,037 - stpipe.step - INFO - Step srctype done
2026-02-20 17:55:54,510 - stpipe.step - INFO - Step straylight running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:55:54,511 - stpipe.step - INFO - Step skipped.
2026-02-20 17:55:54,965 - stpipe.step - INFO - Step flat_field running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:55:54,978 - jwst.flatfield.flat_field_step - INFO - No reference found for type FLAT
2026-02-20 17:55:54,999 - jwst.flatfield.flat_field_step - INFO - Using FFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fflat_0174.fits
2026-02-20 17:55:55,390 - jwst.flatfield.flat_field_step - INFO - Using SFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_sflat_0219.fits
2026-02-20 17:55:58,411 - jwst.flatfield.flat_field_step - INFO - Using DFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dflat_0001.fits
2026-02-20 17:56:04,447 - stpipe.step - INFO - Step flat_field done
2026-02-20 17:56:05,051 - stpipe.step - INFO - Step fringe running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:56:05,053 - stpipe.step - INFO - Step skipped.
2026-02-20 17:56:05,503 - stpipe.step - INFO - Step pathloss running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:56:05,512 - jwst.pathloss.pathloss_step - INFO - Using PATHLOSS reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pathloss_0003.fits
2026-02-20 17:56:05,526 - jwst.pathloss.pathloss - INFO - Input exposure type is NRS_IFU
2026-02-20 17:56:08,579 - stpipe.step - INFO - Step pathloss done
2026-02-20 17:56:09,193 - stpipe.step - INFO - Step barshadow running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:56:09,195 - stpipe.step - INFO - Step skipped.
2026-02-20 17:56:09,656 - stpipe.step - INFO - Step photom running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:56:09,667 - jwst.photom.photom_step - INFO - Using photom reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_photom_0016.fits
2026-02-20 17:56:09,668 - jwst.photom.photom_step - INFO - Using area reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_area_0034.fits
2026-02-20 17:56:11,269 - jwst.photom.photom - INFO - Using instrument: NIRSPEC
2026-02-20 17:56:11,270 - jwst.photom.photom - INFO -  detector: NRS1
2026-02-20 17:56:11,270 - jwst.photom.photom - INFO -  exp_type: NRS_IFU
2026-02-20 17:56:11,271 - jwst.photom.photom - INFO -  filter: F290LP
2026-02-20 17:56:11,271 - jwst.photom.photom - INFO -  grating: G395H
2026-02-20 17:56:11,297 - jwst.photom.photom - INFO - PHOTMJSR value: 3.83378e+12
2026-02-20 17:56:12,668 - stpipe.step - INFO - Step photom done
2026-02-20 17:56:13,287 - stpipe.step - INFO - Step residual_fringe running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 17:56:13,288 - stpipe.step - INFO - Step skipped.
2026-02-20 17:56:16,003 - stpipe.step - INFO - Step pixel_replace running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits>,).
2026-02-20 17:56:16,004 - stpipe.step - INFO - Step skipped.
2026-02-20 17:56:16,475 - stpipe.step - INFO - Step cube_build running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits>,).
2026-02-20 17:56:16,476 - stpipe.step - INFO - Step skipped.
2026-02-20 17:56:19,161 - stpipe.step - INFO - Step extract_1d running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits>,).
2026-02-20 17:56:19,163 - stpipe.step - INFO - Step skipped.
2026-02-20 17:56:19,164 - jwst.pipeline.calwebb_spec2 - INFO - Finished processing product /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00001_nrs1
2026-02-20 17:56:19,165 - jwst.pipeline.calwebb_spec2 - INFO - Ending calwebb_spec2
2026-02-20 17:56:19,165 - jwst.stpipe.core - INFO - Results used CRDS context: jwst_1464.pmap
2026-02-20 17:56:20,537 - stpipe.step - INFO - Saved model in /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits
2026-02-20 17:56:20,538 - stpipe.step - INFO - Step Spec2Pipeline done
2026-02-20 17:56:20,539 - jwst.stpipe.core - INFO - Results used jwst version: 1.20.2
2026-02-20 17:56:20,591 - stpipe.step - INFO - PARS-RESAMPLESPECSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-resamplespecstep_0001.asdf
2026-02-20 17:56:20,604 - stpipe.step - INFO - PARS-RESAMPLESPECSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-resamplespecstep_0001.asdf
2026-02-20 17:56:20,623 - stpipe.step - INFO - Spec2Pipeline instance created.
2026-02-20 17:56:20,624 - stpipe.step - INFO - AssignWcsStep instance created.
2026-02-20 17:56:20,625 - stpipe.step - INFO - BadpixSelfcalStep instance created.
2026-02-20 17:56:20,626 - stpipe.step - INFO - MSAFlagOpenStep instance created.
2026-02-20 17:56:20,627 - stpipe.step - INFO - NSCleanStep instance created.
2026-02-20 17:56:20,627 - stpipe.step - INFO - BackgroundStep instance created.
2026-02-20 17:56:20,628 - stpipe.step - INFO - ImprintStep instance created.
2026-02-20 17:56:20,629 - stpipe.step - INFO - Extract2dStep instance created.
2026-02-20 17:56:20,632 - stpipe.step - INFO - MasterBackgroundMosStep instance created.
2026-02-20 17:56:20,633 - stpipe.step - INFO - FlatFieldStep instance created.
2026-02-20 17:56:20,634 - stpipe.step - INFO - PathLossStep instance created.
2026-02-20 17:56:20,635 - stpipe.step - INFO - BarShadowStep instance created.
2026-02-20 17:56:20,635 - stpipe.step - INFO - PhotomStep instance created.
2026-02-20 17:56:20,636 - stpipe.step - INFO - PixelReplaceStep instance created.
2026-02-20 17:56:20,637 - stpipe.step - INFO - ResampleSpecStep instance created.
2026-02-20 17:56:20,638 - stpipe.step - INFO - Extract1dStep instance created.
2026-02-20 17:56:20,639 - stpipe.step - INFO - WavecorrStep instance created.
2026-02-20 17:56:20,639 - stpipe.step - INFO - FlatFieldStep instance created.
2026-02-20 17:56:20,640 - stpipe.step - INFO - SourceTypeStep instance created.
2026-02-20 17:56:20,641 - stpipe.step - INFO - StraylightStep instance created.
2026-02-20 17:56:20,642 - stpipe.step - INFO - FringeStep instance created.
2026-02-20 17:56:20,643 - stpipe.step - INFO - ResidualFringeStep instance created.
2026-02-20 17:56:20,643 - stpipe.step - INFO - PathLossStep instance created.
2026-02-20 17:56:20,644 - stpipe.step - INFO - BarShadowStep instance created.
2026-02-20 17:56:20,645 - stpipe.step - INFO - WfssContamStep instance created.
2026-02-20 17:56:20,645 - stpipe.step - INFO - PhotomStep instance created.
2026-02-20 17:56:20,646 - stpipe.step - INFO - PixelReplaceStep instance created.
2026-02-20 17:56:20,647 - stpipe.step - INFO - ResampleSpecStep instance created.
2026-02-20 17:56:20,648 - stpipe.step - INFO - CubeBuildStep instance created.
2026-02-20 17:56:20,649 - stpipe.step - INFO - Extract1dStep instance created.
        Stage 2 Runtime so far: 62.7351 seconds
Stage 2 Processing file 2 of 2.
2026-02-20 17:56:21,788 - stpipe.step - INFO - Step Spec2Pipeline running with args ('/stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00002_nrs1_rate.fits',).
2026-02-20 17:56:21,815 - stpipe.step - INFO - Step Spec2Pipeline parameters are:
  pre_hooks: []
  post_hooks: []
  output_file: None
  output_dir: /stow/jruffio/data/JWST/tutorial/data/G395H_stage2
  output_ext: .fits
  output_use_model: False
  output_use_index: True
  save_results: True
  skip: False
  suffix: None
  search_output_file: True
  input_dir: ''
  save_bsub: False
  fail_on_exception: True
  save_wfss_esec: False
  steps:
    assign_wcs:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      sip_approx: True
      sip_max_pix_error: 0.01
      sip_degree: None
      sip_max_inv_pix_error: 0.01
      sip_inv_degree: None
      sip_npoints: 12
      slit_y_low: -0.55
      slit_y_high: 0.55
      nrs_ifu_slice_wcs: False
    badpix_selfcal:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      flagfrac_lower: 0.001
      flagfrac_upper: 0.001
      kernel_size: 15
      force_single: False
      save_flagged_bkg: False
    msa_flagging:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    nsclean:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      fit_method: fft
      fit_by_channel: False
      background_method: None
      background_box_size: None
      mask_spectral_regions: True
      n_sigma: 5.0
      fit_histogram: False
      single_mask: False
      user_mask: None
      save_mask: False
      save_background: False
      save_noise: False
    bkg_subtract:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      bkg_list: None
      save_combined_background: False
      sigma: 3.0
      maxiters: None
      soss_source_percentile: 35.0
      soss_bkg_percentile: None
      wfss_mmag_extract: None
      wfss_maxiter: 5
      wfss_rms_stop: 0.0
      wfss_outlier_percent: 1.0
    imprint_subtract:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    extract_2d:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      slit_names: None
      source_ids: None
      extract_orders: None
      grism_objects: None
      tsgrism_extract_height: None
      wfss_extract_half_height: 5
      wfss_mmag_extract: None
      wfss_nbright: 1000
    master_background_mos:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      sigma_clip: 3.0
      median_kernel: 1
      force_subtract: False
      save_background: False
      user_background: None
      inverse: False
      steps:
        flat_field:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          save_interpolated_flat: False
          user_supplied_flat: None
          inverse: False
        pathloss:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
          user_slit_loc: None
        barshadow:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
        photom:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
          apply_time_correction: True
        pixel_replace:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: True
          output_use_index: True
          save_results: False
          skip: True
          suffix: None
          search_output_file: True
          input_dir: ''
          algorithm: fit_profile
          n_adjacent_cols: 3
        resample_spec:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          pixfrac: 1.0
          kernel: square
          fillval: NaN
          weight_type: exptime
          output_shape: None
          pixel_scale_ratio: 1.0
          pixel_scale: None
          output_wcs: ''
          single: False
          blendheaders: True
          in_memory: True
        extract_1d:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          subtract_background: None
          apply_apcorr: True
          extraction_type: box
          use_source_posn: None
          position_offset: 0.0
          model_nod_pair: True
          optimize_psf_location: True
          smoothing_length: None
          bkg_fit: None
          bkg_order: None
          log_increment: 50
          save_profile: False
          save_scene_model: False
          save_residual_image: False
          center_xy: None
          ifu_autocen: False
          bkg_sigma_clip: 3.0
          ifu_rfcorr: True
          ifu_set_srctype: None
          ifu_rscale: None
          ifu_covar_scale: 1.0
          soss_atoca: True
          soss_threshold: 0.01
          soss_n_os: 2
          soss_wave_grid_in: None
          soss_wave_grid_out: None
          soss_estimate: None
          soss_rtol: 0.0001
          soss_max_grid_size: 20000
          soss_tikfac: None
          soss_width: 40.0
          soss_bad_pix: masking
          soss_modelname: None
          soss_order_3: True
    wavecorr:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    flat_field:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      save_interpolated_flat: False
      user_supplied_flat: None
      inverse: False
    srctype:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      source_type: None
    straylight:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      clean_showers: False
      shower_plane: 3
      shower_x_stddev: 18.0
      shower_y_stddev: 5.0
      shower_low_reject: 0.1
      shower_high_reject: 99.9
      save_shower_model: False
    fringe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    residual_fringe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: residual_fringe
      search_output_file: False
      input_dir: ''
      save_intermediate_results: False
      ignore_region_min: None
      ignore_region_max: None
    pathloss:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
      user_slit_loc: None
    barshadow:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
    wfss_contam:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      save_simulated_image: False
      save_contam_images: False
      maximum_cores: none
      orders: None
      magnitude_limit: None
      wl_oversample: 2
      max_pixels_per_chunk: 50000
    photom:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
      apply_time_correction: True
    pixel_replace:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      algorithm: fit_profile
      n_adjacent_cols: 3
    resample_spec:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      pixfrac: 1.0
      kernel: square
      fillval: NaN
      weight_type: exptime
      output_shape: None
      pixel_scale_ratio: 1.0
      pixel_scale: None
      output_wcs: ''
      single: False
      blendheaders: True
      in_memory: True
    cube_build:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: True
      suffix: s3d
      search_output_file: False
      input_dir: ''
      pipeline: 3
      channel: all
      band: all
      grating: all
      filter: all
      output_type: None
      scalexy: 0.0
      scalew: 0.0
      weighting: drizzle
      coord_system: skyalign
      ra_center: None
      dec_center: None
      cube_pa: None
      nspax_x: None
      nspax_y: None
      rois: 0.0
      roiw: 0.0
      weight_power: 2.0
      wavemin: None
      wavemax: None
      single: False
      skip_dqflagging: False
      offset_file: None
      debug_spaxel: -1 -1 -1
    extract_1d:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      subtract_background: None
      apply_apcorr: True
      extraction_type: box
      use_source_posn: None
      position_offset: 0.0
      model_nod_pair: True
      optimize_psf_location: True
      smoothing_length: None
      bkg_fit: None
      bkg_order: None
      log_increment: 50
      save_profile: False
      save_scene_model: False
      save_residual_image: False
      center_xy: None
      ifu_autocen: False
      bkg_sigma_clip: 3.0
      ifu_rfcorr: True
      ifu_set_srctype: None
      ifu_rscale: None
      ifu_covar_scale: 1.0
      soss_atoca: True
      soss_threshold: 0.01
      soss_n_os: 2
      soss_wave_grid_in: None
      soss_wave_grid_out: None
      soss_estimate: None
      soss_rtol: 0.0001
      soss_max_grid_size: 20000
      soss_tikfac: None
      soss_width: 40.0
      soss_bad_pix: masking
      soss_modelname: None
      soss_order_3: True
2026-02-20 17:56:21,843 - stpipe.pipeline - INFO - Prefetching reference files for dataset: 'jw01414013001_02101_00002_nrs1_rate.fits' reftypes = ['area', 'barshadow', 'bkg', 'camera', 'collimator', 'dflat', 'disperser', 'distortion', 'fflat', 'filteroffset', 'flat', 'fore', 'fpa', 'fringe', 'ifufore', 'ifupost', 'ifuslicer', 'mrsxartcorr', 'msa', 'msaoper', 'ote', 'pathloss', 'photom', 'regions', 'sflat', 'specwcs', 'wavecorr', 'wavelengthrange']
2026-02-20 17:56:21,846 - stpipe.pipeline - INFO - Prefetch for AREA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_area_0034.fits'.
2026-02-20 17:56:21,847 - stpipe.pipeline - INFO - Prefetch for BARSHADOW reference file is 'N/A'.
2026-02-20 17:56:21,848 - stpipe.pipeline - INFO - Prefetch for BKG reference file is 'N/A'.
2026-02-20 17:56:21,848 - stpipe.pipeline - INFO - Prefetch for CAMERA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_camera_0010.asdf'.
2026-02-20 17:56:21,849 - stpipe.pipeline - INFO - Prefetch for COLLIMATOR reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_collimator_0010.asdf'.
2026-02-20 17:56:21,849 - stpipe.pipeline - INFO - Prefetch for DFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dflat_0001.fits'.
2026-02-20 17:56:21,850 - stpipe.pipeline - INFO - Prefetch for DISPERSER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_disperser_0083.asdf'.
2026-02-20 17:56:21,850 - stpipe.pipeline - INFO - Prefetch for DISTORTION reference file is 'N/A'.
2026-02-20 17:56:21,851 - stpipe.pipeline - INFO - Prefetch for FFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fflat_0174.fits'.
2026-02-20 17:56:21,851 - stpipe.pipeline - INFO - Prefetch for FILTEROFFSET reference file is 'N/A'.
2026-02-20 17:56:21,852 - stpipe.pipeline - INFO - Prefetch for FLAT reference file is 'N/A'.
2026-02-20 17:56:21,852 - stpipe.pipeline - INFO - Prefetch for FORE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fore_0065.asdf'.
2026-02-20 17:56:21,853 - stpipe.pipeline - INFO - Prefetch for FPA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fpa_0011.asdf'.
2026-02-20 17:56:21,853 - stpipe.pipeline - INFO - Prefetch for FRINGE reference file is 'N/A'.
2026-02-20 17:56:21,854 - stpipe.pipeline - INFO - Prefetch for IFUFORE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifufore_0015.asdf'.
2026-02-20 17:56:21,854 - stpipe.pipeline - INFO - Prefetch for IFUPOST reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifupost_0016.asdf'.
2026-02-20 17:56:21,855 - stpipe.pipeline - INFO - Prefetch for IFUSLICER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifuslicer_0015.asdf'.
2026-02-20 17:56:21,855 - stpipe.pipeline - INFO - Prefetch for MRSXARTCORR reference file is 'N/A'.
2026-02-20 17:56:21,856 - stpipe.pipeline - INFO - Prefetch for MSA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msa_0011.asdf'.
2026-02-20 17:56:21,856 - stpipe.pipeline - INFO - Prefetch for MSAOPER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msaoper_0011.json'.
2026-02-20 17:56:21,857 - stpipe.pipeline - INFO - Prefetch for OTE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ote_0013.asdf'.
2026-02-20 17:56:21,857 - stpipe.pipeline - INFO - Prefetch for PATHLOSS reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pathloss_0003.fits'.
2026-02-20 17:56:21,858 - stpipe.pipeline - INFO - Prefetch for PHOTOM reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_photom_0016.fits'.
2026-02-20 17:56:21,858 - stpipe.pipeline - INFO - Prefetch for REGIONS reference file is 'N/A'.
2026-02-20 17:56:21,859 - stpipe.pipeline - INFO - Prefetch for SFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_sflat_0219.fits'.
2026-02-20 17:56:21,859 - stpipe.pipeline - INFO - Prefetch for SPECWCS reference file is 'N/A'.
2026-02-20 17:56:21,860 - stpipe.pipeline - INFO - Prefetch for WAVECORR reference file is 'N/A'.
2026-02-20 17:56:21,860 - stpipe.pipeline - INFO - Prefetch for WAVELENGTHRANGE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_wavelengthrange_0008.asdf'.
2026-02-20 17:56:21,861 - jwst.pipeline.calwebb_spec2 - INFO - Starting calwebb_spec2 ...
2026-02-20 17:56:21,861 - jwst.pipeline.calwebb_spec2 - INFO - Processing product /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00002_nrs1
2026-02-20 17:56:21,862 - jwst.pipeline.calwebb_spec2 - INFO - Working on input /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00002_nrs1_rate.fits ...
2026-02-20 17:56:22,054 - stpipe.step - INFO - Step assign_wcs running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:56:22,102 - jwst.assign_wcs.nirspec - INFO - gwa_ytilt is 0.144672647 deg
2026-02-20 17:56:22,103 - jwst.assign_wcs.nirspec - INFO - gwa_xtilt is 0.319160342 deg
2026-02-20 17:56:22,103 - jwst.assign_wcs.nirspec - INFO - theta_y correction: 0.0001127116201274071 deg
2026-02-20 17:56:22,104 - jwst.assign_wcs.nirspec - INFO - theta_x correction: 8.739014225467499e-05 deg
2026-02-20 17:56:22,168 - jwst.assign_wcs.nirspec - INFO - Applied Barycentric velocity correction : 0.9999124176092914
2026-02-20 17:56:23,522 - jwst.assign_wcs.nirspec - INFO - Created a NIRSPEC nrs_ifu pipeline with references {'distortion': None, 'filteroffset': None, 'specwcs': None, 'regions': None, 'wavelengthrange': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_wavelengthrange_0008.asdf', 'camera': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_camera_0010.asdf', 'collimator': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_collimator_0010.asdf', 'disperser': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_disperser_0083.asdf', 'fore': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fore_0065.asdf', 'fpa': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fpa_0011.asdf', 'msa': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msa_0011.asdf', 'ote': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ote_0013.asdf', 'ifupost': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifupost_0016.asdf', 'ifufore': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifufore_0015.asdf', 'ifuslicer': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifuslicer_0015.asdf'}
2026-02-20 17:56:28,166 - stcal.alignment.util - INFO - Update S_REGION to POLYGON ICRS  46.826532286 -13.764239869 46.827804187 -13.764239869 46.827804187 -13.762975478 46.826532286 -13.762975478
2026-02-20 17:56:31,551 - jwst.assign_wcs.assign_wcs - INFO - COMPLETED assign_wcs
2026-02-20 17:56:31,555 - stpipe.step - INFO - Step assign_wcs done
2026-02-20 17:56:31,836 - stpipe.step - INFO - Step badpix_selfcal running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>, [], []).
2026-02-20 17:56:31,837 - stpipe.step - INFO - Step skipped.
2026-02-20 17:56:32,097 - stpipe.step - INFO - Step msa_flagging running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:56:33,892 - jwst.msaflagopen.msaflagopen_step - INFO - Using reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msaoper_0011.json
2026-02-20 17:56:33,972 - jwst.msaflagopen.msaflag_open - INFO - 23 failed open shutters
2026-02-20 17:56:39,332 - stpipe.step - INFO - Step msa_flagging done
2026-02-20 17:56:40,036 - stpipe.step - INFO - Step nsclean running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:56:40,037 - jwst.nsclean.nsclean_step - WARNING - The 'nsclean' step is a deprecated alias to 'clean_flicker_noise' and will be removed in future builds.
2026-02-20 17:56:40,044 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Input exposure type is NRS_IFU, detector=NRS1
2026-02-20 17:56:42,361 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Flagging failed-open MSA shutters for scene masking
2026-02-20 17:56:42,362 - stpipe.step - INFO - MSAFlagOpenStep instance created.
2026-02-20 17:56:50,964 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Creating mask
2026-02-20 17:56:50,965 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Finding slice pixels for an IFU image
2026-02-20 17:56:52,233 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Masking the fixed slit region for IFU data.
2026-02-20 17:56:52,396 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Cleaning image jw01414013001_02101_00002_nrs1_rate.fits
2026-02-20 17:56:53,558 - stpipe.step - INFO - Step nsclean done
2026-02-20 17:56:54,470 - stpipe.step - INFO - Step imprint_subtract running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>, []).
2026-02-20 17:56:54,472 - stpipe.step - INFO - Step skipped.
2026-02-20 17:56:54,833 - stpipe.step - INFO - Step bkg_subtract running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>, []).
2026-02-20 17:56:54,834 - stpipe.step - INFO - Step skipped.
2026-02-20 17:56:55,193 - stpipe.step - INFO - Step srctype running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:56:57,803 - jwst.srctype.srctype - INFO - Input EXP_TYPE is NRS_IFU
2026-02-20 17:56:57,803 - jwst.srctype.srctype - INFO - Input SRCTYAPT = POINT
2026-02-20 17:56:57,804 - jwst.srctype.srctype - INFO - Using input source type = POINT
2026-02-20 17:56:57,806 - stpipe.step - INFO - Step srctype done
2026-02-20 17:56:58,265 - stpipe.step - INFO - Step straylight running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:56:58,266 - stpipe.step - INFO - Step skipped.
2026-02-20 17:56:58,716 - stpipe.step - INFO - Step flat_field running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:56:58,730 - jwst.flatfield.flat_field_step - INFO - No reference found for type FLAT
2026-02-20 17:56:58,752 - jwst.flatfield.flat_field_step - INFO - Using FFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fflat_0174.fits
2026-02-20 17:56:58,812 - jwst.flatfield.flat_field_step - INFO - Using SFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_sflat_0219.fits
2026-02-20 17:56:58,954 - jwst.flatfield.flat_field_step - INFO - Using DFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dflat_0001.fits
2026-02-20 17:57:04,990 - stpipe.step - INFO - Step flat_field done
2026-02-20 17:57:05,604 - stpipe.step - INFO - Step fringe running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:57:05,606 - stpipe.step - INFO - Step skipped.
2026-02-20 17:57:06,058 - stpipe.step - INFO - Step pathloss running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:57:06,067 - jwst.pathloss.pathloss_step - INFO - Using PATHLOSS reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pathloss_0003.fits
2026-02-20 17:57:06,081 - jwst.pathloss.pathloss - INFO - Input exposure type is NRS_IFU
2026-02-20 17:57:09,189 - stpipe.step - INFO - Step pathloss done
2026-02-20 17:57:09,814 - stpipe.step - INFO - Step barshadow running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:57:09,815 - stpipe.step - INFO - Step skipped.
2026-02-20 17:57:10,281 - stpipe.step - INFO - Step photom running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:57:10,292 - jwst.photom.photom_step - INFO - Using photom reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_photom_0016.fits
2026-02-20 17:57:10,293 - jwst.photom.photom_step - INFO - Using area reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_area_0034.fits
2026-02-20 17:57:11,896 - jwst.photom.photom - INFO - Using instrument: NIRSPEC
2026-02-20 17:57:11,896 - jwst.photom.photom - INFO -  detector: NRS1
2026-02-20 17:57:11,897 - jwst.photom.photom - INFO -  exp_type: NRS_IFU
2026-02-20 17:57:11,897 - jwst.photom.photom - INFO -  filter: F290LP
2026-02-20 17:57:11,898 - jwst.photom.photom - INFO -  grating: G395H
2026-02-20 17:57:11,923 - jwst.photom.photom - INFO - PHOTMJSR value: 3.83378e+12
2026-02-20 17:57:13,315 - stpipe.step - INFO - Step photom done
2026-02-20 17:57:13,961 - stpipe.step - INFO - Step residual_fringe running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 17:57:13,962 - stpipe.step - INFO - Step skipped.
2026-02-20 17:57:16,745 - stpipe.step - INFO - Step pixel_replace running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits>,).
2026-02-20 17:57:16,746 - stpipe.step - INFO - Step skipped.
2026-02-20 17:57:17,228 - stpipe.step - INFO - Step cube_build running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits>,).
2026-02-20 17:57:17,230 - stpipe.step - INFO - Step skipped.
2026-02-20 17:57:19,931 - stpipe.step - INFO - Step extract_1d running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits>,).
2026-02-20 17:57:19,932 - stpipe.step - INFO - Step skipped.
2026-02-20 17:57:19,933 - jwst.pipeline.calwebb_spec2 - INFO - Finished processing product /stow/jruffio/data/JWST/tutorial/data/G395H_stage1/jw01414013001_02101_00002_nrs1
2026-02-20 17:57:19,934 - jwst.pipeline.calwebb_spec2 - INFO - Ending calwebb_spec2
2026-02-20 17:57:19,935 - jwst.stpipe.core - INFO - Results used CRDS context: jwst_1464.pmap
2026-02-20 17:57:21,318 - stpipe.step - INFO - Saved model in /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits
2026-02-20 17:57:21,318 - stpipe.step - INFO - Step Spec2Pipeline done
2026-02-20 17:57:21,319 - jwst.stpipe.core - INFO - Results used jwst version: 1.20.2
        Stage 2 Runtime so far: 123.5153 seconds
Stage 2 Total Runtime: 123.5154 seconds
Plots saved to /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/plots_stage2_jw01414013001_nrs1.pdf
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits
N files: 2
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Running compute_med_filt_badpix with parameters:
         save_utils: True
         window_size: 50
         mad_threshold: 50
Initializing row_err and bad_pixels for nirspec
/home/jruffio/anaconda3/envs/breads_2026/lib/python3.12/site-packages/scipy/ndimage/_filters.py:2420: RuntimeWarning: All-NaN slice encountered
  _nd_image.generic_filter(input, function, footprint, output, mode,
/home/jruffio/code/breads/breads/instruments/jwstnirspec_cal.py:198: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  row_err_masking = row_err/median_abs_deviation(row_err[np.where(np.isfinite(self.bad_pixels[rowid,:]))])
/home/jruffio/code/breads/breads/instruments/jwstnirspec_cal.py:198: RuntimeWarning: invalid value encountered in divide
  row_err_masking = row_err/median_abs_deviation(row_err[np.where(np.isfinite(self.bad_pixels[rowid,:]))])
  Saved the quick bad pixel map to /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00001_nrs1_cal_roughbadpix.fits
Running compute_coordinates_arrays with parameters:
         save_utils: True
         targname: HD 19467
Computing coordinates arrays.
Computing coords for 30 slices...
100%|███████████████████████████████████████████████████████████████| 30/30 [00:01<00:00, 21.86it/s]
Retrieving SIMBAD coordinates for HD 19467
Coordinates at J2000:  03h07m18.57505144s -13d45m42.41798215s
Coordinates at 2024-01-25:  03h07m18.56069141s -13d45m48.69016027s
  Saved the computed coordinates arrays to /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00001_nrs1_cal_relcoords.fits
Running convert_MJy_per_sr_to_MJy with parameters:
         save_utils: True
Running compute_starspectrum_contnorm with parameters:
         save_utils: True
         N_nodes: 40
         threshold_badpix: 100
         mppool: <multiprocess.pool.Pool state=RUN pool_size=16>
Computing stellar spectrum (continuum normalized)
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
Saved the continuum normalized star spectrum to /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00001_nrs1_cal_starspec_contnorm.fits
Running compute_starsubtraction with parameters:
         save_utils: True
         starsub_dir: starsub1d_tmp
         threshold_badpix: 10
         mppool: <multiprocess.pool.Pool state=RUN pool_size=16>
Computing star subtraction.
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:1411: RuntimeWarning: All-NaN slice encountered
  reg_mean_map[wherenan] = np.tile(np.nanmedian(spline_paras0, axis=1)[:, None], (1, spline_paras0.shape[1]))[wherenan]
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:1413: RuntimeWarning: All-NaN slice encountered
  reg_std_map[wherenan] = np.tile(np.nanmax(np.abs(spline_paras0), axis=1)[:, None], (1, spline_paras0.shape[1]))[wherenan]
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
Running compute_interpdata_regwvs with parameters:
         save_utils: True
         wv_sampling: [2.85950398 2.87102127 2.88253856 2.89405584 2.90557313 2.91709042
 2.9286077  2.94012499 2.95164227 2.96315956 2.97467685 2.98619413
 2.99771142 3.00922871 3.02074599 3.03226328 3.04378057 3.05529785
 3.06681514 3.07833242 3.08984971 3.101367   3.11288428 3.12440157
 3.13591886 3.14743614 3.15895343 3.17047071 3.181988   3.19350529
 3.20502257 3.21653986 3.22805715 3.23957443 3.25109172 3.262609
 3.27412629 3.28564358 3.29716086 3.30867815 3.32019544 3.33171272
 3.34323001 3.3547473  3.36626458 3.37778187 3.38929915 3.40081644
 3.41233373 3.42385101 3.4353683  3.44688559 3.45840287 3.46992016
 3.48143744 3.49295473 3.50447202 3.5159893  3.52750659 3.53902388
 3.55054116 3.56205845 3.57357574 3.58509302 3.59661031 3.60812759
 3.61964488 3.63116217 3.64267945 3.65419674 3.66571403 3.67723131
 3.6887486  3.70026588 3.71178317 3.72330046 3.73481774 3.74633503
 3.75785232 3.7693696  3.78088689 3.79240417 3.80392146 3.81543875
 3.82695603 3.83847332 3.84999061 3.86150789 3.87302518 3.88454247
 3.89605975 3.90757704 3.91909432 3.93061161 3.9421289  3.95364618
 3.96516347 3.97668076 3.98819804 3.99971533 4.01123261 4.0227499
 4.03426719 4.04578447 4.05730176 4.06881905 4.08033633 4.09185362]
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Running compute_med_filt_badpix with parameters:
         save_utils: True
         window_size: 50
         mad_threshold: 50
Initializing row_err and bad_pixels for nirspec
/home/jruffio/anaconda3/envs/breads_2026/lib/python3.12/site-packages/scipy/ndimage/_filters.py:2420: RuntimeWarning: All-NaN slice encountered
  _nd_image.generic_filter(input, function, footprint, output, mode,
/home/jruffio/code/breads/breads/instruments/jwstnirspec_cal.py:198: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  row_err_masking = row_err/median_abs_deviation(row_err[np.where(np.isfinite(self.bad_pixels[rowid,:]))])
/home/jruffio/code/breads/breads/instruments/jwstnirspec_cal.py:198: RuntimeWarning: invalid value encountered in divide
  row_err_masking = row_err/median_abs_deviation(row_err[np.where(np.isfinite(self.bad_pixels[rowid,:]))])
  Saved the quick bad pixel map to /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00002_nrs1_cal_roughbadpix.fits
Running compute_coordinates_arrays with parameters:
         save_utils: True
         targname: HD 19467
Computing coordinates arrays.
Computing coords for 30 slices...
100%|███████████████████████████████████████████████████████████████| 30/30 [00:01<00:00, 22.19it/s]
Retrieving SIMBAD coordinates for HD 19467
Coordinates at J2000:  03h07m18.57505144s -13d45m42.41798215s
Coordinates at 2024-01-25:  03h07m18.56069141s -13d45m48.69016027s
  Saved the computed coordinates arrays to /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00002_nrs1_cal_relcoords.fits
Running convert_MJy_per_sr_to_MJy with parameters:
         save_utils: True
Running compute_starspectrum_contnorm with parameters:
         save_utils: True
         N_nodes: 40
         threshold_badpix: 100
         mppool: <multiprocess.pool.Pool state=RUN pool_size=16>
Computing stellar spectrum (continuum normalized)
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: divide by zero encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
Saved the continuum normalized star spectrum to /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00002_nrs1_cal_starspec_contnorm.fits
Running compute_starsubtraction with parameters:
         save_utils: True
         starsub_dir: starsub1d_tmp
         threshold_badpix: 10
         mppool: <multiprocess.pool.Pool state=RUN pool_size=16>
Computing star subtraction.
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:1411: RuntimeWarning: All-NaN slice encountered
  reg_mean_map[wherenan] = np.tile(np.nanmedian(spline_paras0, axis=1)[:, None], (1, spline_paras0.shape[1]))[wherenan]
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:1413: RuntimeWarning: All-NaN slice encountered
  reg_std_map[wherenan] = np.tile(np.nanmax(np.abs(spline_paras0), axis=1)[:, None], (1, spline_paras0.shape[1]))[wherenan]
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
Running compute_interpdata_regwvs with parameters:
         save_utils: True
         wv_sampling: [2.85950398 2.87102127 2.88253856 2.89405584 2.90557313 2.91709042
 2.9286077  2.94012499 2.95164227 2.96315956 2.97467685 2.98619413
 2.99771142 3.00922871 3.02074599 3.03226328 3.04378057 3.05529785
 3.06681514 3.07833242 3.08984971 3.101367   3.11288428 3.12440157
 3.13591886 3.14743614 3.15895343 3.17047071 3.181988   3.19350529
 3.20502257 3.21653986 3.22805715 3.23957443 3.25109172 3.262609
 3.27412629 3.28564358 3.29716086 3.30867815 3.32019544 3.33171272
 3.34323001 3.3547473  3.36626458 3.37778187 3.38929915 3.40081644
 3.41233373 3.42385101 3.4353683  3.44688559 3.45840287 3.46992016
 3.48143744 3.49295473 3.50447202 3.5159893  3.52750659 3.53902388
 3.55054116 3.56205845 3.57357574 3.58509302 3.59661031 3.60812759
 3.61964488 3.63116217 3.64267945 3.65419674 3.66571403 3.67723131
 3.6887486  3.70026588 3.71178317 3.72330046 3.73481774 3.74633503
 3.75785232 3.7693696  3.78088689 3.79240417 3.80392146 3.81543875
 3.82695603 3.83847332 3.84999061 3.86150789 3.87302518 3.88454247
 3.89605975 3.90757704 3.91909432 3.93061161 3.9421289  3.95364618
 3.96516347 3.97668076 3.98819804 3.99971533 4.01123261 4.0227499
 4.03426719 4.04578447 4.05730176 4.06881905 4.08033633 4.09185362]
Computing PSFs. This has to iterate over many wavelengths, so is slow.
iterating query, tdelta=3.0

MAST OPD query around UTC: 2024-01-25T17:47:35.716
                        MJD: 60334.741385601854

OPD immediately preceding the given datetime:
        URI:     mast:JWST/product/R2024012502-NRCA3_FP1-1.fits
        Date (MJD):      60334.2955
        Delta time:      -0.4459 days

OPD immediately following the given datetime:
        URI:     mast:JWST/product/R2024012702-NRCA3_FP1-1.fits
        Date (MJD):      60336.5976
        Delta time:      1.8562 days
User requested choosing OPD time closest in time to 2024-01-25T17:47:35.716, which is R2024012502-NRCA3_FP1-1.fits, delta time -0.446 days
Importing and format-converting OPD from /fast/jruffio/data/stpsf-data/MAST_JWST_WSS_OPDs/R2024012502-NRCA3_FP1-1.fits
Backing out SI WFE and OTE field dependence at the WF sensing field point (NRCA3_FP1)
Sensing inst model using apername NRCA3_FP1
Using sensing field point SI WFE model from file wss_target_phase_fp1.fits
        Performing serial calculation of PSF at 108 wavelengths.
100%|█████████████████████████████████████████████████████████████| 108/108 [01:15<00:00,  1.43it/s]
WARNING: VerifyWarning: Card is too long, comment will be truncated. [astropy.io.fits.card]
  Saved the computed PSFs to /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_nrs1_webbpsf.fits
Make sure interpdata_regwvs was already done
fitpsf wavelength indices: 0 108
        Performing parallelized PSF fit at 108 wavelengths.
100%|█████████████████████████████████████████████████████████████| 108/108 [00:37<00:00,  2.87it/s]
100%|██████████████████████████████████████████████████████████| 108/108 [00:00<00:00, 31113.73it/s]
2.9827389478683473 3.968618655204773
RA correction nrs1 [-0.00138935 -0.00269562 -0.05754739]
Dec correction nrs1 [-0.00432524 -0.010629   -0.17953026]
(1, 108, 5)
Saving /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/20260220_180128_centroid_calibration.png
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits
N files: 2
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Loading data for compute_med_filt_badpix cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00001_nrs1_cal_roughbadpix.fits
Loading data for compute_coordinates_arrays cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00001_nrs1_cal_relcoords.fits
Running convert_MJy_per_sr_to_MJy with parameters:
         save_utils: True
Loading data for compute_starspectrum_contnorm cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00001_nrs1_cal_starspec_contnorm.fits
Loading data for compute_starsubtraction cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00001_nrs1_cal_starsub.fits
Loading data for compute_interpdata_regwvs cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00001_nrs1_cal_regwvs.fits
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Loading data for compute_med_filt_badpix cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00002_nrs1_cal_roughbadpix.fits
Loading data for compute_coordinates_arrays cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00002_nrs1_cal_relcoords.fits
Running convert_MJy_per_sr_to_MJy with parameters:
         save_utils: True
Loading data for compute_starspectrum_contnorm cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00002_nrs1_cal_starspec_contnorm.fits
Loading data for compute_starsubtraction cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00002_nrs1_cal_starsub.fits
Loading data for compute_interpdata_regwvs cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/jw01414013001_02101_00002_nrs1_cal_regwvs.fits
Make sure interpdata_regwvs was already done
fitpsf wavelength indices: 0 108
        Performing parallelized PSF fit at 108 wavelengths.
100%|█████████████████████████████████████████████████████████████| 108/108 [00:37<00:00,  2.89it/s]
100%|██████████████████████████████████████████████████████████| 108/108 [00:00<00:00, 35177.82it/s]
2.9827389478683473 3.968618655204773
RA correction nrs1 [-0.00058284 -0.0022742  -0.0584407 ]
Dec correction nrs1 [ 0.00050445 -0.01076225 -0.18053904]
(1, 108, 5)
Saving /stow/jruffio/data/JWST/tutorial/data/G395H_utils_before_cleaning/20260220_180212_centroid_calibration.png
Noise Clean: Processing file 1 of 2: jw01414013001_02101_00001_nrs1_rate.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Applying relative coordinate offset (array([-0.00058284, -0.0022742 , -0.0584407 ]), array([ 0.00050445, -0.01076225, -0.18053904]))
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits
['/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00001_nrs1_cal.fits']
        Unpacking data quality bitmasks. DQ array is of type uint32
/home/jruffio/anaconda3/envs/breads_2026/lib/python3.12/site-packages/scipy/ndimage/_filters.py:2420: RuntimeWarning: All-NaN slice encountered
  _nd_image.generic_filter(input, function, footprint, output, mode,
/home/jruffio/code/breads/breads/jwst_tools/reduction_utils.py:788: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  row_data_masking = row_data / median_abs_deviation(row_data[np.where(np.isfinite(bad_pixels[rowid, :]))])
        Noise Clean Runtime so far: 50.7002 seconds

Noise Clean: Processing file 2 of 2: jw01414013001_02101_00002_nrs1_rate.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Applying relative coordinate offset (array([-0.00058284, -0.0022742 , -0.0584407 ]), array([ 0.00050445, -0.01076225, -0.18053904]))
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits
['/stow/jruffio/data/JWST/tutorial/data/G395H_stage2/jw01414013001_02101_00002_nrs1_cal.fits']
        Unpacking data quality bitmasks. DQ array is of type uint32
        Noise Clean Runtime so far: 101.0560 seconds

Noise Clean Total Runtime: 101.0561 seconds
2026-02-20 18:03:57,070 - stpipe.step - INFO - PARS-RESAMPLESPECSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-resamplespecstep_0001.asdf
2026-02-20 18:03:57,084 - stpipe.step - INFO - PARS-RESAMPLESPECSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-resamplespecstep_0001.asdf
2026-02-20 18:03:57,103 - stpipe.step - INFO - Spec2Pipeline instance created.
2026-02-20 18:03:57,104 - stpipe.step - INFO - AssignWcsStep instance created.
2026-02-20 18:03:57,104 - stpipe.step - INFO - BadpixSelfcalStep instance created.
2026-02-20 18:03:57,105 - stpipe.step - INFO - MSAFlagOpenStep instance created.
2026-02-20 18:03:57,106 - stpipe.step - INFO - NSCleanStep instance created.
2026-02-20 18:03:57,106 - stpipe.step - INFO - BackgroundStep instance created.
2026-02-20 18:03:57,107 - stpipe.step - INFO - ImprintStep instance created.
2026-02-20 18:03:57,108 - stpipe.step - INFO - Extract2dStep instance created.
2026-02-20 18:03:57,113 - stpipe.step - INFO - MasterBackgroundMosStep instance created.
2026-02-20 18:03:57,113 - stpipe.step - INFO - FlatFieldStep instance created.
2026-02-20 18:03:57,114 - stpipe.step - INFO - PathLossStep instance created.
2026-02-20 18:03:57,115 - stpipe.step - INFO - BarShadowStep instance created.
2026-02-20 18:03:57,115 - stpipe.step - INFO - PhotomStep instance created.
2026-02-20 18:03:57,116 - stpipe.step - INFO - PixelReplaceStep instance created.
2026-02-20 18:03:57,117 - stpipe.step - INFO - ResampleSpecStep instance created.
2026-02-20 18:03:57,119 - stpipe.step - INFO - Extract1dStep instance created.
2026-02-20 18:03:57,120 - stpipe.step - INFO - WavecorrStep instance created.
2026-02-20 18:03:57,121 - stpipe.step - INFO - FlatFieldStep instance created.
2026-02-20 18:03:57,121 - stpipe.step - INFO - SourceTypeStep instance created.
2026-02-20 18:03:57,122 - stpipe.step - INFO - StraylightStep instance created.
2026-02-20 18:03:57,124 - stpipe.step - INFO - FringeStep instance created.
2026-02-20 18:03:57,125 - stpipe.step - INFO - ResidualFringeStep instance created.
2026-02-20 18:03:57,125 - stpipe.step - INFO - PathLossStep instance created.
2026-02-20 18:03:57,126 - stpipe.step - INFO - BarShadowStep instance created.
2026-02-20 18:03:57,127 - stpipe.step - INFO - WfssContamStep instance created.
2026-02-20 18:03:57,127 - stpipe.step - INFO - PhotomStep instance created.
2026-02-20 18:03:57,128 - stpipe.step - INFO - PixelReplaceStep instance created.
2026-02-20 18:03:57,129 - stpipe.step - INFO - ResampleSpecStep instance created.
2026-02-20 18:03:57,130 - stpipe.step - INFO - CubeBuildStep instance created.
2026-02-20 18:03:57,131 - stpipe.step - INFO - Extract1dStep instance created.
Plots saved to /stow/jruffio/data/JWST/tutorial/data/G395H_stage1_cleaned/plots_noiseclean_jw01414013001_nrs1.pdf
Stage 2 Processing file 1 of 2.
2026-02-20 18:03:57,339 - stpipe.step - INFO - Step Spec2Pipeline running with args ('/stow/jruffio/data/JWST/tutorial/data/G395H_stage1_cleaned/jw01414013001_02101_00001_nrs1_rate.fits',).
2026-02-20 18:03:57,367 - stpipe.step - INFO - Step Spec2Pipeline parameters are:
  pre_hooks: []
  post_hooks: []
  output_file: None
  output_dir: /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned
  output_ext: .fits
  output_use_model: False
  output_use_index: True
  save_results: True
  skip: False
  suffix: None
  search_output_file: True
  input_dir: ''
  save_bsub: False
  fail_on_exception: True
  save_wfss_esec: False
  steps:
    assign_wcs:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      sip_approx: True
      sip_max_pix_error: 0.01
      sip_degree: None
      sip_max_inv_pix_error: 0.01
      sip_inv_degree: None
      sip_npoints: 12
      slit_y_low: -0.55
      slit_y_high: 0.55
      nrs_ifu_slice_wcs: False
    badpix_selfcal:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      flagfrac_lower: 0.001
      flagfrac_upper: 0.001
      kernel_size: 15
      force_single: False
      save_flagged_bkg: False
    msa_flagging:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    nsclean:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      fit_method: fft
      fit_by_channel: False
      background_method: None
      background_box_size: None
      mask_spectral_regions: True
      n_sigma: 5.0
      fit_histogram: False
      single_mask: False
      user_mask: None
      save_mask: False
      save_background: False
      save_noise: False
    bkg_subtract:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      bkg_list: None
      save_combined_background: False
      sigma: 3.0
      maxiters: None
      soss_source_percentile: 35.0
      soss_bkg_percentile: None
      wfss_mmag_extract: None
      wfss_maxiter: 5
      wfss_rms_stop: 0.0
      wfss_outlier_percent: 1.0
    imprint_subtract:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    extract_2d:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      slit_names: None
      source_ids: None
      extract_orders: None
      grism_objects: None
      tsgrism_extract_height: None
      wfss_extract_half_height: 5
      wfss_mmag_extract: None
      wfss_nbright: 1000
    master_background_mos:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      sigma_clip: 3.0
      median_kernel: 1
      force_subtract: False
      save_background: False
      user_background: None
      inverse: False
      steps:
        flat_field:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          save_interpolated_flat: False
          user_supplied_flat: None
          inverse: False
        pathloss:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
          user_slit_loc: None
        barshadow:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
        photom:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
          apply_time_correction: True
        pixel_replace:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: True
          output_use_index: True
          save_results: False
          skip: True
          suffix: None
          search_output_file: True
          input_dir: ''
          algorithm: fit_profile
          n_adjacent_cols: 3
        resample_spec:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          pixfrac: 1.0
          kernel: square
          fillval: NaN
          weight_type: exptime
          output_shape: None
          pixel_scale_ratio: 1.0
          pixel_scale: None
          output_wcs: ''
          single: False
          blendheaders: True
          in_memory: True
        extract_1d:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          subtract_background: None
          apply_apcorr: True
          extraction_type: box
          use_source_posn: None
          position_offset: 0.0
          model_nod_pair: True
          optimize_psf_location: True
          smoothing_length: None
          bkg_fit: None
          bkg_order: None
          log_increment: 50
          save_profile: False
          save_scene_model: False
          save_residual_image: False
          center_xy: None
          ifu_autocen: False
          bkg_sigma_clip: 3.0
          ifu_rfcorr: True
          ifu_set_srctype: None
          ifu_rscale: None
          ifu_covar_scale: 1.0
          soss_atoca: True
          soss_threshold: 0.01
          soss_n_os: 2
          soss_wave_grid_in: None
          soss_wave_grid_out: None
          soss_estimate: None
          soss_rtol: 0.0001
          soss_max_grid_size: 20000
          soss_tikfac: None
          soss_width: 40.0
          soss_bad_pix: masking
          soss_modelname: None
          soss_order_3: True
    wavecorr:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    flat_field:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      save_interpolated_flat: False
      user_supplied_flat: None
      inverse: False
    srctype:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      source_type: None
    straylight:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      clean_showers: False
      shower_plane: 3
      shower_x_stddev: 18.0
      shower_y_stddev: 5.0
      shower_low_reject: 0.1
      shower_high_reject: 99.9
      save_shower_model: False
    fringe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    residual_fringe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: residual_fringe
      search_output_file: False
      input_dir: ''
      save_intermediate_results: False
      ignore_region_min: None
      ignore_region_max: None
    pathloss:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
      user_slit_loc: None
    barshadow:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
    wfss_contam:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      save_simulated_image: False
      save_contam_images: False
      maximum_cores: none
      orders: None
      magnitude_limit: None
      wl_oversample: 2
      max_pixels_per_chunk: 50000
    photom:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
      apply_time_correction: True
    pixel_replace:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      algorithm: fit_profile
      n_adjacent_cols: 3
    resample_spec:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      pixfrac: 1.0
      kernel: square
      fillval: NaN
      weight_type: exptime
      output_shape: None
      pixel_scale_ratio: 1.0
      pixel_scale: None
      output_wcs: ''
      single: False
      blendheaders: True
      in_memory: True
    cube_build:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: True
      suffix: s3d
      search_output_file: False
      input_dir: ''
      pipeline: 3
      channel: all
      band: all
      grating: all
      filter: all
      output_type: None
      scalexy: 0.0
      scalew: 0.0
      weighting: drizzle
      coord_system: skyalign
      ra_center: None
      dec_center: None
      cube_pa: None
      nspax_x: None
      nspax_y: None
      rois: 0.0
      roiw: 0.0
      weight_power: 2.0
      wavemin: None
      wavemax: None
      single: False
      skip_dqflagging: False
      offset_file: None
      debug_spaxel: -1 -1 -1
    extract_1d:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      subtract_background: None
      apply_apcorr: True
      extraction_type: box
      use_source_posn: None
      position_offset: 0.0
      model_nod_pair: True
      optimize_psf_location: True
      smoothing_length: None
      bkg_fit: None
      bkg_order: None
      log_increment: 50
      save_profile: False
      save_scene_model: False
      save_residual_image: False
      center_xy: None
      ifu_autocen: False
      bkg_sigma_clip: 3.0
      ifu_rfcorr: True
      ifu_set_srctype: None
      ifu_rscale: None
      ifu_covar_scale: 1.0
      soss_atoca: True
      soss_threshold: 0.01
      soss_n_os: 2
      soss_wave_grid_in: None
      soss_wave_grid_out: None
      soss_estimate: None
      soss_rtol: 0.0001
      soss_max_grid_size: 20000
      soss_tikfac: None
      soss_width: 40.0
      soss_bad_pix: masking
      soss_modelname: None
      soss_order_3: True
2026-02-20 18:03:57,395 - stpipe.pipeline - INFO - Prefetching reference files for dataset: 'jw01414013001_02101_00001_nrs1_rate.fits' reftypes = ['area', 'barshadow', 'bkg', 'camera', 'collimator', 'dflat', 'disperser', 'distortion', 'fflat', 'filteroffset', 'flat', 'fore', 'fpa', 'fringe', 'ifufore', 'ifupost', 'ifuslicer', 'mrsxartcorr', 'msa', 'msaoper', 'ote', 'pathloss', 'photom', 'regions', 'sflat', 'specwcs', 'wavecorr', 'wavelengthrange']
2026-02-20 18:03:57,399 - stpipe.pipeline - INFO - Prefetch for AREA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_area_0034.fits'.
2026-02-20 18:03:57,399 - stpipe.pipeline - INFO - Prefetch for BARSHADOW reference file is 'N/A'.
2026-02-20 18:03:57,400 - stpipe.pipeline - INFO - Prefetch for BKG reference file is 'N/A'.
2026-02-20 18:03:57,400 - stpipe.pipeline - INFO - Prefetch for CAMERA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_camera_0010.asdf'.
2026-02-20 18:03:57,400 - stpipe.pipeline - INFO - Prefetch for COLLIMATOR reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_collimator_0010.asdf'.
2026-02-20 18:03:57,401 - stpipe.pipeline - INFO - Prefetch for DFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dflat_0001.fits'.
2026-02-20 18:03:57,401 - stpipe.pipeline - INFO - Prefetch for DISPERSER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_disperser_0083.asdf'.
2026-02-20 18:03:57,402 - stpipe.pipeline - INFO - Prefetch for DISTORTION reference file is 'N/A'.
2026-02-20 18:03:57,402 - stpipe.pipeline - INFO - Prefetch for FFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fflat_0174.fits'.
2026-02-20 18:03:57,402 - stpipe.pipeline - INFO - Prefetch for FILTEROFFSET reference file is 'N/A'.
2026-02-20 18:03:57,403 - stpipe.pipeline - INFO - Prefetch for FLAT reference file is 'N/A'.
2026-02-20 18:03:57,403 - stpipe.pipeline - INFO - Prefetch for FORE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fore_0065.asdf'.
2026-02-20 18:03:57,404 - stpipe.pipeline - INFO - Prefetch for FPA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fpa_0011.asdf'.
2026-02-20 18:03:57,404 - stpipe.pipeline - INFO - Prefetch for FRINGE reference file is 'N/A'.
2026-02-20 18:03:57,405 - stpipe.pipeline - INFO - Prefetch for IFUFORE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifufore_0015.asdf'.
2026-02-20 18:03:57,405 - stpipe.pipeline - INFO - Prefetch for IFUPOST reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifupost_0016.asdf'.
2026-02-20 18:03:57,406 - stpipe.pipeline - INFO - Prefetch for IFUSLICER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifuslicer_0015.asdf'.
2026-02-20 18:03:57,406 - stpipe.pipeline - INFO - Prefetch for MRSXARTCORR reference file is 'N/A'.
2026-02-20 18:03:57,407 - stpipe.pipeline - INFO - Prefetch for MSA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msa_0011.asdf'.
2026-02-20 18:03:57,407 - stpipe.pipeline - INFO - Prefetch for MSAOPER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msaoper_0011.json'.
2026-02-20 18:03:57,408 - stpipe.pipeline - INFO - Prefetch for OTE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ote_0013.asdf'.
2026-02-20 18:03:57,408 - stpipe.pipeline - INFO - Prefetch for PATHLOSS reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pathloss_0003.fits'.
2026-02-20 18:03:57,409 - stpipe.pipeline - INFO - Prefetch for PHOTOM reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_photom_0016.fits'.
2026-02-20 18:03:57,409 - stpipe.pipeline - INFO - Prefetch for REGIONS reference file is 'N/A'.
2026-02-20 18:03:57,410 - stpipe.pipeline - INFO - Prefetch for SFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_sflat_0219.fits'.
2026-02-20 18:03:57,410 - stpipe.pipeline - INFO - Prefetch for SPECWCS reference file is 'N/A'.
2026-02-20 18:03:57,410 - stpipe.pipeline - INFO - Prefetch for WAVECORR reference file is 'N/A'.
2026-02-20 18:03:57,411 - stpipe.pipeline - INFO - Prefetch for WAVELENGTHRANGE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_wavelengthrange_0008.asdf'.
2026-02-20 18:03:57,411 - jwst.pipeline.calwebb_spec2 - INFO - Starting calwebb_spec2 ...
2026-02-20 18:03:57,412 - jwst.pipeline.calwebb_spec2 - INFO - Processing product /stow/jruffio/data/JWST/tutorial/data/G395H_stage1_cleaned/jw01414013001_02101_00001_nrs1
2026-02-20 18:03:57,412 - jwst.pipeline.calwebb_spec2 - INFO - Working on input /stow/jruffio/data/JWST/tutorial/data/G395H_stage1_cleaned/jw01414013001_02101_00001_nrs1_rate.fits ...
2026-02-20 18:03:57,690 - stpipe.step - INFO - Step assign_wcs running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:03:57,738 - jwst.assign_wcs.nirspec - INFO - gwa_ytilt is 0.144672647 deg
2026-02-20 18:03:57,738 - jwst.assign_wcs.nirspec - INFO - gwa_xtilt is 0.319160342 deg
2026-02-20 18:03:57,739 - jwst.assign_wcs.nirspec - INFO - theta_y correction: 0.0001127116201274071 deg
2026-02-20 18:03:57,740 - jwst.assign_wcs.nirspec - INFO - theta_x correction: 8.739014225467499e-05 deg
2026-02-20 18:03:57,804 - jwst.assign_wcs.nirspec - INFO - Applied Barycentric velocity correction : 0.9999124176092914
2026-02-20 18:03:59,258 - jwst.assign_wcs.nirspec - INFO - Created a NIRSPEC nrs_ifu pipeline with references {'distortion': None, 'filteroffset': None, 'specwcs': None, 'regions': None, 'wavelengthrange': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_wavelengthrange_0008.asdf', 'camera': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_camera_0010.asdf', 'collimator': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_collimator_0010.asdf', 'disperser': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_disperser_0083.asdf', 'fore': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fore_0065.asdf', 'fpa': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fpa_0011.asdf', 'msa': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msa_0011.asdf', 'ote': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ote_0013.asdf', 'ifupost': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifupost_0016.asdf', 'ifufore': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifufore_0015.asdf', 'ifuslicer': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifuslicer_0015.asdf'}
2026-02-20 18:04:03,686 - stcal.alignment.util - INFO - Update S_REGION to POLYGON ICRS  46.826578143 -13.764355816 46.827850044 -13.764355816 46.827850044 -13.763091425 46.826578143 -13.763091425
2026-02-20 18:04:07,082 - jwst.assign_wcs.assign_wcs - INFO - COMPLETED assign_wcs
2026-02-20 18:04:07,086 - stpipe.step - INFO - Step assign_wcs done
2026-02-20 18:04:07,422 - stpipe.step - INFO - Step badpix_selfcal running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>, [], []).
2026-02-20 18:04:07,423 - stpipe.step - INFO - Step skipped.
2026-02-20 18:04:07,716 - stpipe.step - INFO - Step msa_flagging running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:04:09,550 - jwst.msaflagopen.msaflagopen_step - INFO - Using reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msaoper_0011.json
2026-02-20 18:04:09,627 - jwst.msaflagopen.msaflag_open - INFO - 23 failed open shutters
2026-02-20 18:04:15,161 - stpipe.step - INFO - Step msa_flagging done
2026-02-20 18:04:15,714 - stpipe.step - INFO - Step nsclean running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:04:15,716 - jwst.nsclean.nsclean_step - WARNING - The 'nsclean' step is a deprecated alias to 'clean_flicker_noise' and will be removed in future builds.
2026-02-20 18:04:15,722 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Input exposure type is NRS_IFU, detector=NRS1
2026-02-20 18:04:18,113 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Flagging failed-open MSA shutters for scene masking
2026-02-20 18:04:18,114 - stpipe.step - INFO - MSAFlagOpenStep instance created.
2026-02-20 18:04:27,062 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Creating mask
2026-02-20 18:04:27,064 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Finding slice pixels for an IFU image
2026-02-20 18:04:28,391 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Masking the fixed slit region for IFU data.
2026-02-20 18:04:28,558 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Cleaning image jw01414013001_02101_00001_nrs1_rate.fits
2026-02-20 18:04:29,772 - stpipe.step - INFO - Step nsclean done
2026-02-20 18:04:30,716 - stpipe.step - INFO - Step imprint_subtract running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>, []).
2026-02-20 18:04:30,718 - stpipe.step - INFO - Step skipped.
2026-02-20 18:04:31,126 - stpipe.step - INFO - Step bkg_subtract running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>, []).
2026-02-20 18:04:31,127 - stpipe.step - INFO - Step skipped.
2026-02-20 18:04:31,526 - stpipe.step - INFO - Step srctype running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:04:34,194 - jwst.srctype.srctype - INFO - Input EXP_TYPE is NRS_IFU
2026-02-20 18:04:34,195 - jwst.srctype.srctype - INFO - Input SRCTYAPT = POINT
2026-02-20 18:04:34,196 - jwst.srctype.srctype - INFO - Using input source type = POINT
2026-02-20 18:04:34,197 - stpipe.step - INFO - Step srctype done
2026-02-20 18:04:34,705 - stpipe.step - INFO - Step straylight running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:04:34,706 - stpipe.step - INFO - Step skipped.
2026-02-20 18:04:35,195 - stpipe.step - INFO - Step flat_field running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:04:35,209 - jwst.flatfield.flat_field_step - INFO - No reference found for type FLAT
2026-02-20 18:04:35,229 - jwst.flatfield.flat_field_step - INFO - Using FFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fflat_0174.fits
2026-02-20 18:04:35,286 - jwst.flatfield.flat_field_step - INFO - Using SFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_sflat_0219.fits
2026-02-20 18:04:35,430 - jwst.flatfield.flat_field_step - INFO - Using DFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dflat_0001.fits
2026-02-20 18:04:41,495 - stpipe.step - INFO - Step flat_field done
2026-02-20 18:04:42,139 - stpipe.step - INFO - Step fringe running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:04:42,141 - stpipe.step - INFO - Step skipped.
2026-02-20 18:04:42,631 - stpipe.step - INFO - Step pathloss running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:04:42,640 - jwst.pathloss.pathloss_step - INFO - Using PATHLOSS reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pathloss_0003.fits
2026-02-20 18:04:42,655 - jwst.pathloss.pathloss - INFO - Input exposure type is NRS_IFU
2026-02-20 18:04:45,704 - stpipe.step - INFO - Step pathloss done
2026-02-20 18:04:46,371 - stpipe.step - INFO - Step barshadow running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:04:46,372 - stpipe.step - INFO - Step skipped.
2026-02-20 18:04:46,864 - stpipe.step - INFO - Step photom running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:04:46,877 - jwst.photom.photom_step - INFO - Using photom reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_photom_0016.fits
2026-02-20 18:04:46,878 - jwst.photom.photom_step - INFO - Using area reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_area_0034.fits
2026-02-20 18:04:48,519 - jwst.photom.photom - INFO - Using instrument: NIRSPEC
2026-02-20 18:04:48,520 - jwst.photom.photom - INFO -  detector: NRS1
2026-02-20 18:04:48,520 - jwst.photom.photom - INFO -  exp_type: NRS_IFU
2026-02-20 18:04:48,521 - jwst.photom.photom - INFO -  filter: F290LP
2026-02-20 18:04:48,521 - jwst.photom.photom - INFO -  grating: G395H
2026-02-20 18:04:48,547 - jwst.photom.photom - INFO - PHOTMJSR value: 3.83378e+12
2026-02-20 18:04:49,930 - stpipe.step - INFO - Step photom done
2026-02-20 18:04:50,644 - stpipe.step - INFO - Step residual_fringe running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00001_nrs1_rate.fits>,).
2026-02-20 18:04:50,646 - stpipe.step - INFO - Step skipped.
2026-02-20 18:04:53,433 - stpipe.step - INFO - Step pixel_replace running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00001_nrs1_cal.fits>,).
2026-02-20 18:04:53,434 - stpipe.step - INFO - Step skipped.
2026-02-20 18:04:53,940 - stpipe.step - INFO - Step cube_build running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00001_nrs1_cal.fits>,).
2026-02-20 18:04:53,941 - stpipe.step - INFO - Step skipped.
2026-02-20 18:04:56,713 - stpipe.step - INFO - Step extract_1d running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00001_nrs1_cal.fits>,).
2026-02-20 18:04:56,714 - stpipe.step - INFO - Step skipped.
2026-02-20 18:04:56,715 - jwst.pipeline.calwebb_spec2 - INFO - Finished processing product /stow/jruffio/data/JWST/tutorial/data/G395H_stage1_cleaned/jw01414013001_02101_00001_nrs1
2026-02-20 18:04:56,717 - jwst.pipeline.calwebb_spec2 - INFO - Ending calwebb_spec2
2026-02-20 18:04:56,717 - jwst.stpipe.core - INFO - Results used CRDS context: jwst_1464.pmap
2026-02-20 18:04:58,104 - stpipe.step - INFO - Saved model in /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00001_nrs1_cal.fits
2026-02-20 18:04:58,105 - stpipe.step - INFO - Step Spec2Pipeline done
2026-02-20 18:04:58,105 - jwst.stpipe.core - INFO - Results used jwst version: 1.20.2
2026-02-20 18:04:58,158 - stpipe.step - INFO - PARS-RESAMPLESPECSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-resamplespecstep_0001.asdf
2026-02-20 18:04:58,172 - stpipe.step - INFO - PARS-RESAMPLESPECSTEP parameters found: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pars-resamplespecstep_0001.asdf
2026-02-20 18:04:58,191 - stpipe.step - INFO - Spec2Pipeline instance created.
2026-02-20 18:04:58,192 - stpipe.step - INFO - AssignWcsStep instance created.
2026-02-20 18:04:58,193 - stpipe.step - INFO - BadpixSelfcalStep instance created.
2026-02-20 18:04:58,194 - stpipe.step - INFO - MSAFlagOpenStep instance created.
2026-02-20 18:04:58,194 - stpipe.step - INFO - NSCleanStep instance created.
2026-02-20 18:04:58,195 - stpipe.step - INFO - BackgroundStep instance created.
2026-02-20 18:04:58,196 - stpipe.step - INFO - ImprintStep instance created.
2026-02-20 18:04:58,197 - stpipe.step - INFO - Extract2dStep instance created.
2026-02-20 18:04:58,200 - stpipe.step - INFO - MasterBackgroundMosStep instance created.
2026-02-20 18:04:58,201 - stpipe.step - INFO - FlatFieldStep instance created.
2026-02-20 18:04:58,202 - stpipe.step - INFO - PathLossStep instance created.
2026-02-20 18:04:58,203 - stpipe.step - INFO - BarShadowStep instance created.
2026-02-20 18:04:58,203 - stpipe.step - INFO - PhotomStep instance created.
2026-02-20 18:04:58,204 - stpipe.step - INFO - PixelReplaceStep instance created.
2026-02-20 18:04:58,205 - stpipe.step - INFO - ResampleSpecStep instance created.
2026-02-20 18:04:58,206 - stpipe.step - INFO - Extract1dStep instance created.
2026-02-20 18:04:58,207 - stpipe.step - INFO - WavecorrStep instance created.
2026-02-20 18:04:58,207 - stpipe.step - INFO - FlatFieldStep instance created.
2026-02-20 18:04:58,208 - stpipe.step - INFO - SourceTypeStep instance created.
2026-02-20 18:04:58,209 - stpipe.step - INFO - StraylightStep instance created.
2026-02-20 18:04:58,210 - stpipe.step - INFO - FringeStep instance created.
2026-02-20 18:04:58,210 - stpipe.step - INFO - ResidualFringeStep instance created.
2026-02-20 18:04:58,211 - stpipe.step - INFO - PathLossStep instance created.
2026-02-20 18:04:58,212 - stpipe.step - INFO - BarShadowStep instance created.
2026-02-20 18:04:58,213 - stpipe.step - INFO - WfssContamStep instance created.
2026-02-20 18:04:58,214 - stpipe.step - INFO - PhotomStep instance created.
2026-02-20 18:04:58,214 - stpipe.step - INFO - PixelReplaceStep instance created.
2026-02-20 18:04:58,215 - stpipe.step - INFO - ResampleSpecStep instance created.
2026-02-20 18:04:58,216 - stpipe.step - INFO - CubeBuildStep instance created.
2026-02-20 18:04:58,218 - stpipe.step - INFO - Extract1dStep instance created.
        Stage 2 Runtime so far: 61.0905 seconds
Stage 2 Processing file 2 of 2.
2026-02-20 18:04:59,438 - stpipe.step - INFO - Step Spec2Pipeline running with args ('/stow/jruffio/data/JWST/tutorial/data/G395H_stage1_cleaned/jw01414013001_02101_00002_nrs1_rate.fits',).
2026-02-20 18:04:59,466 - stpipe.step - INFO - Step Spec2Pipeline parameters are:
  pre_hooks: []
  post_hooks: []
  output_file: None
  output_dir: /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned
  output_ext: .fits
  output_use_model: False
  output_use_index: True
  save_results: True
  skip: False
  suffix: None
  search_output_file: True
  input_dir: ''
  save_bsub: False
  fail_on_exception: True
  save_wfss_esec: False
  steps:
    assign_wcs:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      sip_approx: True
      sip_max_pix_error: 0.01
      sip_degree: None
      sip_max_inv_pix_error: 0.01
      sip_inv_degree: None
      sip_npoints: 12
      slit_y_low: -0.55
      slit_y_high: 0.55
      nrs_ifu_slice_wcs: False
    badpix_selfcal:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      flagfrac_lower: 0.001
      flagfrac_upper: 0.001
      kernel_size: 15
      force_single: False
      save_flagged_bkg: False
    msa_flagging:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    nsclean:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      fit_method: fft
      fit_by_channel: False
      background_method: None
      background_box_size: None
      mask_spectral_regions: True
      n_sigma: 5.0
      fit_histogram: False
      single_mask: False
      user_mask: None
      save_mask: False
      save_background: False
      save_noise: False
    bkg_subtract:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      bkg_list: None
      save_combined_background: False
      sigma: 3.0
      maxiters: None
      soss_source_percentile: 35.0
      soss_bkg_percentile: None
      wfss_mmag_extract: None
      wfss_maxiter: 5
      wfss_rms_stop: 0.0
      wfss_outlier_percent: 1.0
    imprint_subtract:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    extract_2d:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      slit_names: None
      source_ids: None
      extract_orders: None
      grism_objects: None
      tsgrism_extract_height: None
      wfss_extract_half_height: 5
      wfss_mmag_extract: None
      wfss_nbright: 1000
    master_background_mos:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      sigma_clip: 3.0
      median_kernel: 1
      force_subtract: False
      save_background: False
      user_background: None
      inverse: False
      steps:
        flat_field:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          save_interpolated_flat: False
          user_supplied_flat: None
          inverse: False
        pathloss:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
          user_slit_loc: None
        barshadow:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
        photom:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          inverse: False
          source_type: None
          apply_time_correction: True
        pixel_replace:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: True
          output_use_index: True
          save_results: False
          skip: True
          suffix: None
          search_output_file: True
          input_dir: ''
          algorithm: fit_profile
          n_adjacent_cols: 3
        resample_spec:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          pixfrac: 1.0
          kernel: square
          fillval: NaN
          weight_type: exptime
          output_shape: None
          pixel_scale_ratio: 1.0
          pixel_scale: None
          output_wcs: ''
          single: False
          blendheaders: True
          in_memory: True
        extract_1d:
          pre_hooks: []
          post_hooks: []
          output_file: None
          output_dir: None
          output_ext: .fits
          output_use_model: False
          output_use_index: True
          save_results: False
          skip: False
          suffix: None
          search_output_file: True
          input_dir: ''
          subtract_background: None
          apply_apcorr: True
          extraction_type: box
          use_source_posn: None
          position_offset: 0.0
          model_nod_pair: True
          optimize_psf_location: True
          smoothing_length: None
          bkg_fit: None
          bkg_order: None
          log_increment: 50
          save_profile: False
          save_scene_model: False
          save_residual_image: False
          center_xy: None
          ifu_autocen: False
          bkg_sigma_clip: 3.0
          ifu_rfcorr: True
          ifu_set_srctype: None
          ifu_rscale: None
          ifu_covar_scale: 1.0
          soss_atoca: True
          soss_threshold: 0.01
          soss_n_os: 2
          soss_wave_grid_in: None
          soss_wave_grid_out: None
          soss_estimate: None
          soss_rtol: 0.0001
          soss_max_grid_size: 20000
          soss_tikfac: None
          soss_width: 40.0
          soss_bad_pix: masking
          soss_modelname: None
          soss_order_3: True
    wavecorr:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    flat_field:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      save_interpolated_flat: False
      user_supplied_flat: None
      inverse: False
    srctype:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      source_type: None
    straylight:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      clean_showers: False
      shower_plane: 3
      shower_x_stddev: 18.0
      shower_y_stddev: 5.0
      shower_low_reject: 0.1
      shower_high_reject: 99.9
      save_shower_model: False
    fringe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
    residual_fringe:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: residual_fringe
      search_output_file: False
      input_dir: ''
      save_intermediate_results: False
      ignore_region_min: None
      ignore_region_max: None
    pathloss:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
      user_slit_loc: None
    barshadow:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
    wfss_contam:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      save_simulated_image: False
      save_contam_images: False
      maximum_cores: none
      orders: None
      magnitude_limit: None
      wl_oversample: 2
      max_pixels_per_chunk: 50000
    photom:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      inverse: False
      source_type: None
      apply_time_correction: True
    pixel_replace:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      algorithm: fit_profile
      n_adjacent_cols: 3
    resample_spec:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: False
      suffix: None
      search_output_file: True
      input_dir: ''
      pixfrac: 1.0
      kernel: square
      fillval: NaN
      weight_type: exptime
      output_shape: None
      pixel_scale_ratio: 1.0
      pixel_scale: None
      output_wcs: ''
      single: False
      blendheaders: True
      in_memory: True
    cube_build:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: True
      output_use_index: True
      save_results: False
      skip: True
      suffix: s3d
      search_output_file: False
      input_dir: ''
      pipeline: 3
      channel: all
      band: all
      grating: all
      filter: all
      output_type: None
      scalexy: 0.0
      scalew: 0.0
      weighting: drizzle
      coord_system: skyalign
      ra_center: None
      dec_center: None
      cube_pa: None
      nspax_x: None
      nspax_y: None
      rois: 0.0
      roiw: 0.0
      weight_power: 2.0
      wavemin: None
      wavemax: None
      single: False
      skip_dqflagging: False
      offset_file: None
      debug_spaxel: -1 -1 -1
    extract_1d:
      pre_hooks: []
      post_hooks: []
      output_file: None
      output_dir: None
      output_ext: .fits
      output_use_model: False
      output_use_index: True
      save_results: False
      skip: True
      suffix: None
      search_output_file: True
      input_dir: ''
      subtract_background: None
      apply_apcorr: True
      extraction_type: box
      use_source_posn: None
      position_offset: 0.0
      model_nod_pair: True
      optimize_psf_location: True
      smoothing_length: None
      bkg_fit: None
      bkg_order: None
      log_increment: 50
      save_profile: False
      save_scene_model: False
      save_residual_image: False
      center_xy: None
      ifu_autocen: False
      bkg_sigma_clip: 3.0
      ifu_rfcorr: True
      ifu_set_srctype: None
      ifu_rscale: None
      ifu_covar_scale: 1.0
      soss_atoca: True
      soss_threshold: 0.01
      soss_n_os: 2
      soss_wave_grid_in: None
      soss_wave_grid_out: None
      soss_estimate: None
      soss_rtol: 0.0001
      soss_max_grid_size: 20000
      soss_tikfac: None
      soss_width: 40.0
      soss_bad_pix: masking
      soss_modelname: None
      soss_order_3: True
2026-02-20 18:04:59,494 - stpipe.pipeline - INFO - Prefetching reference files for dataset: 'jw01414013001_02101_00002_nrs1_rate.fits' reftypes = ['area', 'barshadow', 'bkg', 'camera', 'collimator', 'dflat', 'disperser', 'distortion', 'fflat', 'filteroffset', 'flat', 'fore', 'fpa', 'fringe', 'ifufore', 'ifupost', 'ifuslicer', 'mrsxartcorr', 'msa', 'msaoper', 'ote', 'pathloss', 'photom', 'regions', 'sflat', 'specwcs', 'wavecorr', 'wavelengthrange']
2026-02-20 18:04:59,498 - stpipe.pipeline - INFO - Prefetch for AREA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_area_0034.fits'.
2026-02-20 18:04:59,499 - stpipe.pipeline - INFO - Prefetch for BARSHADOW reference file is 'N/A'.
2026-02-20 18:04:59,499 - stpipe.pipeline - INFO - Prefetch for BKG reference file is 'N/A'.
2026-02-20 18:04:59,500 - stpipe.pipeline - INFO - Prefetch for CAMERA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_camera_0010.asdf'.
2026-02-20 18:04:59,500 - stpipe.pipeline - INFO - Prefetch for COLLIMATOR reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_collimator_0010.asdf'.
2026-02-20 18:04:59,501 - stpipe.pipeline - INFO - Prefetch for DFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dflat_0001.fits'.
2026-02-20 18:04:59,501 - stpipe.pipeline - INFO - Prefetch for DISPERSER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_disperser_0083.asdf'.
2026-02-20 18:04:59,502 - stpipe.pipeline - INFO - Prefetch for DISTORTION reference file is 'N/A'.
2026-02-20 18:04:59,502 - stpipe.pipeline - INFO - Prefetch for FFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fflat_0174.fits'.
2026-02-20 18:04:59,503 - stpipe.pipeline - INFO - Prefetch for FILTEROFFSET reference file is 'N/A'.
2026-02-20 18:04:59,503 - stpipe.pipeline - INFO - Prefetch for FLAT reference file is 'N/A'.
2026-02-20 18:04:59,504 - stpipe.pipeline - INFO - Prefetch for FORE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fore_0065.asdf'.
2026-02-20 18:04:59,504 - stpipe.pipeline - INFO - Prefetch for FPA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fpa_0011.asdf'.
2026-02-20 18:04:59,505 - stpipe.pipeline - INFO - Prefetch for FRINGE reference file is 'N/A'.
2026-02-20 18:04:59,505 - stpipe.pipeline - INFO - Prefetch for IFUFORE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifufore_0015.asdf'.
2026-02-20 18:04:59,506 - stpipe.pipeline - INFO - Prefetch for IFUPOST reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifupost_0016.asdf'.
2026-02-20 18:04:59,506 - stpipe.pipeline - INFO - Prefetch for IFUSLICER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifuslicer_0015.asdf'.
2026-02-20 18:04:59,507 - stpipe.pipeline - INFO - Prefetch for MRSXARTCORR reference file is 'N/A'.
2026-02-20 18:04:59,507 - stpipe.pipeline - INFO - Prefetch for MSA reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msa_0011.asdf'.
2026-02-20 18:04:59,508 - stpipe.pipeline - INFO - Prefetch for MSAOPER reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msaoper_0011.json'.
2026-02-20 18:04:59,508 - stpipe.pipeline - INFO - Prefetch for OTE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ote_0013.asdf'.
2026-02-20 18:04:59,509 - stpipe.pipeline - INFO - Prefetch for PATHLOSS reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pathloss_0003.fits'.
2026-02-20 18:04:59,509 - stpipe.pipeline - INFO - Prefetch for PHOTOM reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_photom_0016.fits'.
2026-02-20 18:04:59,510 - stpipe.pipeline - INFO - Prefetch for REGIONS reference file is 'N/A'.
2026-02-20 18:04:59,510 - stpipe.pipeline - INFO - Prefetch for SFLAT reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_sflat_0219.fits'.
2026-02-20 18:04:59,511 - stpipe.pipeline - INFO - Prefetch for SPECWCS reference file is 'N/A'.
2026-02-20 18:04:59,511 - stpipe.pipeline - INFO - Prefetch for WAVECORR reference file is 'N/A'.
2026-02-20 18:04:59,511 - stpipe.pipeline - INFO - Prefetch for WAVELENGTHRANGE reference file is '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_wavelengthrange_0008.asdf'.
2026-02-20 18:04:59,512 - jwst.pipeline.calwebb_spec2 - INFO - Starting calwebb_spec2 ...
2026-02-20 18:04:59,513 - jwst.pipeline.calwebb_spec2 - INFO - Processing product /stow/jruffio/data/JWST/tutorial/data/G395H_stage1_cleaned/jw01414013001_02101_00002_nrs1
2026-02-20 18:04:59,513 - jwst.pipeline.calwebb_spec2 - INFO - Working on input /stow/jruffio/data/JWST/tutorial/data/G395H_stage1_cleaned/jw01414013001_02101_00002_nrs1_rate.fits ...
2026-02-20 18:04:59,793 - stpipe.step - INFO - Step assign_wcs running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:04:59,841 - jwst.assign_wcs.nirspec - INFO - gwa_ytilt is 0.144672647 deg
2026-02-20 18:04:59,842 - jwst.assign_wcs.nirspec - INFO - gwa_xtilt is 0.319160342 deg
2026-02-20 18:04:59,843 - jwst.assign_wcs.nirspec - INFO - theta_y correction: 0.0001127116201274071 deg
2026-02-20 18:04:59,844 - jwst.assign_wcs.nirspec - INFO - theta_x correction: 8.739014225467499e-05 deg
2026-02-20 18:04:59,908 - jwst.assign_wcs.nirspec - INFO - Applied Barycentric velocity correction : 0.9999124176092914
2026-02-20 18:05:01,364 - jwst.assign_wcs.nirspec - INFO - Created a NIRSPEC nrs_ifu pipeline with references {'distortion': None, 'filteroffset': None, 'specwcs': None, 'regions': None, 'wavelengthrange': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_wavelengthrange_0008.asdf', 'camera': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_camera_0010.asdf', 'collimator': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_collimator_0010.asdf', 'disperser': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_disperser_0083.asdf', 'fore': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fore_0065.asdf', 'fpa': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fpa_0011.asdf', 'msa': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msa_0011.asdf', 'ote': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ote_0013.asdf', 'ifupost': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifupost_0016.asdf', 'ifufore': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifufore_0015.asdf', 'ifuslicer': '/stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_ifuslicer_0015.asdf'}
2026-02-20 18:05:05,728 - stcal.alignment.util - INFO - Update S_REGION to POLYGON ICRS  46.826532286 -13.764239869 46.827804187 -13.764239869 46.827804187 -13.762975478 46.826532286 -13.762975478
2026-02-20 18:05:09,118 - jwst.assign_wcs.assign_wcs - INFO - COMPLETED assign_wcs
2026-02-20 18:05:09,122 - stpipe.step - INFO - Step assign_wcs done
2026-02-20 18:05:09,442 - stpipe.step - INFO - Step badpix_selfcal running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>, [], []).
2026-02-20 18:05:09,443 - stpipe.step - INFO - Step skipped.
2026-02-20 18:05:09,737 - stpipe.step - INFO - Step msa_flagging running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:05:11,567 - jwst.msaflagopen.msaflagopen_step - INFO - Using reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_msaoper_0011.json
2026-02-20 18:05:11,644 - jwst.msaflagopen.msaflag_open - INFO - 23 failed open shutters
2026-02-20 18:05:17,167 - stpipe.step - INFO - Step msa_flagging done
2026-02-20 18:05:17,725 - stpipe.step - INFO - Step nsclean running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:05:17,726 - jwst.nsclean.nsclean_step - WARNING - The 'nsclean' step is a deprecated alias to 'clean_flicker_noise' and will be removed in future builds.
2026-02-20 18:05:17,733 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Input exposure type is NRS_IFU, detector=NRS1
2026-02-20 18:05:20,126 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Flagging failed-open MSA shutters for scene masking
2026-02-20 18:05:20,127 - stpipe.step - INFO - MSAFlagOpenStep instance created.
2026-02-20 18:05:29,027 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Creating mask
2026-02-20 18:05:29,027 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Finding slice pixels for an IFU image
2026-02-20 18:05:30,307 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Masking the fixed slit region for IFU data.
2026-02-20 18:05:30,475 - jwst.clean_flicker_noise.clean_flicker_noise - INFO - Cleaning image jw01414013001_02101_00002_nrs1_rate.fits
2026-02-20 18:05:31,701 - stpipe.step - INFO - Step nsclean done
2026-02-20 18:05:32,671 - stpipe.step - INFO - Step imprint_subtract running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>, []).
2026-02-20 18:05:32,672 - stpipe.step - INFO - Step skipped.
2026-02-20 18:05:33,076 - stpipe.step - INFO - Step bkg_subtract running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>, []).
2026-02-20 18:05:33,077 - stpipe.step - INFO - Step skipped.
2026-02-20 18:05:33,473 - stpipe.step - INFO - Step srctype running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:05:36,131 - jwst.srctype.srctype - INFO - Input EXP_TYPE is NRS_IFU
2026-02-20 18:05:36,132 - jwst.srctype.srctype - INFO - Input SRCTYAPT = POINT
2026-02-20 18:05:36,132 - jwst.srctype.srctype - INFO - Using input source type = POINT
2026-02-20 18:05:36,134 - stpipe.step - INFO - Step srctype done
2026-02-20 18:05:36,639 - stpipe.step - INFO - Step straylight running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:05:36,640 - stpipe.step - INFO - Step skipped.
2026-02-20 18:05:37,129 - stpipe.step - INFO - Step flat_field running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:05:37,142 - jwst.flatfield.flat_field_step - INFO - No reference found for type FLAT
2026-02-20 18:05:37,162 - jwst.flatfield.flat_field_step - INFO - Using FFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_fflat_0174.fits
2026-02-20 18:05:37,219 - jwst.flatfield.flat_field_step - INFO - Using SFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_sflat_0219.fits
2026-02-20 18:05:37,359 - jwst.flatfield.flat_field_step - INFO - Using DFLAT reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_dflat_0001.fits
2026-02-20 18:05:43,465 - stpipe.step - INFO - Step flat_field done
2026-02-20 18:05:44,124 - stpipe.step - INFO - Step fringe running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:05:44,126 - stpipe.step - INFO - Step skipped.
2026-02-20 18:05:44,622 - stpipe.step - INFO - Step pathloss running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:05:44,630 - jwst.pathloss.pathloss_step - INFO - Using PATHLOSS reference file /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_pathloss_0003.fits
2026-02-20 18:05:44,644 - jwst.pathloss.pathloss - INFO - Input exposure type is NRS_IFU
2026-02-20 18:05:47,702 - stpipe.step - INFO - Step pathloss done
2026-02-20 18:05:48,365 - stpipe.step - INFO - Step barshadow running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:05:48,366 - stpipe.step - INFO - Step skipped.
2026-02-20 18:05:48,855 - stpipe.step - INFO - Step photom running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:05:48,865 - jwst.photom.photom_step - INFO - Using photom reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_photom_0016.fits
2026-02-20 18:05:48,866 - jwst.photom.photom_step - INFO - Using area reference file: /stow/jruffio/data/JWST/crds_cache/references/jwst/nirspec/jwst_nirspec_area_0034.fits
2026-02-20 18:05:50,469 - jwst.photom.photom - INFO - Using instrument: NIRSPEC
2026-02-20 18:05:50,469 - jwst.photom.photom - INFO -  detector: NRS1
2026-02-20 18:05:50,470 - jwst.photom.photom - INFO -  exp_type: NRS_IFU
2026-02-20 18:05:50,470 - jwst.photom.photom - INFO -  filter: F290LP
2026-02-20 18:05:50,471 - jwst.photom.photom - INFO -  grating: G395H
2026-02-20 18:05:50,497 - jwst.photom.photom - INFO - PHOTMJSR value: 3.83378e+12
2026-02-20 18:05:51,863 - stpipe.step - INFO - Step photom done
2026-02-20 18:05:52,527 - stpipe.step - INFO - Step residual_fringe running with args (<IFUImageModel(2048, 2048) from jw01414013001_02101_00002_nrs1_rate.fits>,).
2026-02-20 18:05:52,529 - stpipe.step - INFO - Step skipped.
2026-02-20 18:05:55,364 - stpipe.step - INFO - Step pixel_replace running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00002_nrs1_cal.fits>,).
2026-02-20 18:05:55,365 - stpipe.step - INFO - Step skipped.
2026-02-20 18:05:55,875 - stpipe.step - INFO - Step cube_build running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00002_nrs1_cal.fits>,).
2026-02-20 18:05:55,876 - stpipe.step - INFO - Step skipped.
2026-02-20 18:05:58,619 - stpipe.step - INFO - Step extract_1d running with args (<IFUImageModel(2048, 2048) from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00002_nrs1_cal.fits>,).
2026-02-20 18:05:58,620 - stpipe.step - INFO - Step skipped.
2026-02-20 18:05:58,621 - jwst.pipeline.calwebb_spec2 - INFO - Finished processing product /stow/jruffio/data/JWST/tutorial/data/G395H_stage1_cleaned/jw01414013001_02101_00002_nrs1
2026-02-20 18:05:58,622 - jwst.pipeline.calwebb_spec2 - INFO - Ending calwebb_spec2
2026-02-20 18:05:58,623 - jwst.stpipe.core - INFO - Results used CRDS context: jwst_1464.pmap
2026-02-20 18:06:00,012 - stpipe.step - INFO - Saved model in /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00002_nrs1_cal.fits
2026-02-20 18:06:00,013 - stpipe.step - INFO - Step Spec2Pipeline done
2026-02-20 18:06:00,014 - jwst.stpipe.core - INFO - Results used jwst version: 1.20.2
        Stage 2 Runtime so far: 122.9989 seconds
Stage 2 Total Runtime: 122.9989 seconds
Plots saved to /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/plots_stage2_jw01414013001_nrs1.pdf
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00001_nrs1_cal.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00001_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Running compute_med_filt_badpix with parameters:
         save_utils: True
         window_size: 50
         mad_threshold: 50
Initializing row_err and bad_pixels for nirspec
/home/jruffio/anaconda3/envs/breads_2026/lib/python3.12/site-packages/scipy/ndimage/_filters.py:2420: RuntimeWarning: All-NaN slice encountered
  _nd_image.generic_filter(input, function, footprint, output, mode,
/home/jruffio/code/breads/breads/instruments/jwstnirspec_cal.py:198: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  row_err_masking = row_err/median_abs_deviation(row_err[np.where(np.isfinite(self.bad_pixels[rowid,:]))])
/home/jruffio/code/breads/breads/instruments/jwstnirspec_cal.py:198: RuntimeWarning: invalid value encountered in divide
  row_err_masking = row_err/median_abs_deviation(row_err[np.where(np.isfinite(self.bad_pixels[rowid,:]))])
  Saved the quick bad pixel map to /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_00001_nrs1_cal_roughbadpix.fits
Running compute_coordinates_arrays with parameters:
         save_utils: True
         targname: HD 19467
Computing coordinates arrays.
Computing coords for 30 slices...
100%|███████████████████████████████████████████████████████████████| 30/30 [00:01<00:00, 22.21it/s]
Retrieving SIMBAD coordinates for HD 19467
Coordinates at J2000:  03h07m18.57505144s -13d45m42.41798215s
Coordinates at 2024-01-25:  03h07m18.56069141s -13d45m48.69016027s
  Saved the computed coordinates arrays to /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_00001_nrs1_cal_relcoords.fits
Running convert_MJy_per_sr_to_MJy with parameters:
         save_utils: True
Running apply_coords_offset with parameters:
         save_utils: True
         coords_offset: (array([-0.00058284, -0.0022742 , -0.0584407 ]), array([ 0.00050445, -0.01076225, -0.18053904]))
Applying relative coordinate offset (array([-0.00058284, -0.0022742 , -0.0584407 ]), array([ 0.00050445, -0.01076225, -0.18053904]))
Running compute_starspectrum_contnorm with parameters:
         save_utils: True
         x_nodes: [2.859 2.879 2.899 2.919 2.939 2.959 2.979 2.999 3.019 3.039 3.059 3.079
 3.099 3.119 3.139 3.159 3.189 3.219 3.249 3.279 3.309 3.339 3.369 3.399
 3.429 3.459 3.499 3.539 3.579 3.619 3.659 3.699 3.739 3.779 3.839 3.899
 3.959 4.019 4.079 4.139]
         threshold_badpix: 100
         mppool: <multiprocess.pool.Pool state=RUN pool_size=16>
Computing stellar spectrum (continuum normalized)
Saved the continuum normalized star spectrum to /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_00001_nrs1_cal_starspec_contnorm.fits
Running compute_starsubtraction with parameters:
         save_utils: True
         starsub_dir: starsub1d
         threshold_badpix: 10
         mppool: <multiprocess.pool.Pool state=RUN pool_size=16>
Computing star subtraction.
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:1411: RuntimeWarning: All-NaN slice encountered
  reg_mean_map[wherenan] = np.tile(np.nanmedian(spline_paras0, axis=1)[:, None], (1, spline_paras0.shape[1]))[wherenan]
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:1413: RuntimeWarning: All-NaN slice encountered
  reg_std_map[wherenan] = np.tile(np.nanmax(np.abs(spline_paras0), axis=1)[:, None], (1, spline_paras0.shape[1]))[wherenan]
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00002_nrs1_cal.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00002_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Running compute_med_filt_badpix with parameters:
         save_utils: True
         window_size: 50
         mad_threshold: 50
Initializing row_err and bad_pixels for nirspec
/home/jruffio/anaconda3/envs/breads_2026/lib/python3.12/site-packages/scipy/ndimage/_filters.py:2420: RuntimeWarning: All-NaN slice encountered
  _nd_image.generic_filter(input, function, footprint, output, mode,
/home/jruffio/code/breads/breads/instruments/jwstnirspec_cal.py:198: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  row_err_masking = row_err/median_abs_deviation(row_err[np.where(np.isfinite(self.bad_pixels[rowid,:]))])
/home/jruffio/code/breads/breads/instruments/jwstnirspec_cal.py:198: RuntimeWarning: invalid value encountered in divide
  row_err_masking = row_err/median_abs_deviation(row_err[np.where(np.isfinite(self.bad_pixels[rowid,:]))])
  Saved the quick bad pixel map to /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_00002_nrs1_cal_roughbadpix.fits
Running compute_coordinates_arrays with parameters:
         save_utils: True
         targname: HD 19467
Computing coordinates arrays.
Computing coords for 30 slices...
100%|███████████████████████████████████████████████████████████████| 30/30 [00:01<00:00, 22.59it/s]
Retrieving SIMBAD coordinates for HD 19467
Coordinates at J2000:  03h07m18.57505144s -13d45m42.41798215s
Coordinates at 2024-01-25:  03h07m18.56069141s -13d45m48.69016027s
  Saved the computed coordinates arrays to /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_00002_nrs1_cal_relcoords.fits
Running convert_MJy_per_sr_to_MJy with parameters:
         save_utils: True
Running apply_coords_offset with parameters:
         save_utils: True
         coords_offset: (array([-0.00058284, -0.0022742 , -0.0584407 ]), array([ 0.00050445, -0.01076225, -0.18053904]))
Applying relative coordinate offset (array([-0.00058284, -0.0022742 , -0.0584407 ]), array([ 0.00050445, -0.01076225, -0.18053904]))
Running compute_starspectrum_contnorm with parameters:
         save_utils: True
         x_nodes: [2.859 2.879 2.899 2.919 2.939 2.959 2.979 2.999 3.019 3.039 3.059 3.079
 3.099 3.119 3.139 3.159 3.189 3.219 3.249 3.279 3.309 3.339 3.369 3.399
 3.429 3.459 3.499 3.539 3.579 3.619 3.659 3.699 3.739 3.779 3.839 3.899
 3.959 4.019 4.079 4.139]
         threshold_badpix: 100
         mppool: <multiprocess.pool.Pool state=RUN pool_size=16>
Computing stellar spectrum (continuum normalized)
Saved the continuum normalized star spectrum to /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_00002_nrs1_cal_starspec_contnorm.fits
Running compute_starsubtraction with parameters:
         save_utils: True
         starsub_dir: starsub1d
         threshold_badpix: 10
         mppool: <multiprocess.pool.Pool state=RUN pool_size=16>
Computing star subtraction.
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:1411: RuntimeWarning: All-NaN slice encountered
  reg_mean_map[wherenan] = np.tile(np.nanmedian(spline_paras0, axis=1)[:, None], (1, spline_paras0.shape[1]))[wherenan]
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:1413: RuntimeWarning: All-NaN slice encountered
  reg_std_map[wherenan] = np.tile(np.nanmax(np.abs(spline_paras0), axis=1)[:, None], (1, spline_paras0.shape[1]))[wherenan]
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:2003: RuntimeWarning: invalid value encountered in divide
  where_bad = np.where((np.abs(norm_res_row) / meddev > threshold) | np.isnan(norm_res_row))
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00001_nrs1_cal.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00001_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Loading data for compute_med_filt_badpix cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_00001_nrs1_cal_roughbadpix.fits
Loading data for compute_coordinates_arrays cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_00001_nrs1_cal_relcoords.fits
Running convert_MJy_per_sr_to_MJy with parameters:
         save_utils: True
Running apply_coords_offset with parameters:
         save_utils: True
         coords_offset: (array([-0.00058284, -0.0022742 , -0.0584407 ]), array([ 0.00050445, -0.01076225, -0.18053904]))
Applying relative coordinate offset (array([-0.00058284, -0.0022742 , -0.0584407 ]), array([ 0.00050445, -0.01076225, -0.18053904]))
/stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00002_nrs1_cal.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned/jw01414013001_02101_00002_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Loading data for compute_med_filt_badpix cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_00002_nrs1_cal_roughbadpix.fits
Loading data for compute_coordinates_arrays cached in /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_00002_nrs1_cal_relcoords.fits
Running convert_MJy_per_sr_to_MJy with parameters:
         save_utils: True
Running apply_coords_offset with parameters:
         save_utils: True
         coords_offset: (array([-0.00058284, -0.0022742 , -0.0584407 ]), array([ 0.00050445, -0.01076225, -0.18053904]))
Applying relative coordinate offset (array([-0.00058284, -0.0022742 , -0.0584407 ]), array([ 0.00050445, -0.01076225, -0.18053904]))
-1.4856883494560706 1.8791713967148662 -1.3970566452280107 2.430515655328636
[-1.48568835 -1.42865683 -1.37162531 -1.31459379 -1.25756226 -1.20053074
 -1.14349922 -1.0864677  -1.02943618 -0.97240466 -0.91537314 -0.85834162
 -0.8013101  -0.74427857 -0.68724705 -0.63021553 -0.57318401 -0.51615249
 -0.45912097 -0.40208945 -0.34505793 -0.28802641 -0.23099488 -0.17396336
 -0.11693184 -0.05990032 -0.0028688   0.05416272  0.11119424  0.16822576
  0.22525728  0.28228881  0.33932033  0.39635185  0.45338337  0.51041489
  0.56744641  0.62447793  0.68150945  0.73854097  0.7955725   0.85260402
  0.90963554  0.96666706  1.02369858  1.0807301   1.13776162  1.19479314
  1.25182466  1.30885619  1.36588771  1.42291923  1.47995075  1.53698227
  1.59401379  1.65104531  1.70807683  1.76510835  1.82213988  1.8791714 ] [-1.39705665 -1.33218254 -1.26730843 -1.20243432 -1.13756022 -1.07268611
 -1.007812   -0.9429379  -0.87806379 -0.81318968 -0.74831558 -0.68344147
 -0.61856736 -0.55369326 -0.48881915 -0.42394504 -0.35907094 -0.29419683
 -0.22932272 -0.16444862 -0.09957451 -0.0347004   0.0301737   0.09504781
  0.15992192  0.22479602  0.28967013  0.35454424  0.41941834  0.48429245
  0.54916656  0.61404067  0.67891477  0.74378888  0.80866299  0.87353709
  0.9384112   1.00328531  1.06815941  1.13303352  1.19790763  1.26278173
  1.32765584  1.39252995  1.45740405  1.52227816  1.58715227  1.65202637
  1.71690048  1.78177459  1.84664869  1.9115228   1.97639691  2.04127101
  2.10614512  2.17101923  2.23589333  2.30076744  2.36564155  2.43051566]
Searching in /stow/jruffio/data/JWST/tutorial/data/G395H_stage2_cleaned for files matching jw01414013001_02101_*_nrs1_cal.fits
        Found 2 input files to process
        jw01414013001_02101_00001_nrs1_cal.fits
        jw01414013001_02101_00002_nrs1_cal.fits
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_utils/starsub1d/jw01414013001_02101_00001_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Reading data from /stow/jruffio/data/JWST/tutorial/data/G395H_utils/starsub1d/jw01414013001_02101_00002_nrs1_cal.fits
        Unpacking data quality bitmasks. DQ array is of type uint32
Computing PSFs. This has to iterate over many wavelengths, so is slow.
iterating query, tdelta=3.0

MAST OPD query around UTC: 2024-01-25T17:47:35.716
                        MJD: 60334.741385601854

OPD immediately preceding the given datetime:
        URI:     mast:JWST/product/R2024012502-NRCA3_FP1-1.fits
        Date (MJD):      60334.2955
        Delta time:      -0.4459 days

OPD immediately following the given datetime:
        URI:     mast:JWST/product/R2024012702-NRCA3_FP1-1.fits
        Date (MJD):      60336.5976
        Delta time:      1.8562 days
User requested choosing OPD time closest in time to 2024-01-25T17:47:35.716, which is R2024012502-NRCA3_FP1-1.fits, delta time -0.446 days
Importing and format-converting OPD from /fast/jruffio/data/stpsf-data/MAST_JWST_WSS_OPDs/R2024012502-NRCA3_FP1-1.fits
Backing out SI WFE and OTE field dependence at the WF sensing field point (NRCA3_FP1)
Sensing inst model using apername NRCA3_FP1
Using sensing field point SI WFE model from file wss_target_phase_fp1.fits
        Performing parallelized calculation of PSF at 1837 wavelengths.
Writing pupilopd tempfile : /tmp/tmpkp8akpcx
preparing parameter list...
1836,4.101362466812134,18377
starting parallel _get_wpsf_task ...
100%|███████████████████████████████████████████████████████████| 1837/1837 [02:09<00:00, 14.22it/s]

collating pool outputs...
12

1836
done.
WARNING: VerifyWarning: Card is too long, comment will be truncated. [astropy.io.fits.card]
  Saved the computed PSFs to /stow/jruffio/data/JWST/tutorial/data/G395H_utils/jw01414013001_02101_nrs1_webbpsf.fits
Setting parallel_flag = True
Processing wavelength indices in range: 0 to 1837
prepping build_cube inputs... id: 1836 wave: 4.1013624668121345starting parallel _build_cube_task...
  0%|                                                                      | 0/1837 [00:00<?, ?it/s]/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
/home/jruffio/code/breads/breads/instruments/jwst_IFUs.py:3082: SmallSampleWarning: One or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
  Zerr_masking = Zerr / median_abs_deviation(Zerr[np.where(np.isfinite(Zerr))])
100%|███████████████████████████████████████████████████████████| 1837/1837 [12:51<00:00,  2.38it/s]
cubing outputs... id: 132 wave: 2.9487879276275635

cubing outputs... id: 1836 wave: 4.1013624668121345saving /stow/jruffio/data/JWST/tutorial/outputs/jw01414013001_02101_nrs1_spectral_cube_ish.fits
build cube ran in 774.0 seconds...
../../_images/tutorials_jwst_nirspec_1_running_BREADS_pipeline_tutorial_21_64.png
../../_images/tutorials_jwst_nirspec_1_running_BREADS_pipeline_tutorial_21_65.png
[ ]:

Examining the outputs

Below is simple plot showing the interpolation of the point cloud computed in Step 7 for nrs2 only. The interpolation is computed at the median wavelength wv0, but this can be computed at any wavelength by changing the argument to get_2D_point_cloud_interpolator. The image should show the basic structure of a Webb PSF.

[12]:
dramin, dramax, ddecmin, ddecmax = np.min(ra_vec),np.max(ra_vec),np.min(dec_vec),np.max(dec_vec)
extent=[dramin, dramax, ddecmin, ddecmax]

N = 240
ra_vec = np.linspace(dramin,dramax,N)
dec_vec = np.linspace(ddecmin,ddecmax,N)
inp = np.meshgrid(ra_vec,dec_vec)
out = pointcloud_interp(inp[0],inp[1])

fig =plt.figure(figsize=(5,5),dpi=200)
im = plt.imshow(np.log10(abs(out)),origin='lower',extent=extent,vmin=-12,vmax=-8,aspect='auto')

plt.xlim([dramax-.1,dramin+.2])
plt.ylim([ddecmin+.1,ddecmax-.1])
cbar = fig.colorbar(im, fraction=0.05, pad=0.04)
cbar.set_label(r'log$_{10} \left(\frac{\mathrm{flux}}{\mathrm{MJy}}\right)$')
plt.xlabel('IFU x (arcsec)')
plt.ylabel('IFU y (arcsec)')
plt.title('Interpolation of non starsub point cloud')
plt.show()
../../_images/tutorials_jwst_nirspec_1_running_BREADS_pipeline_tutorial_25_0.png
[ ]:

[ ]:

[ ]: