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

Check SLMImage exposure input values #210

Closed
hinderling opened this issue Nov 27, 2024 · 1 comment · Fixed by #211
Closed

Check SLMImage exposure input values #210

hinderling opened this issue Nov 27, 2024 · 1 comment · Fixed by #211

Comments

@hinderling
Copy link
Contributor

hinderling commented Nov 27, 2024

Currently even negative values are allowed,

event = MDAEvent(slm_image=SLMImage(data=True,exposure=-999))
mmc.mda.run([event])
--> runs

where as this is checked for camera exposure:

event = MDAEvent(exposure=-99)
--> validation error for MDAEvent

Not sure if this needs to be checked, because negative values are allowed on device level (Polygon1000, genericSLM):

mmc.setSLMExposure(slm_dev,-999)
print(mmc.getSLMExposure(slm_dev))
--> -999.0
@tlambert03
Copy link
Member

good catch! pydantic makes this easy, let's copy this pattern:

exposure: Optional[float] = Field(default=None, gt=0.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants