INLnano / pyMOE

Python library for designing and producing masks for Micro Optical Elements
Other
7 stars 2 forks source link

Add plotting functions and examples outside each _mask function #4

Closed daguiam closed 2 years ago

daguiam commented 2 years ago

Instead of having plotting=True, each *_mask function should output the created mask data in array, and then this data is used for plotting outside the function

cunhaJ commented 2 years ago

This option has been added. As of date of writing (02/06/2022), all *_mask functions in the generate module return the generated masks in 2D array form. The 2D array can be captured for later use (e.g. plotting) by typing, for example, mask_array= pymoe.generate.layer_mask(...) A simple example is the following:

#make circular apertures (returns also the 2D array)
npix = 64
xsiz = 512
ysiz = 512

#circx is the 2D array 
circx = moe.gen.circ_mask(npix, xsiz, ysiz, partial =0.25, filename = None , plotting=False );

#show the mask using matplotlib 
fig = plt.figure() 
plt.imshow(circx, cmap = plt.get_cmap("Greys"))