Beispiel #1
0
def create_step_dictionary(steplist):
    """Create a dictionary of pipeline steps with boolean entries
    given a list of steps to be set to True

    Parameters
    ----------
    steplist : str
        Comma separated list of pipeline steps to set to True

    Returns
    -------
    step_dict : dict
        Dictionary with requested steps set to True
    """
    all_false = OrderedDict()
    for key in get_pipeline_steps('nircam'):
        all_false[key] = False
    step_dict = copy.deepcopy(all_false)
    pipesteps = [element.strip() for element in steplist.split(',')]
    for stepname in pipesteps:
        if stepname in all_false.keys():
            step_dict[stepname] = True
        else:
            raise ValueError(
                "{} is not a valid step dictionary entry.".format(stepname))
    return step_dict
Beispiel #2
0
    def __init__(self, instrument):
        self.logger = logging.getLogger(__name__)
        self.logger.info('Creating an instance of CalibPrep')
        self.__version__ = 0.1
        self.verbose = True
        self.inputs = None
        self.search_dir = ''
        self.use_only_given = False
        self.overwrite_existing_files = True
        self.output_dir = ''
        #self.pipe_step_dict = OrderedDict(PIPE_STEPS)

        instrument = instrument.lower()
        if instrument not in INSTRUMENTS:
            raise ValueError("WARNING: {} is not a valid instrument name.".format(instrument))
        self.pipe_step_list = get_pipeline_steps(instrument)