-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add convenience function to estimate local backgrounds #473
Comments
Since this is an important topic for HST users/the instrument teams, I have went ahead and created some functions that are basically what are described here. I discovered today, however, that you've also recently written the code (for the AAS231 workshop example notebooks) to some of the local background estimation using functions that aren't just the mean of an annulus. I've went slightly further and implemented some of IRAF/DAOPHOT's background/error computation here using your existing API tools. The outputs here also turn the measurements into magnitudes/mag errors for convenience. One thing I think is worth noting is that if the pixels inside the annulus are to be sigma clipped, then it seems using Hope this can be helpful in some way! |
Ah, I was looking to see if there was a way to get medians in an aperture. Would be nice to have these folded back into |
@yoachim You can easily get the median of the pixel values in an aperture by converting the aperture to an from photutils import CircularAperture
aper = CircularAperture((50, 50), r=10)
mask = aper.to_mask(method='center') # list of ApertureMask
data = np.random.random((100, 100))
aper_data = mask[0].multiply(data)
aper_data_1d = aper_data[mask[0].data > 0]
np.median(aper_data_1d) You need to use A tutorial notebook is here, which includes an example of sigma-clipped medians in annulus apertures for local background subtraction: |
Great example notebook, thanks! |
Local background are now available in the |
This would be for aperture photometry using an annulus-type aperture. The function would perform the background estimation, subtraction from the aperture photometry, and error propagation.
The text was updated successfully, but these errors were encountered: