How to build ePSF with provided star fits
See original GitHub issueI tried to obtain the star PSF for a very large image of HST. The original image was huge, I tried to obtain the stars first and put them into individual fits. After subtracted the background and masked some contamination sources, I wanted to use the EPSFBuilder to combine these processed stars images and generate an effect native PSF. There were nearby sources around the original stars so I mask these regions with numpy.nan.
I followed the same method from the example document. I read the values of the stars and stored in a numpy array called “stars_sci” and then combined the data with np.hstack.
data=numpy.hstack(star_sci)
#Then I just follow the same code from the example document.
import matplotlib.pyplot as plt
from astropy.visualization import simple_norm
from photutils import datasets
from photutils.datasets import make_noise_image
peaks_tbl = find_peaks(data, threshold=5000)
peaks_tbl['peak_value'].info.format = '%.8g' # for consistent table output
print(peaks_tbl)
size = 25
hsize = (size - 1) / 2
x = peaks_tbl['x_peak']
y = peaks_tbl['y_peak']
mask = ((x > hsize) & (x < (data.shape[1] -1 - hsize)) &
(y > hsize) & (y < (data.shape[0] -1 - hsize)))
from astropy.table import Table
stars_tbl = Table()
stars_tbl['x'] = x[mask]
stars_tbl['y'] = y[mask]
from astropy.stats import sigma_clipped_stats
mean_val, median_val, std_val = sigma_clipped_stats(data, sigma=2.)
data -= median_val
#The extract_stars() function requires the input data as an NDData object. An NDData object is easy to create from our data array:
from astropy.nddata import NDData
nddata = NDData(data=data)
from photutils.psf import extract_stars
stars = extract_stars(nddata, stars_tbl, size=25)
The stars looked ok However, the final EPSF was very strange. I didn’t know what happened and why the shape looked so irregular.
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (12 by maintainers)
Top Results From Across the Web
Developers - How to build ePSF with provided star fits -
I tried to obtain the star PSF for a very large image of HST. The original image was huge, I tried to obtain...
Read more >Building an effective Point Spread Function (ePSF) - Photutils
To begin, we must first define a sample of stars used to build the ePSF. Ideally these stars should be bright (high S/N)...
Read more >Energy Panel Structures Dealer Network
ENERGY STAR & Green Build EPS is proud to work with our builders who are ENERGY STAR Partners to provide the products and...
Read more >Fit type for curve and surface fitting - MATLAB fittype
Construct fit types by specifying library model names. Construct a fittype object for ... Warning: Start point not provided, choosing random start point....
Read more >Point-spread Function Photometry for Impatient Astronomers
NASA's Kepler mission provided photometry of over 400,000 stars ... of the ePSF/PRF, this method usually fits for both position and flux.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
Yes, I’m not setup to use the development build, but as soon as the 0.7.2 comes out I’ll give it a try.
Thanks for your work, Enrico
Il giorno ven 15 nov 2019 alle ore 15:58 Erik Tollerud < notifications@github.com> ha scritto:
@oxno2 and @cloud182 - we think #974 should have solved this problem. Can you give the latest development build of
photutils
a try? (Or if you aren’t set up to install from source, try it when 0.7.2 comes out.) If that addresses your problems here, we can close this issue.