コード例 #1
0
ファイル: XAS.py プロジェクト: AlistairChild/Percolate
    def __init__(self):

        super().__init__("XAS spectra")

        # inputs

        self.a_p_norm = StreamInput(self, "a_p_norm")
        self.a_a_norm = StreamInput(self, "a_a_norm")
        # parameter inputs
        self.fit = choice_input(
            self,
            "fit",
            "Do Nothing!!",
            [
                "linear", "polynomial", "exp decay", "2 point linear",
                "Do Nothing!!"
            ],
        )
        self.background_start = int_input(self, "p_start_xas", self.a_p_norm,
                                          770)
        self.background_stop = int_input(self, "p_stop_xas", self.a_p_norm,
                                         805)
        # outputs
        self.xas = ArrayOutput(self, "xas", self.read_xas)
        self.xas_bg = ArrayOutput(self, "xas_bg", self.read_xas_bg)
        self.xas_integral = ArrayOutput(self, "xas_integral",
                                        self.read_xas_integral)
コード例 #2
0
    def __init__(self):

        super().__init__("step_subtraction")

        # Input Ports
        self.a_p_norm = StreamInput(self, "a_p_norm")
        self.a_a_norm = StreamInput(self, "a_a_norm")

        self.apply_step = choice_input(self, "Apply", "off", ["off", "on"])
        self.fit_type = choice_input(self, "fit_type", "Alpha",
                                     ["Alpha", "Beta"])
        self.fit_function = choice_input(self, "fit_function", "Voight",
                                         ["Voight", "Arctan"])
        self.step_start = int_input(self, "step_start", self.a_p_norm, None)
        self.step_intermediate = int_input(self, "step_intermediate",
                                           self.a_p_norm, None)
        self.step_stop = int_input(self, "step_stop", self.a_p_norm, None)

        # output ports
        self.a_a_stepfunction = ArrayOutput(self, "a_a_stepfunction",
                                            self.read_a_a_stepfunction)
        self.a_p_stepfunction = ArrayOutput(self, "a_p_stepfunction",
                                            self.read_a_p_stepfunction)
        self.a_a_step_subtracted = ArrayOutput(self, "a_a_step_subtracted",
                                               self.read_a_a_step_subtracted)
        self.a_p_step_subtracted = ArrayOutput(self, "a_p_step_subtracted",
                                               self.read_a_p_step_subtracted)
コード例 #3
0
ファイル: area.py プロジェクト: AlistairChild/Percolate
    def __init__(self):

        super().__init__("area")

        # input ports
        self.input = StreamInput(self, "inputarray")

        # int_input takes arguments (fn, name, input_stream)
        # The input_stream allows for limits to be calculated for GUI sliders.

        self.start = int_input(self, "start", self.input, 770)
        self.mid = int_input(self, "mid", self.input, 790)
        self.end = int_input(self, "end", self.input, 800)
        #

        self.value = TextOutput(self, "value", self.read_value)
        self.graph = ArrayOutput(self, "graph", self.read_graph)
コード例 #4
0
    def __init__(self):

        super().__init__("step_subtraction")

        # Input Ports
        self.input_array = StreamInput(self, "input_array")

        self.apply_step = choice_input(self, "Apply", "on", ["on", "off"])
        self.fit_function = choice_input(self, "fit_function", "Voight",
                                         ["Voight", "Arctan"])
        self.step_start = int_input(self, "step_start", self.input_array, None)
        self.step_stop = int_input(self, "step_stop", self.input_array, None)
        self.edge = int_input(self, "edge", self.input_array, None)

        # output ports
        self.stepfunction = ArrayOutput(self, "stepfunction",
                                        self.read_stepfunction)
        self.subtracted_step = ArrayOutput(self, "post_step_a",
                                           self.read_subtracted_step)
コード例 #5
0
    def __init__(self):

        super().__init__("background_subtraction")

        # streamed inputs
        # self.e = StreamInput(self, "e")
        self.input_data = StreamInput(self, "input_data")

        # input.changed += self.on_data
        # parameter inputs

        self.fit = choice_input(
            fn=self,
            name="fit",
            default="No fit",
            choices=[
                "No fit",
                "Polynomial fit inside limits",
                "Polynomial fit outside limits",
                "exp decay (fits for all e < 'Background_start' and e > ' Background_end')",
                "2 point linear (straight line between 2 points)",
            ],
        )
        self.apply_offset = choice_input(
            fn=self,
            name="apply_offset",
            default="off",
            choices=[
                "off",
                "on (shifts post 'Background_end' by amount equal to e = 'Background_end' to e = 'Background_start' )",
            ],
        )
        # self.apply_offset = int_input(self, "apply_offset", 1, 1, 3)
        self.p_start = int_input(self, "Background_start", self.input_data,
                                 None)
        self.p_end = int_input(self, "Background_end", self.input_data, None)
        self.power = free_int_input(self, "power", 1, 1, 3)

        # output ports
        self.background = ArrayOutput(self, "background", self.read_background)
        self.subtracted_background = ArrayOutput(
            self, "subtracted_background", self.read_subtracted_background)
コード例 #6
0
ファイル: FindValue.py プロジェクト: AlistairChild/Percolate
    def __init__(self, name):

        super().__init__(name)

        # input ports
        self.inputarray = StreamInput(self, "inputarray")
        self.lookup = int_input(self, "lookup", self.inputarray, None)

        # output ports
        self.value = TextOutput(self, "value", self.read_value)
        self.graph = ArrayOutput(self, "graph", self.read_graph)
コード例 #7
0
    def __init__(self):

        super().__init__("Identify Peaks")

        # Input Ports
        self.input_array = StreamInput(self, "input_array")

        self.number_of_peaks = free_int_input(self, "number_of_peaks", 1, 2, 10)

        self.center_of_peaks = int_input(
            self, "center_of_peaks", self.input_array, 5990
        )
        self.sigma_of_peaks = int_input(self, "sigma_of_peaks", self.input_array, 30)
        self.height_of_peaks = int_input(
            self, "height_of_peaks", self.input_array, 0.12
        )
        self.type_of_peaks = choice_input(
            self, "GaussianModel", "GaussianModel", ["GaussianModel", "LorentzianModel"]
        )

        # output ports
        self.fitted_peaks = ArrayOutput(self, "fitted_peaks", self.read_fitted_peaks)
コード例 #8
0
    def __init__(self):

        super().__init__("Normalise")

        # streamed inputs

        self.t_p_all = StreamInput(self, "t_p_all")
        self.t_a_all = StreamInput(self, "t_a_all")

        # parameter inputs
        self.action = choice_input(
            self, "Action", "Do not Apply", ["Do not Apply", "Apply"]
        )
        self.normalise_point_1 = int_input(
            self, "normalise_point_1", self.t_p_all, None
        )
        self.normalise_point_2 = int_input(
            self, "normalise_point_2", self.t_p_all, None
        )

        # output ports
        self.a_p_norm = ArrayOutput(self, "a_p_norm", self.read_a_p_norm)
        self.a_a_norm = ArrayOutput(self, "a_a_norm", self.read_a_a_norm)
コード例 #9
0
    def __init__(self):

        super().__init__("step_subtraction")

        # Input Ports
        self.input_array = StreamInput(self, "input_array")

        self.apply_step = choice_input(self, "Apply", "off", ["off", "on"])
        self.fit_function = choice_input(self, "fit_function", "Voight",
                                         ["Voight", "Arctan"])
        self.pre_feature_min = int_input(self, "pre_feature_min",
                                         self.input_array, None)
        self.pre_feature_max = int_input(self, "pre_feature_max",
                                         self.input_array, None)
        self.post_feature_min = int_input(self, "post_feature_min",
                                          self.input_array, None)
        self.post_feature_max = int_input(self, "post_feature_max",
                                          self.input_array, None)

        # output ports
        self.stepfunction = ArrayOutput(self, "stepfunction",
                                        self.read_stepfunction)
        self.subtracted_step = ArrayOutput(self, "subtracted_step",
                                           self.read_subtracted_step)
コード例 #10
0
    def __init__(self):

        super().__init__("Transpose")

        # streamed inputs

        self.spectra = StreamInput(self, "spectra")

        # parameter inputs
        self.action = choice_input(self, "Action", "on", ["off", "on"])
        self.x_value_for_transpose = int_input(self, "x_value_for_transpose",
                                               self.spectra, 771)

        # output ports
        self.transposed_data = ArrayOutput(self, "transposed_data",
                                           self.read_transposed_data)
コード例 #11
0
    def __init__(self):

        super().__init__("background_subtraction")

        # streamed inputs
        # self.e = StreamInput(self, "e")
        self.t_p_all = StreamInput(self, "t_p_all")
        self.t_a_all = StreamInput(self, "t_a_all")
        # parameter inputs

        self.fit = choice_input(
            self,
            "fit",
            "No fit",
            [
                "No fit",
                "Polynomial fit inside limits",
                "Polynomial fit outside limits",
                "exp decay (fits for all e < 'Background_start' and e > ' Background_end')",
                "2 point linear (straight line between 2 points)",
            ],
        )
        self.apply_offset = choice_input(
            self,
            "apply_offset",
            "off",
            [
                "off",
                "on (shifts post 'Background_end' by amount equal to e = 'Background_end' to e = 'Background_start' )",
            ],
        )
        # self.apply_offset = int_input(self, "apply_offset", 1, 1, 3)
        self.p_start = int_input(self, "Background_start", self.t_p_all, None)
        self.p_end = int_input(self, "Background_end", self.t_p_all, None)
        self.power = free_int_input(self, "power", 1, 1, 4)

        # output ports
        self.a_p_background_subtraction = ArrayOutput(
            self, "a_p_background_subtraction",
            self.read_a_p_background_subtraction)
        self.a_a_background_subtraction = ArrayOutput(
            self, "a_a_background_subtraction",
            self.read_a_a_background_subtraction)
        self.a_p_background_subtracted = ArrayOutput(
            self, "a_p_background_subtracted",
            self.read_ia_p_background_subtracted)
        self.a_a_background_subtracted = ArrayOutput(
            self, "a_a_background_subtracted",
            self.read_ia_a_background_subtracted)
        # self.e_out= ArrayOutput(self, "e_out", self.read_e_out)

        # publish ports
        self.inputs = [
            # self.e,
            self.t_p_all,
            self.t_a_all,
            self.fit,
            self.apply_offset,
            self.p_start,
            self.p_end,
            self.power,
        ]

        self.outputs = [
            self.a_p_background_subtraction,
            self.a_a_background_subtraction,
            self.a_p_background_subtracted,
            self.a_a_background_subtracted,
            # self.e_out,
        ]