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