In [27]:
import matplotlib
matplotlib.use('nbagg')
from zernike import ZernikeVector
import astropy.units as u
import numpy as np
In [2]:
z = ZernikeVector(Z4=100.0)
In [3]:
z.array
Out[3]:
In [4]:
z['Z55'] = 100.0
In [5]:
z['Z5'] = 1000.0
z['Z6'] = 100
z['Z12'] = 55
In [6]:
z.coeffs
Out[6]:
In [7]:
z.denormalize()
print(z)
In [8]:
z.units = u.nm
z
Out[8]:
In [9]:
z.denormalize()
z.norm_array
Out[9]:
In [10]:
for c in z:
print(c, z[c])
In [11]:
'Z04' in z
Out[11]:
In [12]:
z.denormalize()
z.ignore('Z05')
z.units = u.nm
z.plot_map()
z.peak2valley
Out[12]:
In [13]:
z.restore('Z05')
z.plot_map()
z.rms
Out[13]:
In [14]:
z.plot_surface()
In [15]:
b = z.phase_map()
In [16]:
b[4].max()
Out[16]:
In [17]:
z
Out[17]:
In [18]:
ref = ZernikeVector(Z04=-500, Z20=20)
In [19]:
ref
Out[19]:
In [20]:
z + ref
Out[20]:
In [21]:
new = ref - z
new
Out[21]:
In [22]:
new * 5
Out[22]:
In [23]:
5/ new
Out[23]:
In [33]:
new * 2
Out[33]:
In [ ]:
2 + new
In [ ]:
set(z.keys() & ref.keys())
In [ ]:
for k in sorted(z.keys()):
print(k)
In [ ]:
(1.0 * u.nm / (1. * u.mm).to(u.nm)).value
In [ ]:
u.di