lacker / seticore

A high-performance implementation of some core SETI algorithms that can be included in other programs.
MIT License
3 stars 6 forks source link

If NFPC is present in HDF5 header, use it to calculate n_coarse_channels #9

Closed texadactyl closed 2 years ago

texadactyl commented 2 years ago

In h5_file.cpp, I saw code to guess the course_channel size. When nfpc is present (new rawspec feature), seticore should be looking for the HDF5 header field nfpc = number of fine channels per coarse channel (FFT length). Then, n_coarse_channels = num_freqs / coarse_channel_size = num_freqs / nfpc

Suggestion: put the n_coarse_channels calculation in a callable function for convenience.

lacker commented 2 years ago

i'll have to figure out how to read headers that may or may not be there with this unpleasant hdf5 c api....

texadactyl commented 2 years ago

Pass a flag that, when set true, forgives a missing header tag and returns some normally impossible value. Normally, the flag is false.

lacker commented 2 years ago

It now checks the heuristics against nfpc in: https://github.com/lacker/seticore/commit/5cffa57b59f0338422d34104a0bc4e527fdc3db9

It still refuses to run on data that doesn't match one of the hard-coded GBT and ATA values, because I'd like to find out if the inference logic is incorrect, but if we run into something we can't distinguish with heuristics then it makes sense to fall back to nfpc I think.