-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
negative pixel grid in ePSF #1066
Comments
Hmm, curious. Is there any way you can try this with one of the non-drizzled images that fed into the drizzled image? I realize it's the drizzled one you want, but this might help distinguish between a problem that the drizzling is creating somehow vs the epsf fitter itself. |
@jryon Typically you need many more than 18 stars to create a good ePSF. At an absolute minimum, for 4x oversampling you need 16 stars, but those stars would need to be centered such that they uniformly sample the 4x4 subpixel grid (not likely with random stars) -- and even in that case the ePSF would be very noisy because you'd only get one sample at each ePSF pixel. The result you are seeing is very likely due to holes in the 4x oversampled ePSF grid due to the lack of stars. Is it possible for you to add more input stars? |
@larrybradley I increased the number of stars to 31, but that is nearly the max available in the field that aren't contaminated by other stars, and some of them are fairly dim. I also tried 2x oversampling (then I'd only need 8 stars, if uniformly sampled?), but I'm still seeing a grid pattern, though it is less extreme with certain choices of parameter values. If I use quadratic smoothing, the grid pattern is less noticeable around the middle of the PSF, but then a row or column of negative pixels appears at the edge of the PSF frame. I'm working on testing with an FLT image instead of the DRZ I was using. Thanks for your help! |
Using the FLT image |
I obtained a very deep drizzled SBC image of a star cluster and attempted to make a PSF from ~50 high S/N, isolated stars in the image. I used the same parameters as for the FLT PSFs above: 2x oversampling, At this point, it seems like using drizzled frames is not the issue, and neither is the number of stars provided to |
The edge effects you are seeing is because of the fixed cutout size of the input stars. The input star cutouts (using In your last post, the "quadratic" smoothing looks pretty good to me, considering you only have 50 stars. I think Jay Anderson would tell you that you need at least several hundred well-dithered stars to build a good ePSF. I'm a bit surprised the "quartic" looks significantly worse, but IIRC that particular smoothing kernel was generated by Jay for 4x oversampling. I've had conversations with Jay about the smoothing kernels and unfortunately, the best kernel depends on the shape of the PSF. It's a bit of an art. Have you talked to Jay about this? He may have generated a library of ePSFs for the ACS/SBC. |
Ok, the edge effects make sense now, thanks for the explanation. The PSF I'm attempting to make is for GALFIT fitting, not PSF photometry. In this case, I think the wings are more important. In many cases, it is very difficult or impossible to find hundreds of well-dithered, isolated, bright stars in an image. If an ePSF is not considered good unless that criterion is satisfied, that may limit Is there anything like IRAF or DAOPHOT's I'm on the ACS instrument team, and we have ePSF models for WFC and HRC only. The lack of an SBC ePSF library is possibly because most fields have a small number of UV-bright stars. |
What's the appropriate way to do this? The naive approach epsf.data = epsf.data[2:-2, 2:-2] doesn't work because epsf._data = epsf.data[2:-2, 2:-2] but that's using a private variable and not encouraged. Would it be best to do epsf = EPSFModel(data=epsf.data[2:-2, 2:-2]) or does that lose important information about, e.g., normalization? |
I'm having a similar issue of a grid in the final ePSF. This thread has been helpful so I wanted to share where I'm at. If I've created an act against all that is sacred let me know. tl;dr: making the kernel not have values below zero seems to help. I went into my local copy of epsf.py and added some code to accept/create a 'custom' kernel. After trying different oversampling values and array sizes (quadratic and quartic are 5x5) I still had the grid issue. It seems like it tracked with the corners of the quartic or quadratic kernels having negative values in the corners so I just adjusted my custom kernel to keep everything zero or greater.
Here is a before and after example of the same ePSF. Oversampling: 4x, polynomial2D degree: 2, kernel array size: 7x7. One image, 72 stars found (some may be hot pixels but removing them doesn't change the grid artefact).
|
HI @AuroraBorealis30 - I am running into a similar issue with the PSF subtractions - did you find a solution to this? |
I am attempting to make an ePSF from a set of 18 stars in the field of an ACS/SBC F125LP drizzled image. I'm following the example here. The resulting ePSF has a strange grid pattern of negative pixels, which appears to me as some kind of aliasing. I've explored a range of values for
oversampling
,maxiters
, andnorm_radius
, but the grid pattern remains (though the appearance changes). I looked through related issues here, but I couldn't find a solution for this problem, nor am I confident it is not a bug. There may be poor subpixel sampling of the peak locations of the PSF stars, since there are relatively few bright, isolated stars in the image.My code and the resulting ePSF are below, and I can share the drizzled image if needed. I'm using version 0.7.2 of
photutils
.The text was updated successfully, but these errors were encountered: