1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 """The relax_fit user function definitions."""
25
26
27 from generic_fns import spectrum
28 from graphics import WIZARD_IMAGE_PATH
29 from specific_fns.setup import relax_fit_obj
30 from user_functions.data import Uf_info; uf_info = Uf_info()
31 from user_functions.objects import Desc_container
32
33
34
35 uf_class = uf_info.add_class('relax_fit')
36 uf_class.title = "Class for relaxation curve fitting."
37 uf_class.menu_text = "&relax_fit"
38 uf_class.gui_icon = "relax.relax_fit"
39
40
41
42 uf = uf_info.add_uf('relax_fit.relax_time')
43 uf.title = "Set the relaxation delay time associated with each spectrum."
44 uf.title_short = "Relaxation delay time setting."
45 uf.add_keyarg(
46 name = "time",
47 default = 0.0,
48 py_type = "num",
49 desc_short = "relaxation time",
50 desc = "The time, in seconds, of the relaxation period."
51 )
52 uf.add_keyarg(
53 name = "spectrum_id",
54 py_type = "str",
55 desc_short = "spectrum identification string",
56 desc = "The spectrum identification string.",
57 wiz_element_type = 'combo',
58 wiz_combo_iter = spectrum.get_ids,
59 wiz_read_only = True
60 )
61
62 uf.desc.append(Desc_container())
63 uf.desc[-1].add_paragraph("Peak intensities should be loaded before calling this user function via the spectrum.read_intensities user function. The intensity values will then be associated with a spectrum identifier. To associate each spectrum identifier with a time point in the relaxation curve prior to optimisation, this user function should be called.")
64 uf.backend = relax_fit_obj._relax_time
65 uf.menu_text = "&relax_time"
66 uf.gui_icon = "oxygen.actions.chronometer"
67 uf.wizard_size = (700, 500)
68
69
70
71 uf = uf_info.add_uf('relax_fit.select_model')
72 uf.title = "Select the relaxation curve type."
73 uf.title_short = "Relaxation curve type selection."
74 uf.display = True
75 uf.add_keyarg(
76 name = "model",
77 default = "exp",
78 py_type = "str",
79 desc_short = "model",
80 desc = "The type of relaxation curve to fit.",
81 wiz_element_type = "combo",
82 wiz_combo_choices = [
83 "exp: [Rx, I0]",
84 "inv: [Rx, I0, Iinf]"
85 ],
86 wiz_combo_data = [
87 "exp",
88 "inv"
89 ],
90 wiz_read_only = True
91 )
92
93 uf.desc.append(Desc_container())
94 uf.desc[-1].add_paragraph("The supported relaxation experiments include the default two parameter exponential fit, selected by setting the model type to 'exp', and the three parameter inversion recovery experiment in which the peak intensity limit is a non-zero value, selected by setting the model to 'inv'.")
95 uf.desc[-1].add_paragraph("The parameters of these two models are")
96 uf.desc[-1].add_item_list_element("'exp'", "[Rx, I0],")
97 uf.desc[-1].add_item_list_element("'inv'", "[Rx, I0, Iinf].")
98 uf.backend = relax_fit_obj._select_model
99 uf.menu_text = "&select_model"
100 uf.gui_icon = "oxygen.actions.list-add"
101 uf.wizard_height_desc = 300
102 uf.wizard_size = (800, 500)
103 uf.wizard_apply_button = False
104