-
Notifications
You must be signed in to change notification settings - Fork 38
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
HAP/Catalogs: Sky background is incorrect when image has too many unused pixels #1838
Comments
Comment by Michele De La Pena on JIRA: Rick White Just a quick note at this time. Although we advertise there are two methods to compute the background (i.e., sigma-clipped statistics and Background2D), there are actually three methods. The third method is considered the "unusual" case as it appeared to apply only to SBC data. However, your investigation reveals a case we had not considered. For SBC images, many background pixels appears to be identically zero in the "illuminated" portion of the image. If the percentage of originally zero combined with any NaN values which were reset to zero are greater than a configured percentage, the median is set to zero and the rms of the non-zero pixels within the footprint is computed. A flag is also set not allowing any further background computation algorithms to be executed. Your dataset can be used for further analysis of the background determination algorithms! |
Comment by Rick White on JIRA: Michele De La Pena Thanks, that is very enlightening! I understand and am not surprised that the SBC images require some special handling. Those photon-count images have very different properties than all the other detectors. You understand the code flow much better than I do, but there are a few approaches that could work:
This does not affect many On the other hand, it affects a lot of filter (non- I find 5,613 filter images with |
Comment by Rick White on JIRA: I updated the title and description based on your comments. I think this version should be more accurate. |
Comment by Michele De La Pena on JIRA: Rick White. I have made changes to eliminate conversion of NaN to zero, as well as as limiting some computations to only SBC. It does seem to me that when working with the Filter products that the footprint mask based upon the FilterProduct should be used instead fo the footprint mask based upon the TotalProduct. Thoughts? Ooops. I see this is your Option 1 below. |
Comment by Michele De La Pena on JIRA: Rick White I processed the ACS/UVIS dataset, ib6wb3, which is the subject of this ticket, as well as two SBC datasets, jecn01n and j9zp02, using a modified version of drizzlepac. The datasets are located in /home/mdelapena/ForRick/ZERO under appropriately named subdirectories. The Filter products now use their "own" footprint mask. Also, the special case of identically zero background is now only applicable to SBC. Please take a look at the results. :) |
Comment by Rick White on JIRA: Michele De La Pena I confirmed that the background gets computed correctly for this image now. The catalogs look very good too (partly because the cosmic ray contamination is greatly reduced by omitting single-exposure filters). The catalogs for The catalogs for Anyway, bottom line: the new uvis catalogs look good, and the background processing is correct. It would be good to figure out why the catalogs got rejected in the |
Issue HLA-1284 was created on JIRA by Rick White:
Too many unused pixels that are filled with zeros can cause the sky background not to be calculated correctly. Michele explains in the comments that this comes from a part of the code that was intended to handle ACS/SBC images (which are photon counts and can have many zero pixel values). This has the unintended side effect of not computing the background correctly for many non-SBC images.
There are about 3,200 filter images (out of ~65k ACS images and ~90K WFC3 images) for both ACS and WFC3 that have this problem. So it is a moderately rare problem, but it does affect 3-5% of the images.
An example is image hst_11360_b3_wfc3_uvis_f673n_ib6wb3, which is in a visit that has large shifts between some of the filters. As a result, the region covered by the
total
image is much larger than the region covered by thef673n
image. In thetotal_trl.txt
file for that visit, these messages appear for thef673n
image:The
Median
value is deliberately set to zero because there are many zero pixels. There is a special test in the code for this case, and it skips the rest of the background processing (including theBackground2D
calculation) as a result. But those zero pixels appear because most of the image region is blank due to not being covered by the filter.In this visit, all the filter images have the same problem. Only the total image (which combines all the filters) is able to compute the median value.
I looked at this because I was working on HLA-1240. I do not know whether this could be related to the problems in that ticket, but it might be.
The correct behavior would be to ignore the pixels in the blanked region when counting zero pixels for this test.
The text was updated successfully, but these errors were encountered: