-
Notifications
You must be signed in to change notification settings - Fork 21
Added config file linkingfilter.ssp_number_observations into PPMiniDifi #1142
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
base: main
Are you sure you want to change the base?
Conversation
Added linkingfilter.ssp_number_observations into MiniDifi function hasTracklet. Now the function is no longer hard coded for 2 observations to make a tracklet and depends on config variable ssp_number_observations. Updated test_PPLinkingFilter unit test and ran notebook demo_miniDifiValidation to check these changes with the brute force method to ensure the linking filter still works the same way.
Need a test that doesn't have 2 tracklets in it to truly test.... |
…sts to check this works
src/sorcha/modules/PPMiniDifi.py
Outdated
@@ -88,16 +88,20 @@ def hasTracklet(mjd, ra, dec, maxdt_minutes, minlen_arcsec, min_observations): | |||
|
|||
maxdt = maxdt_minutes / (60 * 24) | |||
minlen = minlen_arcsec / 3600 | |||
detection_pair_count = 0 # counting number of detection pairs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this line deleted?
src/sorcha/modules/PPMiniDifi.py
Outdated
@@ -78,25 +81,34 @@ def hasTracklet(mjd, ra, dec, maxdt_minutes, minlen_arcsec): | |||
## tracklets by taking all observations in a night and computing | |||
## all of theirs pairwise distances, then selecting on that. | |||
nobs = len(ra) | |||
if nobs >= 1 and min_observations == 1: # edge case when 1 observation is needed for a tracklet | |||
return True | |||
if nobs < 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't cover if one needs three observations for a tracklet
I think the required change is to remove the new if statement and change
if nobs < 2 needs to be nobs min_observations
Changed linkingfilter config class checks to so that ssp_separation_threshold can be zero when ssp_number_observations =1
Fixed if statement in miniDifi to not count duplicate detections using set function. Added another unit test to check case where not enough observations are linked to count as a tracklet.
…ns for a tracklet Updated demo_miniDifiValidation to allow different minimum observations for a tracklet in the brute force linking test. Changed miniDifi.hasTracklet function to be more efficient.
Fixes #1141 .
Added linkingfilter.ssp_number_observations into MiniDifi function hasTracklet. Now the function is no longer hardcoded for 2 observations to make a tracklet and depends on config variable ssp_number_observations. Updated test_PPLinkingFilter unit test and ran the notebook demo_miniDifiValidation to check these changes using the brute force method to ensure the linking filter works the same way.
Review Checklist for Source Code Changes