Open vinsfan368 opened 4 months ago
Nice catch. I'd be in favor of your proposed solution (bundle the track statistics into calc_marginal_posterior_occs
). Could you also add a test to catch this in the future?
Done per PR #12. Am I supposed to be able to assign reviewers? @alecheckert
Hi @alecheckert, I ran across some quirks when trying to subsample within an SAD. Here's a code snippet:
The problem is that subsampling is happening every time
StateArrayDataset._load_tracks
is called. This can happen twice while using the object (unless the userclear()
s): once when calculating occupancies and another to get processed track statistics.jumps_per_file
depends on the processed track stats, so it doesn't agree with the posterior occs.A solution could be to bundle
StateArrayDataset._get_processed_track_statistics()
andStateArrayDataset.calc_marginal_posterior_occs()
into a bigger function. I guess the subsampled detections could also be cached on the SAD object, though that could take up a lot of memory.Happy to try to fix this; let me know what you think is the best way forward.