Esempio n. 1
0
    def compute(self):

        in_dataset = self.getInputFromPort('cod_dataset')

        command = "${CWSL_CTOOLS}/sdm/sdmrun.py"

        sdm_config = configuration.cwsl_ctools_path + "/sdm/default.cfg"
        positional_args = [("dxt-gridded", 0, "raw"),
                           ("-c " + sdm_config, 0, "raw")]

        # The data is written out to the default
        # location.
        output_pattern = os.path.join(
            configuration.user_basepath,
            FileCreator.default_pattern(in_dataset.constraints) + ".nc")
        this_process = ProcessUnit([in_dataset],
                                   output_pattern,
                                   command,
                                   in_dataset.constraints,
                                   execution_options=self._required_modules,
                                   positional_args=positional_args)

        this_process.execute(simulate=configuration.simulate_execution)
        process_output = this_process.file_creator

        self.setResult('out_dataset', process_output)
Esempio n. 2
0
    def compute(self):

        in_dataset = self.getInputFromPort('cod_dataset')

        command = "${CWSL_CTOOLS}/sdm/sdmrun.py"

        sdm_config = configuration.cwsl_ctools_path + "/sdm/default.cfg"
        positional_args = [("dxt-gridded", 0, "raw"),
                           ("-c " + sdm_config, 0, "raw")]
        
        # The data is written out to the default
        # location.
        output_pattern = os.path.join(configuration.user_basepath,
                                      FileCreator.default_pattern(in_dataset.constraints) + ".nc")
        this_process = ProcessUnit([in_dataset],
                                   output_pattern,
                                   command,
                                   in_dataset.constraints,
                                   execution_options=self._required_modules,
                                   positional_args=positional_args)

        this_process.execute(simulate=configuration.simulate_execution)
        process_output = this_process.file_creator

        self.setResult('out_dataset', process_output)
Esempio n. 3
0
    def compute(self):

        in_dataset = self.getInputFromPort('cod_dataset')

        command = "echo This is the command to run."
        
        # The data is written out to the default
        # location.
        output_pattern = FileCreator.default_pattern(in_dataset.constraints, temp=True)
        this_process = ProcessUnit([in_dataset],
                                   output_pattern,
                                   command,
                                   in_dataset.constraints,
                                   execution_options=self._required_modules)

        this_process.execute(simulate=configuration.simulate_execution)
        process_output = this_process.file_creator

        self.setResult('out_dataset', process_output)
Esempio n. 4
0
    def compute(self):

        in_dataset = self.getInputFromPort('in_dataset')
        x_value = self.getInputFromPort('x_value')
        y_value = self.getInputFromPort('y_value')

        command = "echo"
        
        # The data is written out to the default location.
        output_pattern = FileCreator.default_pattern(in_dataset.constraints, temp=True) + ".json"
        this_process = ProcessUnit([in_dataset], output_pattern,
                                   command, in_dataset.constraints,
                                   execution_options=self._required_modules,
                                   positional_args=[(x_value, 1, 'raw'), (y_value, 2, 'raw')])

        this_process.execute(simulate=configuration.simulate_execution)
        process_output = this_process.file_creator

        self.setResult('out_dataset', process_output)
Esempio n. 5
0
    def compute(self):

        in_dataset = self.getInputFromPort('cod_dataset')

        command = "echo This is the command to run."

        # The data is written out to the default
        # location.
        output_pattern = FileCreator.default_pattern(in_dataset.constraints,
                                                     temp=True)
        this_process = ProcessUnit([in_dataset],
                                   output_pattern,
                                   command,
                                   in_dataset.constraints,
                                   execution_options=self._required_modules)

        this_process.execute(simulate=configuration.simulate_execution)
        process_output = this_process.file_creator

        self.setResult('out_dataset', process_output)
Esempio n. 6
0
    def compute(self):

        in_dataset = self.getInputFromPort('in_dataset')
        x_value = self.getInputFromPort('x_value')
        y_value = self.getInputFromPort('y_value')

        command = "echo"

        # The data is written out to the default location.
        output_pattern = FileCreator.default_pattern(in_dataset.constraints,
                                                     temp=True) + ".json"
        this_process = ProcessUnit([in_dataset],
                                   output_pattern,
                                   command,
                                   in_dataset.constraints,
                                   execution_options=self._required_modules,
                                   positional_args=[(x_value, 1, 'raw'),
                                                    (y_value, 2, 'raw')])

        this_process.execute(simulate=configuration.simulate_execution)
        process_output = this_process.file_creator

        self.setResult('out_dataset', process_output)