Skip to content

Pixel Size Calculator #1

@DavidDierickx

Description

@DavidDierickx

Wrote a quick function to get the appropriate pixel size for a given max number of pixels and array. This should allow us to always stay under the max until we obtain a better way of defining the patterns.

import numpy as np

n = 3.5e6
z = 2
w = 400e-6
l = 250e-6
e = 0.2

def get_pixel_size(n, z, w, l, e):
x = np.sqrt((n/z)/(w*(l*(1+e))))
return 1/x

pixel_size = get_pixel_size(n, z, w, l, e)
print(f'Pixel size (nm): {pixel_size*1e9}')
print(f'Number of pixels in w: {w/pixel_size}')
print(f'Number of pixels in l: {l/pixel_size}')

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions