Open mohanagr opened 5 months ago
Also, since file_idx default passed is 0 (start from the first file in the list of files returned from get_init_info()
), BFI needs to be smart enough to load the appropriate file where it expects the requested specnum to lie.
E.g. get_init_info() says* start at specnum 100k in file 0. And then when we start the timing code tells us please adjust your starting location by 50k spectra to get rid of constant offset, but doing 150k + 50k sends us in the domain of the next file. BFI should handle this. OR we interpret variations to specnum as variations in time and just call get_init_info() again with a new requested timestamp t_new = t_old + adjustment. all start_idx inputs to BFI considered fixed.
*: Values returned by get_init_info will always lie inside a file because that's how the function is written --- it scans all files and then scans the file closest to requested timestamp and outputs the location inside that file which corresponds to requested timestamp (within +/- 16 musec or 1 spectrum).
BasebandFileIterator
calculates where inside a file integration starts. If the starting spec number exceeds uint32, it needs to wrap it probably?get_init_info() will just say you need to start at 100k'th spectra relative to the start of this particular file. Question is what happens if start_spec + 100000 > 2^32-1? It's probably accounted for when BFI loads a file, detects a wrap and corrects for it. If that's working OK then start_spec + 100k should exist in that file's specnums.
Another issue is what if I fiddle with the start idx that's passed. what if I say I want start idx = 1 trillion? If there was a wrap in the file which got fixed by BFI when it loaded the file, the file still is not going to have a specnum of 1 trillion. What happens then?