Exemplo n.º 1
0
    def l3_output_file(self):
        """
        Get the full output definition file path. Multiple output filenames are possible if
        the command line argument is semicolon-separated list.
        :return: A list of output definition filenames
        """

        filenames = []
        for l3_output in self._args.l3_output.split(";"):
            filename = psrlcfg.get_settings_file("output", "l3", l3_output)
            if filename is None:
                msg = "Invalid output definition filename or id: %s\n" % l3_output
                msg = msg + "    Recognized output definition ids:\n"
                for output_id in psrlcfg.get_setting_ids("output", "l3"):
                    msg = msg + "    - " + output_id + "\n"
                self.error.add_error("invalid-outputdef", msg)
            else:
                filenames.append(filename)

        if len(filenames) == 0:
            msg = "No valid output definition file found for argument: %s"
            msg = msg % (str(self._args.l3_output))
            self.error.add_error("invalid-outputdef", msg)
            self.error.raise_on_error()

        return filenames
Exemplo n.º 2
0
    def setUp(self):

        # Get a list of processor definition files in the code repository
        l2proc_ids = psrlcfg.get_setting_ids("proc", "l2")
        self.l2procdef_files = [
            psrlcfg.get_settings_file("proc", "l2", l2proc_id)
            for l2proc_id in l2proc_ids
        ]
Exemplo n.º 3
0
 def l3_griddef(self):
     l3_griddef = self._args.l3_griddef
     filename = psrlcfg.get_settings_file("grid", None, l3_griddef)
     if filename is None:
         msg = "Invalid griddef filename or id: %s\n" % l3_griddef
         msg = msg + "    Recognized grid definition ids:\n"
         for griddef_id in psrlcfg.get_setting_ids("grid"):
             msg = msg + "    - " + griddef_id + "\n"
         self.error.add_error("invalid-griddef", msg)
         self.error.raise_on_error()
     else:
         return filename
Exemplo n.º 4
0
 def l3_settings_file(self):
     l3_settings = self._args.l3_settings
     filename = psrlcfg.get_settings_file("proc", "l3", l3_settings)
     if filename is None:
         msg = "Invalid l3 settings filename or id: %s\n" % l3_settings
         msg = msg + " \nRecognized Level-3 processor setting ids:\n"
         for l3_settings_id in psrlcfg.get_setting_ids("proc", "l3"):
             msg = msg + "  " + l3_settings_id + "\n"
         self.error.add_error("invalid-l3-settings", msg)
         self.error.raise_on_error()
     else:
         return filename
Exemplo n.º 5
0
 def l2p_output(self):
     l2p_output = self._args.l2p_output
     filename = psrlcfg.get_settings_file("output", "l2p", l2p_output)
     if filename is None:
         msg = "Invalid l2p outputdef filename or id: %s\n" % l2p_output
         msg = msg + " \nRecognized Level-2 output definitions ids:\n"
         l2p_output_ids = psrlcfg.get_setting_ids("output", "l2p")
         for l2p_output_id in l2p_output_ids:
             msg = msg + "    - " + l2p_output_id + "\n"
         self.error.add_error("invalid-l2p-outputdef", msg)
         self.error.raise_on_error()
     else:
         return filename