-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuntitled0.py
More file actions
43 lines (35 loc) · 957 Bytes
/
untitled0.py
File metadata and controls
43 lines (35 loc) · 957 Bytes
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
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 25 14:04:23 2022
@author: SimenLab
Taken from Thomas Euler's QDSpy package
"""
import numpy as np
def generateLinearLUT ():
# Return a linear LUT (see setGammaLUT for details)
#
tempLUT = []
for j in range(3):
temp = list(range(256))
temp = [float(v)/255.0 for v in temp]
tempLUT.append(temp)
newLUT = np.array(tempLUT)
newLUT = (255*newLUT).astype(np.uint16)
newLUT.byteswap(True)
return newLUT
def generateInverseLUT ():
# ... for testing purposes
#
tempLUT = []
for j in range(3):
temp = list(range(255,-1,-1))
temp =[float(v)/255.0 for v in temp]
tempLUT.append(temp)
newLUT = np.array(tempLUT)
newLUT = (255*newLUT).astype(np.uint16)
newLUT.byteswap(True)
return newLUT
a = generateLinearLUT()
b = generateInverseLUT()
b = b.T
np.savetxt(r"C:\Users\SimenLab\OneDrive - University of Sussex\Desktop\fff.txt", b, fmt = '%.0f', delimiter = ',')