Skip to content

Conversation

@d-v-b
Copy link

@d-v-b d-v-b commented Oct 10, 2025

This PR adds a specification document for the anscombe-transform codec. Once this is complete, we can open a PR over at zarr-extensions that links to the docs page containing the spec.

@d-v-b d-v-b marked this pull request as ready for review October 21, 2025 15:11
event_rate = (x - zero_level) / conversion_gain

zero_slope = 1.0 / (beta * math.sqrt(3.0 / 8.0))
zero_slope = 1.0 / (beta * np.sqrt(3.0 / 8.0))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zero_slope = 1.0 / (beta * np.sqrt(3.0 / 8.0))
zero_slope = 1.0 / (beta * 0.612372) # 0.612372 approx (3.0 / 8.0) ** 0.5

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not leave this to numpy?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's clearer since we aleady import numpy. I usually do ( )**0.5 to avoid extra imports.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing numpy for something so simple is not my first choice but we need numpy for the casting logic

@dimitri-yatsenko dimitri-yatsenko merged commit bf7dce0 into datajoint:main Oct 22, 2025
8 checks passed
@d-v-b d-v-b deleted the docs/spec branch October 22, 2025 15:23
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 this pull request may close these issues.

2 participants