Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to segmented mirror to display segment numbers #27

Closed
ivalaginja opened this issue Jul 11, 2019 · 2 comments
Closed

Add method to segmented mirror to display segment numbers #27

ivalaginja opened this issue Jul 11, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@ivalaginja
Copy link
Collaborator

It might be useful to write a little method for the SM class that allows to display the segment numbering. Not super high priority I'd say.

@ehpor
Copy link
Owner

ehpor commented Aug 1, 2019

I added a function to do this in b02a394, but generalized to any actuator basis so that it also works on non-segmented DMs. Example usage code below.

from hcipy import *
import matplotlib.pyplot as plt
import numpy as np

pupil_grid = make_pupil_grid(512)
num_rings = 5

segment_positions = make_hexagonal_grid(0.5 / num_rings * np.sqrt(3) / 2, num_rings)
aperture, segments = make_segmented_aperture(hexagonal_aperture(0.5 / num_rings - 0.003, np.pi / 2), segment_positions, return_segments=True)

aperture = evaluate_supersampled(aperture, pupil_grid, 2)
segments = evaluate_supersampled(segments, pupil_grid, 2)

imshow_field(aperture, cmap='gray')
label_actuator_centroid_positions(segments)
plt.show()

actuator_locations

@ehpor ehpor added the enhancement New feature or request label Aug 1, 2019
@ehpor
Copy link
Owner

ehpor commented Aug 1, 2019

Another general example for a tilted DM:

from hcipy import *
import matplotlib.pyplot as plt
import numpy as np

pupil_grid = make_pupil_grid(512)

inf = make_gaussian_influence_functions(pupil_grid, 11, 0.8 / 11, y_tilt=np.radians(25), z_tilt=np.radians(10))

# Display waffle pattern on DM
imshow_field(inf.linear_combination((-1)**(np.arange(len(inf)))), cmap='RdBu')
label_actuator_centroid_positions(inf)
plt.show()

actuator_locations2

@ehpor ehpor closed this as completed Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants