Change turnound flags kernel shape for two_leg turnarounds#1697
Draft
mjrand wants to merge 1 commit into
Draft
Conversation
Changed the matched filter kernel shape so the kernel shape better matches the expected shape of the az velocity in two_leg turnarounds.
Contributor
|
However you end up fixing this flagging it needs to recover the same turnaround flags as before for our standard turnarounds without requiring parameter tweaking by hand. I tend to agree with @skhrg that a simpler flagging than a matched filter may work here and it seems like @tskisner already has something implemented in toast which may work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed the matched filter kernel shape so the kernel shape better matches the expected shape of the az velocity in two_leg turnarounds. The current kernel shape for turnaround flags does not properly find the midpoint of turnarounds because of the new two_leg turnaround shape. Here is a comparison of the matched peak for the current and new kernels with a two_leg turnaround:


Here is a comparison of the kernel shapes before and after this change:
The two changes are:
find_peaksfunction will find the center of the first/second leg and choose either "somewhat" arbitrarily.If the kernel size is too small (i.e. we use the original kernel_size=400 with the new kernel shape) the match will also fail:

Here is the comparison of matches using the new and current kernels on a standard turnaround with scan_v = 1.5.

The new kernel does move the flag by ~0.1-0.2 seconds, but that may not be a huge problem?
At scan_v = 0.8 the difference is even less noticeable:


Finally, I tried this on a Jupiter scan. The new kernel does seem to have a bit of an issue with finding the center of this standard turnaround.


However, the new shape works perfectly fine as long as we're using the original kernel size (400 indexes instead of 1500):

So we may want to feed in the kernel size based on the scan parameters. The kernel size should ~match the turnaround length which should always be
2 * scan_v / scan_a * 200. This should let the new kernel shape handle even standard turnarounds. I think trying to feed in the turnaround method to switch between kernel shapes is a little overkill as we'll always have to ensure the kernel size matches the turnaround length anyways. The new kernel shape seems to do find with finding the center of standard turnarounds as long as the kernel size is correct!Please try this out yourself and let me know if it works for you.