Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/metadata/mockdata.py: 0%
16 statements
« prev ^ index » next coverage.py v7.6.5, created at 2024-11-15 02:12 +0000
« prev ^ index » next coverage.py v7.6.5, created at 2024-11-15 02:12 +0000
1import datetime
2from .mockxrfdata import MAP_DATA
4USERS = [
5 {
6 "givenname": "User",
7 "familyname": "Name",
8 "fullname": "User Name",
9 "personid": 1,
10 "login": "abcd",
11 "groups": [],
12 "permissions": [],
13 },
14 {
15 "givenname": "Another",
16 "familyname": "User",
17 "fullname": "Another User",
18 "personid": 2,
19 "login": "efgh",
20 "groups": ["bl_staff"],
21 "permissions": ["bl_staff"],
22 },
23]
25PROPOSALS = [
26 {
27 "proposalid": 1,
28 "proposalcode": "blc",
29 "proposalnumber": "00001",
30 "proposal": "blc00001",
31 },
32]
35today = datetime.date.today()
37SESSIONS = [
38 {
39 "sessionid": 1,
40 "proposalid": 1,
41 "proposal": "blc00001",
42 "visit_number": 1,
43 "session": "blc00001-1",
44 "startdate": datetime.datetime.combine(today, datetime.datetime.min.time()),
45 "enddate": datetime.datetime.combine(today, datetime.datetime.max.time()),
46 },
47]
49COMPONENTS = [
50 {
51 "proposalid": 1,
52 "componentid": 1,
53 "acronym": "comp1",
54 "name": "component 1",
55 "samples": 3,
56 "datacollections": 0,
57 },
58 {
59 "proposalid": 1,
60 "componentid": 2,
61 "acronym": "comp2",
62 "name": "component 2",
63 "samples": 0,
64 "datacollections": 0,
65 },
66]
68SAMPLES = [
69 {
70 "proposalid": 1,
71 "sampleid": 1,
72 "component": "comp1",
73 "componentid": 1,
74 "name": "test1",
75 "offsetx": 0,
76 "offsety": 0,
77 "subsamples": 0,
78 "datacollections": 0,
79 },
80 {
81 "proposalid": 1,
82 "component": "comp1",
83 "componentid": 1,
84 "sampleid": 2,
85 "name": "test2",
86 "offsetx": 100,
87 "offsety": 200,
88 "subsamples": 0,
89 "datacollections": 0,
90 },
91]
93SUBSAMPLES = [
94 {
95 "sampleid": 2,
96 "x": 40,
97 "y": 40,
98 "x2": 14640,
99 "y2": 17040,
100 "type": "roi",
101 "subsampleid": 1,
102 "datacollections": 1,
103 "positions": {"z": 4},
104 },
105 {
106 "sampleid": 2,
107 "x": 120,
108 "y": 200,
109 "type": "poi",
110 "subsampleid": 2,
111 "datacollections": 0,
112 "positions": {},
113 },
114 {
115 "sampleid": 2,
116 "x": 40000,
117 "y": 40000,
118 "x2": 40071,
119 "y2": 40071,
120 "type": "roi",
121 "subsampleid": 3,
122 "datacollections": 1,
123 "positions": {"z": 3},
124 },
125 {
126 "sampleid": 2,
127 "x": 600,
128 "y": 600,
129 "type": "poi",
130 "subsampleid": 4,
131 "datacollections": 1,
132 "positions": {},
133 },
134 {
135 "sampleid": 1,
136 "x": 40000,
137 "y": 50000,
138 "x2": 54600,
139 "y2": 60000,
140 "type": "roi",
141 "subsampleid": 5,
142 "datacollections": 0,
143 "positions": {},
144 },
145 {
146 "sampleid": 1,
147 "x": 1000,
148 "y": 2000,
149 "type": "poi",
150 "subsampleid": 6,
151 "datacollections": 0,
152 "positions": {"z": 2.5},
153 },
154]
156SAMPLEIMAGES = [
157 {
158 "sampleid": 2,
159 "sampleimageid": 1,
160 "name": "mos1",
161 "file": "xtal.png",
162 "scalex": 100,
163 "scaley": 100,
164 "rotation": -25,
165 "offsetx": -102400,
166 "offsety": -76800,
167 },
168 {
169 "sampleid": 2,
170 "sampleimageid": 2,
171 "name": "mos2",
172 "file": "xtal.png",
173 "scalex": 50,
174 "scaley": 51,
175 "offsetx": 102200,
176 "offsety": 200,
177 },
178]
180SAMPLEACTIONS = []
182DATACOLLECTIONS = [
183 {
184 "datacollectionid": 1,
185 "sessionid": 1,
186 "sampleid": 2,
187 "subsampleid": 1,
188 "starttime": datetime.datetime.now() - datetime.timedelta(seconds=600),
189 "endtime": datetime.datetime.now() - datetime.timedelta(seconds=400),
190 "experimenttype": "XRF map",
191 "runstatus": "Successful",
192 "datacollectionnumber": 2,
193 "snapshots": {1: False, 2: False, 3: False, 4: False},
194 }
195]
197DATACOLLECTIONATTACHMENTS = []
200# XRF
201XRF_MAPS = [
202 {
203 "sampleid": 2,
204 "mapid": 1,
205 "subsampleid": 3,
206 "datacollectionid": 1,
207 "maproiid": 2,
208 "element": "Cu",
209 "w": 71,
210 "h": 71,
211 "snaked": True,
212 "data": MAP_DATA[1],
213 "opacity": 1,
214 "url": "/metadata/xrf/maps/1",
215 },
216 {
217 "sampleid": 2,
218 "mapid": 2,
219 "subsampleid": 1,
220 "datacollectionid": 1,
221 "maproiid": 2,
222 "element": "Cu",
223 "edge": "Ka1",
224 "w": 102,
225 "h": 119,
226 "snaked": False,
227 "data": MAP_DATA[2],
228 "opacity": 1,
229 "composites": 1,
230 "url": "/metadata/xrf/maps/2",
231 },
232 {
233 "sampleid": 2,
234 "mapid": 3,
235 "subsampleid": 1,
236 "datacollectionid": 1,
237 "maproiid": 3,
238 "element": "Ni",
239 "edge": "Ka1",
240 "w": 102,
241 "h": 119,
242 "snaked": False,
243 "data": MAP_DATA[3],
244 "opacity": 1,
245 "composites": 1,
246 "url": "/metadata/xrf/maps/3",
247 },
248 {
249 "sampleid": 2,
250 "mapid": 4,
251 "subsampleid": 1,
252 "datacollectionid": 1,
253 "maproiid": 1,
254 "element": "Fe",
255 "edge": "Ka1",
256 "w": 102,
257 "h": 119,
258 "snaked": True,
259 "data": MAP_DATA[0],
260 "opacity": 0.7,
261 "composites": 1,
262 "url": "/metadata/xrf/maps/4",
263 },
264]
266XRF_MAP_ROIS = [
267 {
268 "maproiid": 1,
269 "element": "Fe",
270 "edge": "Ka1",
271 "start": 6200,
272 "end": 6600,
273 "maps": 1,
274 }
275]
277XRF_COMPOSITES = [
278 {
279 "compositeid": 1,
280 "sampleid": 2,
281 "subsampleid": 1,
282 "r": 2,
283 "rroi": "Cu",
284 "g": 3,
285 "groi": "Ni",
286 "b": 4,
287 "broi": "Fe",
288 "ropacity": 1,
289 "gopacity": 1,
290 "bopacity": 1,
291 "opacity": 1,
292 "url": "/metadata/xrf/maps/composite/1",
293 }
294]