Add script to plot gamma graphs>
[dcpomatic.git] / hacks / gamma_graphs.py
1 #!/usr/bin/python
2
3 import matplotlib.pyplot as plt
4 import numpy as np
5
6 x = np.logspace(-3, 0, 100)
7
8 plt.loglog(x, pow(x, 2.2))
9 plt.loglog(x, pow(x, 2.4))
10
11 linearised = []
12 for xx in x:
13     if xx > 0.04045:
14         linearised.append(pow((xx + 0.055) / 1.055, 2.4))
15     else:
16         linearised.append(xx / 12.92)
17
18 plt.loglog(x, linearised)
19 plt.show()