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

PIPERBLK unused? #66

Open
lacker opened this issue Jun 26, 2022 · 3 comments
Open

PIPERBLK unused? #66

lacker opened this issue Jun 26, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@lacker
Copy link
Contributor

lacker commented Jun 26, 2022

I noticed some other code reading raw files and claiming that the PIPERBLK field had to be used to find missing blocks. However rawspec doesn't seem to use this field at all. It seems like the logic to detect missing blocks calculates PIPERBLK (calling it dpktidx) by subtracting the first two PKTIDX's it sees:

// Lazy init dpktidx as soon as possible

but, that doesn't seem correct, I think it will cause rawspec to fail if the second block is ever missing.

@david-macmahon
Copy link
Contributor

PIPERBLK is "Packet Index PER BLocK". It is the expected increment in PKTIDX ("PacKeT InDeX") from one block to the next. Not all GUPPI RAW files have PIPERBLK in the header. PIPERBLK is used to detect "missing" blocks, which need to be processed as blocks of zeros to keep the integrations evenly spaced. When PKTIDX is missing, the best we can do is derive it by taking the difference between the PKTIDX values of the first two blocks (and hope that there are no missing blocks in between). If there is a one block in one RAW file, then there can be no missing blocks (other than the infinite "missing" blocks after the sequence of RAW files. I suppose there might be a corner case where there is a sequence of one-block files. That corner case may not be properly handled, but to my knowledge nobody creates a sequence of one-block files.

@lacker
Copy link
Contributor Author

lacker commented Jun 26, 2022

That makes sense. My point is just that rawspec isn't actually using the PIPERBLK header. It always does the "derive it by hoping there are no missing blocks in between the first two" thing.

@david-macmahon
Copy link
Contributor

Ah, I see. Yeah, it should take advantage of it when present.

@david-macmahon david-macmahon added the enhancement New feature or request label Jun 27, 2022
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

No branches or pull requests

2 participants