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