Skip to content
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

Updates to fitting for faint traces. #35

Open
wants to merge 4 commits into
base: same-block-cals
Choose a base branch
from

Conversation

cmccully
Copy link
Contributor

This PR updates our trace fitting algorithm to better deal with faint (read low signal-to-noise) traces. To fit the center, we take 25 pixel steps and fit the entire 25-pixel wide block using a match filter to get the trace center. We have also included error bars in the centroids estimated from this. These steps are fit to a Legendre polynomial to get initial coefficient guesses. We then fit the entire trace simultaneously (with a fixed width) to get the centers of the trace. Once we have the centers, we fix them and allow the width to vary. We include a background term that is a Legendre polynomial but the coefficients vary smoothly across the image.

@cmccully cmccully requested review from sfoale and jchate6 December 13, 2024 18:24
Copy link

@sfoale sfoale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cmccully cmccully changed the base branch from main to same-block-cals December 16, 2024 16:41
Copy link
Contributor

@jchate6 jchate6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just out of curiosity, was there a reason for the binning to be 25 pixels wide? what made you choose that width?

@cmccully
Copy link
Contributor Author

cmccully commented Jan 8, 2025

just out of curiosity, was there a reason for the binning to be 25 pixels wide? what made you choose that width?

25 is small enough of step to sample the dispersion direction well, but large enough to boost the signal-to-noise be a factor of ~5.

@cmccully
Copy link
Contributor Author

cmccully commented Jan 8, 2025

I've updated how we fit the width of the profile. It is much closer to how we fit the centroid now. We bin the data down by again a factor of 25, interpolating onto a common grid and then fit a simple polynomial + gaussian model.

@jchate6 jchate6 self-requested a review January 8, 2025 20:49
Copy link
Contributor

@jchate6 jchate6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense.

profile_sigmas.append(Legendre(best_fit, domain=domain))
return profile_sigmas

# Group the data in bins of 25 columns (25 is big enough to increase the s/n by a factor of 5 but small enough
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

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.

3 participants