forked from RomanHargrave/displaycal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathargyll_instruments.py
598 lines (591 loc) · 13 KB
/
argyll_instruments.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
# -*- coding: utf-8 -*-
from itertools import izip
import re
from util_str import strtr
instruments = {
# instrument names from Argyll source spectro/insttypes.c
#
# vid: USB Vendor ID
#
# pid: USB Product ID
#
# hid: Is the device a USB HID (Human Interface Device) class device?
#
# spectral: Does the instrument support spectral readings?
#
# adaptive_mode: Does the instrument support adaptive emissive readings?
#
# highres_mode: Does the instrument support high-res spectral readings?
#
# projector_mode: Does the instrument support a special projector mode?
#
# sensor_cal: Does the instrument need to calibrate its sensor by putting
# it on a reference tile or black surface?
# A value of False for sensor_cal means the instrument can be
# left on the display
# A value of True for sensor_cal means the instrument must be
# removed from the display for sensor calibration if it cannot
# be skipped
#
# skip_sensor_cal: Can the sensor calibration be skipped?
#
# integration_time: Approx. integration time (seconds) for black and white,
# based on measurements on wide-gamut IPS display with
# 0.23 cd/m2 black and 130 cd/m2 white level, rounded to
# multiple of .1 seconds.
# Instruments which I don't own have been estimated.
#
# refresh: Can the instrument do refresh rate measurements?
#
# spectral_cal: Does the instrument support spectral sample (CCSS)
# calibration?
#
# A missing key, or a value of None, means unknown/not tested
#
# Instruments can have an id (short string) that is different than the
# long instrument name. In case no id is given, the instrument name is
# the same as the id.
"DTP92": {
"usb_ids": [
{
"vid": 0x0765,
"pid": 0xD092,
"hid": False
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"refresh": True
},
"DTP94": {
"usb_ids": [
{
"vid": 0x0765,
"pid": 0xD094,
"hid": False
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": False,
"skip_sensor_cal": False, # DTP94 instrument access fails
# when using -N option to skip automatic sensor calibration
# (dispread -D9 output: "Setting no-sensor_calibrate failed
# failed with 'Unsupported function'")
"integration_time": [4.0, 1.1], # Estimated
"refresh": True
},
"Spectrolino": {
"spectral": True,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": True,
"skip_sensor_cal": True
},
"SpectroScan": {
"spectral": True,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": True,
"skip_sensor_cal": True
},
"SpectroScanT": {
"spectral": True,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": True,
"skip_sensor_cal": True
},
"Spectrocam": {
"spectral": True,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": True,
"skip_sensor_cal": None
},
"i1 Display": { # Argyll 1.3.5 and earlier
"usb_ids": [
{
"vid": 0x0670,
"pid": 0x0001,
"hid": False
}
],
"id": "i1D1",
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": False,
"skip_sensor_cal": False,
"integration_time": [4.0, 1.0], # Using i1D2 values
"refresh": True
},
"i1 Display 1": { # Argyll 1.3.6 and newer
"usb_ids": [
{
"vid": 0x0670,
"pid": 0x0001,
"hid": False
}
],
"id": "i1D1",
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": True,
"skip_sensor_cal": False,
"integration_time": [4.0, 1.0], # Using i1D2 values
"refresh": True
},
"i1 Display 2": { # Argyll 1.3.6 and newer
"usb_ids": [
{
"vid": 0x0971,
"pid": 0x2003,
"hid": False
}
],
"id": "i1D2",
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": False,
"skip_sensor_cal": False, # i1 Display 2 instrument access fails
# when using -N option to skip automatic sensor calibration
# (dispread -D9 output: "Setting no-sensor_calibrate failed
# failed with 'Unsupported function'")
"integration_time": [4.0, 1.0], # Measured
"refresh": True
},
"i1 DisplayPro, ColorMunki Display": {
"usb_ids": [
{
"vid": 0x0765,
"pid": 0x5020,
"hid": True
}
],
"id": "i1D3",
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": False,
"skip_sensor_cal": False,
"measurement_mode_map": {"c": "r", "l": "n"},
"integration_time": [2.6, 0.2], # Measured
"refresh": True,
"spectral_cal": True
},
"i1 Monitor": { # like i1Pro
"usb_ids": [
{
"vid": 0x0971,
"pid": 0x2001,
"hid": False
}
],
"spectral": True,
"adaptive_mode": True,
"highres_mode": True,
"projector_mode": False,
"sensor_cal": True,
"skip_sensor_cal": True,
"integration_time": [9.2, 3.9], # Using i1 Pro values
"refresh": True
},
"i1 Pro": {
"usb_ids": [
{
"vid": 0x0971,
"pid": 0x2000,
"hid": False
}
],
"spectral": True,
"adaptive_mode": True,
"highres_mode": True,
"projector_mode": False,
"sensor_cal": True,
"skip_sensor_cal": True,
"integration_time": [9.2, 3.9], # Measured (i1 Pro Rev. A)
"refresh": True
},
"i1 Pro 2": {
"usb_ids": [
{
"vid": 0x0971,
"pid": 0x2000,
"hid": False
}
],
"spectral": True,
"adaptive_mode": True,
"highres_mode": True,
"projector_mode": False,
"sensor_cal": True,
"skip_sensor_cal": True,
"integration_time": [9.2, 3.9], # Using i1 Pro values
"refresh": True
},
"ColorHug": {
"usb_ids": [
{
"vid": 0x04D8,
"pid": 0xF8DA,
"hid": True
},
{
"vid": 0x273F,
"pid": 0x1001,
"hid": True
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"integration_time": [1.8, 0.8], # Measured (ColorHug #660)
"refresh": True
},
"ColorHug2": {
"usb_ids": [
{
"vid": 0x273F,
"pid": 0x1004,
"hid": True
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"integration_time": [2.0, 0.6], # Measured (ColorHug2 prototype #2)
"refresh": True
},
"ColorMunki": {
"usb_ids": [
{
"vid": 0x0971,
"pid": 0x2007,
"hid": False
},
{ # ColorMunki i1Studio
"vid": 0x0765,
"pid": 0x6008,
"hid": False
}
],
"spectral": True,
"adaptive_mode": True,
"highres_mode": True,
"projector_mode": True,
"sensor_cal": True,
"skip_sensor_cal": True,
"integration_time": [9.2, 3.9], # Using i1 Pro values
"refresh": True
},
"Colorimtre HCFR": {
"usb_ids": [
{ # V3.1
"vid": 0x04DB,
"pid": 0x005B,
"hid": False
},
{ # V4.0
"vid": 0x04D8,
"pid": 0xFE17,
"hid": False
}
],
"id": "HCFR",
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None
},
"ColorMunki Smile": { # Argyll 1.5.x and newer
"usb_ids": [
{
"vid": 0x0765,
"pid": 0x6003,
"hid": False
}
],
"id": "Smile",
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": False,
"skip_sensor_cal": False,
"integration_time": [4.0, 1.0] # Using i1D2 values
},
"EX1": {
"usb_ids": [
{
"vid": 0x2457,
"pid": 0x4000,
"hid": False
}
],
"spectral": True,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": True,
"skip_sensor_cal": True,
"integration_time": [9.2, 3.9] # Using i1 Pro values
},
"K-10": {
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"integration_time": [1.1, 0.1], # Using i1D3 values halved
"refresh": True
},
"Spyder1": {
"usb_ids": [
{
"vid": 0x085C,
"pid": 0x0100,
"hid": False
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"integration_time": [10.5, 2.3] # Using Spyder3 values
},
"Spyder2": {
"usb_ids": [
{
"vid": 0x085C,
"pid": 0x0200,
"hid": False
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"integration_time": [10.5, 2.3], # Using Spyder3 values
"refresh": True
},
"Spyder3": {
"usb_ids": [
{
"vid": 0x085C,
"pid": 0x0300,
"hid": False
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"measurement_mode_map": {"c": "r", "l": "n"},
"integration_time": [10.5, 2.3], # Estimated
"refresh": True
},
"Spyder4": {
"usb_ids": [
{
"vid": 0x085C,
"pid": 0x0400,
"hid": False
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"measurement_mode_map": {"c": "r", "l": "n"},
"integration_time": [10.5, 2.3], # Using Spyder3 values
"refresh": True,
"spectral_cal": True
},
"Spyder5": {
"usb_ids": [
{
"vid": 0x085C,
"pid": 0x0500,
"hid": False
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"measurement_mode_map": {"c": "r", "l": "n"},
"integration_time": [10.5, 2.3], # Using Spyder3 values
"refresh": True,
"spectral_cal": True
},
"SpyderX": {
"usb_ids": [
{
"vid": 0x085C,
"pid": 0x0A00,
"hid": False
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": True,
"skip_sensor_cal": True, # Not yet officially, but likely supported in future
"integration_time": [1.6, 1.6],
"refresh": False
},
"Huey": {
"usb_ids": [
{
"vid": 0x0971,
"pid": 0x2005,
"hid": True
},
{ # HueyL
"vid": 0x0765,
"pid": 0x5001,
"hid": True
},
{ # HueyL
"vid": 0x0765,
"pid": 0x5010,
"hid": True
}
],
"spectral": False,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"integration_time": [4.0, 1.0] # Using i1D2 values
},
"specbos": {
"spectral": True,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"measurement_mode_map": {"c": "r", "l": "n"},
"integration_time": [3.3, 0.8], # Estimated, VERY rough
"refresh": True
},
"specbos 1201": {
"spectral": True,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"integration_time": [10.3, 2.8], # Estimated, VERY rough
"refresh": True
},
"spectraval": {
"spectral": True,
"adaptive_mode": False,
"highres_mode": False,
"projector_mode": False,
"sensor_cal": None,
"skip_sensor_cal": None,
"integration_time": [3.3, 0.8], # Estimated, VERY rough
"refresh": True
},
"Dummy Meter / Hires & Projector": {
# dummy instrument, just for testing
"spectral": False,
"adaptive_mode": False,
"highres_mode": True,
"projector_mode": True,
"sensor_cal": False,
"skip_sensor_cal": False
},
"Dummy Spectro / Hires & Projector": {
# dummy instrument, just for testing
"spectral": True,
"adaptive_mode": False,
"highres_mode": True,
"projector_mode": True,
"sensor_cal": True,
"skip_sensor_cal": True
},
"Dummy Meter / Adaptive, Hires & Projector": {
# dummy instrument, just for testing
"spectral": False,
"adaptive_mode": True,
"highres_mode": True,
"projector_mode": True,
"sensor_cal": False,
"skip_sensor_cal": False
},
"Dummy Spectro / Adaptive, Hires & Projector": {
# dummy instrument, just for testing
"spectral": True,
"adaptive_mode": True,
"highres_mode": True,
"projector_mode": True,
"sensor_cal": True,
"skip_sensor_cal": True
}
}
vendors = [
"ColorVision",
"Datacolor",
"GretagMacbeth",
"Hughski",
"Image Engineering",
"JETI",
"Klein",
"X-Rite",
"Xrite"
]
def get_canonical_instrument_name(instrument_name, replacements=None,
inverse=False):
replacements = replacements or {}
if inverse:
replacements = dict(izip(replacements.itervalues(),
replacements.iterkeys()))
return strtr(remove_vendor_names(instrument_name), replacements)
def remove_vendor_names(txt):
for vendor in vendors:
txt = re.sub(re.compile(re.escape(vendor) + r"\s*", re.I), "", txt)
txt = txt.strip()
return txt