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 dtime parameter to read_ptu function #46

Merged
merged 1 commit into from
Mar 18, 2024
Merged

Conversation

cgohlke
Copy link
Member

@cgohlke cgohlke commented Mar 18, 2024

Description

Return number of bins in one period (1/frequency) by default.

Requires ptufile >= 2024.2.20.

Release note

Summarize the changes in the code block below to be included in the
release notes:

Add dtime parameter to read_ptu function

Checklist

  • The pull request title, summary, and description are concise.
  • Related issues are linked in the description.
  • New dependencies are explained.
  • The source code and documentation can be distributed under the MIT license.
  • The source code adheres to code standards.
  • New classes, functions, and features are thoroughly tested.
  • New, user-facing classes, functions, and features are documented.
  • New features are covered in tutorials.
  • No files other than source code, documentation, and project settings are added to the repository.

Return number of bins in one period by default.
@cgohlke cgohlke added the enhancement New feature or request label Mar 18, 2024
@cgohlke cgohlke requested a review from bruno-pannunzio March 18, 2024 18:46
@cgohlke cgohlke self-assigned this Mar 18, 2024
@cgohlke
Copy link
Member Author

cgohlke commented Mar 18, 2024

Hi @bruno-pannunzio

This PR uses a feature of the latest ptufile library to return the number of bins in one period by default. Formerly, the number of bins with photons was returned. If you use the ptufile library directly, use dtime=0.

@cgohlke cgohlke changed the title Add dtime parameter to read_ptu Add dtime parameter to read_ptu function Mar 18, 2024
Copy link
Contributor

@bruno-pannunzio bruno-pannunzio left a comment

Choose a reason for hiding this comment

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

@cgohlke thanks for the update! I think this works, I tested with the PTU data we discussed that had the issue and this is the result:
image

If you watch more into detail at the end of the curve:
image

I think it still shows a little bit of the artifact, but I am not sure. I tried the dtime parameter and it works great trimming the bins.

@cgohlke
Copy link
Member Author

cgohlke commented Mar 18, 2024

I think it still shows a little bit of the artifact

Yes, that's what I was mentioning a while ago in another meeting. I have seen these artifacts at the end and beginning only in PTU files exported by Leica software. I think they might come from slight discrepancies in the sync of micro and macro clocks. Or maybe they are due to the algorithm used to write photon times to PTU? Anyway, looks like we can't do much about it.

@cgohlke cgohlke merged commit 572260a into phasorpy:main Mar 18, 2024
13 checks passed
@cgohlke cgohlke deleted the ptu branch March 18, 2024 21:41
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

Successfully merging this pull request may close these issues.

2 participants