def check_fields(self):
        self.source_lambda = congruence.checkStrictlyPositiveNumber(self.source_lambda, "Wavelength")

        if self.source_position == 0:
            self.longitudinal_correction = congruence.checkNumber(self.longitudinal_correction, "Longitudinal Correction")
            self.transverse_correction = congruence.checkNumber(self.transverse_correction, "Transverse Correction")
            self.delta_theta = congruence.checkAngle(self.delta_theta, "\u0394" + "Theta")
        else:
            self.theta = congruence.checkAngle(self.theta, "Theta")
Beispiel #2
0
    def check_fields(self):
        self.alpha = congruence.checkAngle(self.alpha, "Incidence Angle")
        self.length = congruence.checkStrictlyPositiveNumber(
            self.length, "Length")

        if self.use_figure_error == 1:
            congruence.checkFileName(self.figure_error_file)

        if self.use_roughness == 1:
            congruence.checkFileName(self.roughness_file)

        if self.calculation_type == 1:
            congruence.checkStrictlyPositiveNumber(self.number_of_points,
                                                   "Number of Points")

        if self.use_multipool == 1:
            congruence.checkStrictlyPositiveNumber(self.n_pools,
                                                   "Nr. Parallel Processes")

            if self.force_cpus == 0:
                if self.number_of_cpus == 1:
                    raise Exception(
                        "Parallel processing not available with 1 CPU")
                elif self.n_pools >= self.number_of_cpus:
                    raise Exception(
                        "Max number of parallel processes allowed on this computer ("
                        + str(self.number_of_cpus) + ")")
Beispiel #3
0
    def check_fields(self):
        self.f1 = congruence.checkStrictlyPositiveNumber(self.f1, "F1")
        self.f2 = congruence.checkStrictlyPositiveNumber(self.f2, "F2")
        self.alpha = congruence.checkAngle(self.alpha, "Incidence Angle")
        self.length = congruence.checkStrictlyPositiveNumber(self.length, "Length")

        if self.use_figure_error == 1:
            congruence.checkFileName(self.figure_error_file)

        if self.use_roughness == 1:
            congruence.checkFileName(self.roughness_file)

        if self.calculation_type == 0: #auto
            self.detector_size = congruence.checkStrictlyPositiveNumber(self.detector_size, "Detector Size")
        else:
            self.number_of_points = congruence.checkStrictlyPositiveNumber(self.number_of_points, "Number of Points")