Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from jwst.ramp_fitting import RampFitStep
from jwst.refpix import RefPixStep
from jwst.rscd import RSCD_Step
from jwst.saturation import SaturationStep
from jwst.superbias import SuperBiasStep
from jwql.utils.constants import JWST_INSTRUMENT_NAMES_UPPERCASE
# Define the fits header keyword that accompanies each step
PIPE_KEYWORDS = {'S_GRPSCL': 'group_scale', 'S_DQINIT': 'dq_init', 'S_SATURA': 'saturation',
'S_IPC': 'ipc', 'S_REFPIX': 'refpix', 'S_SUPERB': 'superbias',
'S_PERSIS': 'persistence', 'S_DARK': 'dark_current', 'S_LINEAR': 'linearity',
'S_FRSTFR': 'firstframe', 'S_LASTFR': 'lastframe', 'S_RSCD': 'rscd',
'S_JUMP': 'jump', 'S_RAMP': 'rate'}
PIPELINE_STEP_MAPPING = {'dq_init': DQInitStep, 'dark_current': DarkCurrentStep,
'firstframe': FirstFrameStep, 'group_scale': GroupScaleStep,
'ipc': IPCStep, 'jump': JumpStep, 'lastframe': LastFrameStep,
'linearity': LinearityStep, 'persistence': PersistenceStep,
'rate': RampFitStep, 'refpix': RefPixStep, 'rscd': RSCD_Step,
'saturation': SaturationStep, 'superbias': SuperBiasStep}
# Readout patterns that have nframes != a power of 2. These readout patterns
# require the group_scale pipeline step to be run.
GROUPSCALE_READOUT_PATTERNS = ['NRSIRS2']
def completed_pipeline_steps(filename):
"""Return a list of the completed pipeline steps for a given file.
Parameters
----------