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

Deal with files with large numbers of invalid frames #492

Open
mhvk opened this issue Dec 3, 2021 · 1 comment
Open

Deal with files with large numbers of invalid frames #492

mhvk opened this issue Dec 3, 2021 · 1 comment

Comments

@mhvk
Copy link
Owner

mhvk commented Dec 3, 2021

@00rebe wrote:

I found another file that throws out the error: AssertionError: problem loading frame set 7966.
Cannot find header nearby.

fh = baseband.vdif.open('/mnt/raid-project/gmrt/rlin/ek036b/data/ir/ek036b_ir_no0002.m5a')
fh.seek(15360246)
fh.read(5 * 5 * 5 * 5 * 2**10)

This file has a large number of filled-in frames, in which the header has invalid_data=True, the correct frame size, all 0 otherwise in the first four words (so that nchan, seconds, etc., are wrong), and 0x11223344 in the second four header words as well as in the whole payload (i.e., the Mark 5B invalid data fill pattern). Specifically,

In [30]: fh.fh_raw.seek(7967*fh.header0.frame_nbytes)
Out[30]: 63990944

In [31]: f = fh.fh_raw.read_frame()

In [32]: [hex(i) for i in f.header.words]
Out[32]: 
['0x80000000',
 '0x0',
 '0x3ec',
 '0x0',
 '0x11223344',
 '0x11223344',
 '0x11223344',
 '0x11223344']
@mhvk
Copy link
Owner Author

mhvk commented Dec 17, 2021

In principle, the current machinery can sort-of deal with it, but it would help to have a way to mark frames as impossible to reach, maybe in RawOffsets?

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

No branches or pull requests

1 participant