예제 #1
0
    def load(self, config_files):
        """Load the configuration override files.

        Parameters
        ----------
        config_files : list[str]
            A set of configuration override files.
        """
        for prop in self.general_props.values():
            load_config(prop, config_files)
        for prop in self.sequence_props.values():
            load_config(prop, config_files)
예제 #2
0
    def load(self, ifiles):
        """Load and apply configuration override files.

        This function loads the specified configuration files and applies them to the configuration
        objects. If input is a directory, it is assumed that all files in that directory are override
        files.

        Parameters
        ----------
        ifiles : list[str]
            A list of files or directories containing configuration overrides.
        """
        if ifiles is None:
            return
        config_files = []
        for ifile in ifiles:
            ifile = expand_path(ifile)
            if os.path.isdir(ifile):
                dfiles = os.listdir(ifile)
                for dfile in dfiles:
                    full_dfile = os.path.join(ifile, dfile)
                    if os.path.isfile(full_dfile):
                        config_files.append(full_dfile)
                    if os.path.isdir(full_dfile):
                        self.survey.alt_proposal_dir = full_dfile
            else:
                config_files.append(ifile)

        if self.survey.alt_proposal_dir is not None:
            sys.path.insert(0, self.survey.alt_proposal_dir)

        if len(config_files):
            load_config(self.survey, config_files)
            self.science.load(config_files)
            load_config(self.observing_site, config_files)
            self.observatory.load(config_files)
            load_config(self.downtime, config_files)
            load_config(self.sched_driver, config_files)
            load_config(self.environment, config_files)
예제 #3
0
    def load(self, ifiles):
        """Load and apply configuration override files.

        This function loads the specified configuration files and applies them to the configuration
        objects. If input is a directory, it is assumed that all files in that directory are override
        files.

        Parameters
        ----------
        ifiles : list[str]
            A list of files or directories containing configuration overrides.
        """
        if ifiles is None:
            return
        config_files = []
        for ifile in ifiles:
            ifile = expand_path(ifile)
            if os.path.isdir(ifile):
                dfiles = os.listdir(ifile)
                for dfile in dfiles:
                    full_dfile = os.path.join(ifile, dfile)
                    if os.path.isfile(full_dfile):
                        config_files.append(full_dfile)
                    if os.path.isdir(full_dfile):
                        self.survey.alt_proposal_dir = full_dfile
            else:
                config_files.append(ifile)

        if len(config_files):
            load_config(self.survey, config_files)
            self.science.load(config_files)
            load_config(self.observing_site, config_files)
            self.observatory.load(config_files)
            load_config(self.downtime, config_files)
            load_config(self.sched_driver, config_files)
            load_config(self.environment, config_files)
예제 #4
0
    def load(self, config_files):
        """Load the configuration override files.

        Parameters
        ----------
        config_files : list[str]
            A set of configuration override files.
        """
        load_config(self.telescope, config_files)
        load_config(self.dome, config_files)
        load_config(self.rotator, config_files)
        load_config(self.camera, config_files)
        load_config(self.filters, config_files)
        load_config(self.slew, config_files)
        load_config(self.optics_loop_corr, config_files)
        load_config(self.park, config_files)
        load_config(self.obs_var, config_files)
예제 #5
0
    def load(self, config_files):
        """Load the configuration override files.

        Parameters
        ----------
        config_files : list[str]
            A set of configuration override files.
        """
        load_config(self.telescope, config_files)
        load_config(self.dome, config_files)
        load_config(self.rotator, config_files)
        load_config(self.camera, config_files)
        load_config(self.filters, config_files)
        load_config(self.slew, config_files)
        load_config(self.optics_loop_corr, config_files)
        load_config(self.park, config_files)
        load_config(self.obs_var, config_files)