Conversation
Member
|
@capetillo What we've done for testing this sort of stuff is make a postage stamp cutout around a random star of interest and write this to a new FIST file for testing e.g. This will make a 100x100 cutout around (250,250) - alter this to center on the object of interest in your test data FITS file |
jnation3406
approved these changes
Apr 23, 2026
Contributor
jnation3406
left a comment
There was a problem hiding this comment.
I can't comment on the math but seems fine. I'm not sure I like the super verbose line per param of function definitions but its a personal preference thing so if you like it it's fine.
| radius: float, | ||
| r_back1: float, | ||
| r_back2: float, | ||
| *, |
Contributor
There was a problem hiding this comment.
this is some advanced pythoning, I had to lookup what this does.
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.
FEATURE: Centroiding
Background:
BANZAI does not have a centroid for all targets. To find centroids for the excluded target, we obtained the logic from AstroimageJ, which uses the Howell method to obtain the centroid.
Implementation
The user clicks on a position and sends the clicked
xandyas well asradius,r_back1(the inner annulus),r_back2(outer annulus) to the backend. These are first scaled into FITS pixel space and then the local background is estimated from the annulus around the selected source, and iteratively refines the source center using the flux-weighted signal in the centroid window.The
/centroidingendpoint returnsxandyas the centroid position. It also returnsbackground, which is the average per pixel signal in that surrounding area, andpeak, which is the brightest source signal above that background.When the FITS header contains a valid WCS solution, we eturn ra and dec by converting the centroided FITS pixel position into sky coordinates. Otherwise those fields are null.
If plane background removal is enabled in the frontend, centroiding does not assume the background is the same everywhere near the source. It fits a simple tilted plane to the pixels in the background annulus and subtracts that changing background model during centroiding.
NOTE
I couldn't find a small FITS file so I couldn't write a test for that