示例#1
0
 def _create_directory(self, directory):
     """ Convinience method to create a directory and add an error
     when failed """
     status = validate_directory(directory)
     if not status:
         msg = "Unable to create directory: %s" % str(directory)
         self.error.add_error("directory-error", msg)
示例#2
0
    def export_to_netcdf(self, l1):
        """
        Workflow to export a Level-1 object to l1p netCDF product. The workflow includes the generation of the
        output path (if applicable).
        :param l1: The Level-1 object to be exported
        :return: None
        """

        # Get filename and path
        self.set_output_filepath(l1)

        # Check if path exists
        validate_directory(self.path)

        # Export the data object
        ncfile = L1bDataNC()
        ncfile.l1b = l1
        ncfile.output_folder = self.path
        ncfile.filename = self.filename
        ncfile.export()
示例#3
0
 def create(self):
     validate_directory(self.path)