Skip to content

Conversation

Little-Ryugu
Copy link
Collaborator

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

  • Does pip install still work?
  • Have you written a unit test for any new functions?
  • Do all the units tests run successfully?
  • Does Sorcha run successfully on a test set of input files/databases?
  • Have you used black on the files you have updated to confirm python programming style guide enforcement?

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.
@Little-Ryugu Little-Ryugu marked this pull request as ready for review April 1, 2025 16:21
@Little-Ryugu Little-Ryugu requested a review from mschwamb April 1, 2025 16:22
@mschwamb
Copy link
Collaborator

mschwamb commented Apr 1, 2025

Need a test that doesn't have 2 tracklets in it to truly test....

@@ -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
Copy link
Collaborator

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?

@@ -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:
Copy link
Collaborator

@mschwamb mschwamb Apr 2, 2025

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.
@mschwamb mschwamb requested a review from mjuric April 9, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config file variable SSP_number_observations is not called and is hard coded to be 2 in MiniDifi
2 participants