Ejemplo n.º 1
0
 def testYamlSyntaxOfDefinitionFiles(self):
     def_files = ["mission_def.yaml", "auxdata_def.yaml"]
     for def_file in def_files:
         filename = os.path.join(USER_CONFIG_PATH, def_file)
         self.assertIsInstance(get_yaml_config(filename),
                               TreeDict,
                               msg=def_file)
Ejemplo n.º 2
0
 def _init_from_output_def(self, output_def):
     """ Adds the information for the output def yaml files (either
     full filename or treedict structure) """
     if os.path.isfile(output_def):
         try:
             self._output_def = get_yaml_config(output_def)
         except Exception, msg:
             self.error.add_error("outputdef-parser-error", msg)
             self.error.raise_on_error()
Ejemplo n.º 3
0
 def set_from_griddef_file(self, filename):
     """ Initialize the object with a grid definition (.yaml) file.
     Examples can be found in pysiral/settings/griddef """
     config = get_yaml_config(filename)
     for key in self._metadata.keys():
         try:
             self._metadata[key] = config[key]
         except KeyError:
             continue
     self.set_projection(**config.projection)
     self.set_extent(**config.extent)
Ejemplo n.º 4
0
 def _init_from_output_def(self, output_def):
     """ Adds the information for the output def yaml files (either
     full filename or treedict structure) """
     if Path(output_def).is_file():
         try:
             self._output_def = get_yaml_config(output_def)
         except Exception as ex:
             self.error.add_error("outputdef-parser-error", ex)
             self.error.raise_on_error()
     else:
         self._output_def = output_def
     self._validate_outputdef()
Ejemplo n.º 5
0
    def set_l1p_processor_def(self, l1p_settings_id_or_file):
        """ Parse the content of the processor definition file """

        # 1. Resolve the absolute file path
        procdef_file_path = self.get_l1p_proc_def_filename(
            l1p_settings_id_or_file)

        # 2. Read the content
        logger.info("Parsing L1P processor definition file: %s" %
                    procdef_file_path)
        self._l1pprocdef = get_yaml_config(procdef_file_path)
        self._check_if_unambiguous_platform()

        # 3. Expand info (input data lookup directories)
        self._get_local_input_directory()

        # 4. update hemisphere for input adapter
        self._l1pprocdef.level1_preprocessor.options.polar_ocean.target_hemisphere = self.target_hemisphere
Ejemplo n.º 6
0
 def testYamlSyntaxOfDefinitionFiles(self):
     for filename in self.l3_output_files:
         content = get_yaml_config(filename)
         self.assertIsInstance(content, AttrDict, msg=filename)
Ejemplo n.º 7
0
 def _parse_l2_settings(self):
     try:
         self._l2def = get_yaml_config(self._l2_settings_file)
     except Exception as ex:
         self.error.add_error("invalid-l2-settings", str(ex))
         self.error.raise_on_error()
Ejemplo n.º 8
0
 def testYamlSyntaxOfDefinitionFiles(self):
     def_files = ["mission_def.yaml", "auxdata_def.yaml"]
     for def_file in def_files:
         filename = psrlcfg.config_path / def_file
         content = get_yaml_config(filename)
         self.assertIsInstance(content, AttrDict, msg=def_file)