<jupyter_start><jupyter_text>The wavefront can be created by passing a fixed set of amplitudes for different Zernike modes as a list/1D array/dictionary.<jupyter_code># list of amplitudes starting from piston
amp = np.random.uniform(-1,1,4)
f = ZernikeWavefront(amp, order='ansi') 
display(f.zernikes)

print(f.amplitudes_noll)
print(f.amplitudes_ansi)

plt.imshow(f.polynomial(512)); plt.colorbar(); plt.axis('off');
# dictionary of amplitudes
f = ZernikeWavefront({3:0.1, 5:0.1}, order='ansi') 
display(f.zernikes)

print(f.amplitudes_noll)
print(f.amplitudes_ansi)

plt.imshow(f.polynomial(512)); plt.colorbar(); plt.axis('off');<jupyter_output><empty_output><jupyter_text>A random wavefront can be created by giving an absolute amplitude range as an absolute number or a tuple for different Zernike modes<jupyter_code># random wavefront from a list of absolute amplitudes
f = random_zernike_wavefront([1,1,1,1], order='ansi')
display(f.zernikes)

print(f.amplitudes_noll)
print(f.amplitudes_ansi)

plt.imshow(f.polynomial(512)); plt.colorbar(); plt.axis('off');
# random wavefront from a list of amplitude ranges given in a tuple
f = random_zernike_wavefront([(0,0),(-1,1),(1,2)], order='ansi')
display(f.zernikes)

print(f.amplitudes_noll)
print(f.amplitudes_ansi)

plt.imshow(f.polynomial(512)); plt.colorbar(); plt.axis('off');
# random wavefront from a dictionary with the range given in a tuple
f = random_zernike_wavefront({'defocus':(1,2), (3,-3):5})
display(f.zernikes)

print(f.amplitudes_noll)
print(f.amplitudes_ansi)

plt.imshow(f.polynomial(512)); plt.colorbar(); plt.axis('off');<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14443761524277812, 'fraction_numerical': 0.024585125998770743, 'mean_word_length': 7.2639593908629445, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '575230', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 638, 'n_tokens_neox': 611, 'n_words': 131, 'path': 'notebooks/Wavefront.ipynb', 'repo_name': 'mpicbg-csbd/phasenet', 'size': '1627'}