-
Notifications
You must be signed in to change notification settings - Fork 194
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
MapMaker max_offset cutout size #2150
Comments
Hi @cdeil, I would say that this is a use case that is not supported by That said, computing a set of valid pixels based on some region selection, and fill the maps only for those pixels can be a good approach. I think initially it worked like this rather than by multiplying by a mask. Regarding model evaluation, |
Surely making an all-sky map with Gammapy should be a supported use case?
Well we already have this: https://docs.gammapy.org/0.11/api/gammapy.cube.MapMakerRing.html
It could work like that for most cases, and HEALPix would work out of the box. Except if background estimation needs a convolution operation, like the ring.
I don't think so, already the first version or MapMaker, and the old BasicImageEstimator used cutouts
Yes, at least for PSF-convolved a 2D image is needed. Eventually I think being able to make an all-sky model image is also a supported use case for Gammapy. So that's an argument against changing to 1D pixel arrays, and to keep using 2D cutouts. For now, what I've done is to change to One concrete proposal I still have: add a "correct" cutout method to [gammapy.maps.WcsGeom.cutout] (https://docs.gammapy.org/0.11/api/gammapy.maps.WcsGeom.html#gammapy.maps.WcsGeom.cutout) which implements what I suggest above: make distance image and find cutout that contains all pixels within the given radius. This could then be the default in |
This is what happened with Events were only simulated out to 5 deg, and background IRF extrapolation gives incorrect background at large offsets (black ring = negative excess = background too high). So I'll go back to Another issue is that excess is overall positive, i.e. background underestimated in some of the AGN fields. That looks like a bug in our solid angle computation. I think https://docs.gammapy.org/0.11/_modules/gammapy/maps/wcs.html#WcsGeom.solid_angle is incorrect if pixels aren't approx squares on the sphere, but parallelograms like in the case of AIT? Scripts and files are here: https://github.com/gammasky/cta-dc1-gps-analysis/blob/master/make_new.py I wanted to try ctools and compare, starting with a counts image which might already differ (see here. But at least ctools 1.5 doesn't seem to work at all with AIT if there are non-sphere pixels in the image (see here. Still, comparisons could be made, e.g. focusing on some AGN FOV where AIT distortion is present, just a test with 1 or 2 runs should reveal all issues / differences. |
@adonath - Thanks for fixing the solid angle computation in #2276 . I re-ran the CTA DC-1 all-sky map with the script here and the result is here and here. It looks much better now, but there are still some visible issues for the fields of view at the edge of the all-sky image (also see screenshot pasted below). There is FOV cutout truncation (the main issue reported and discussed here), but also an issue of bright excess lines at the edge of the all-sky image, probably due to partially inside / outside pixels being filled with counts, but not with background, because there they get I'll leave this issue open for now - would like to improve FOV cutout at least, and maybe consider doing something about the edge of the all-sky image to get a good result there also. |
In the new data reduction scheme the cutout parameter is separated from the |
Is there any left to do here? @adonath ? |
Any update here @adonath? |
Thanks @Astro-Kirsty, I think we can close the issue for now. Maybe we we will compute an all-sky map for the next CTA data challenge. If we still find problems, we can open new issues. |
I tried using
MapMaker
to make an all-sky AIT map for CTA DC1 today.One issue I noticed is that the
max_offset
isn't used in the way I had hoped / expected.As can be seen in the screenshot below, what happens is that for most parts of the image where WCS distortions occur, the cutout is chosen too small, the cutout images are truncated.
One thing we could do is change the algorithm that computes cutouts to something that doesn't truncate. E.g. we could compute a sky distance image, threshold it, and then compute the bounding box for that mask. Or we could create a polygon that traces the max offset cone, and then compute the cutout from the polygon.
The sky image distance image based method would even give "fully correct" results in cases where the FOV wraps to the opposite side of the image. That does happen in all-sky analysis, and others have encountered problems with such cases (see here or here). Of course, in that case, the bounding box would be huge, spanning almost the entire image. But a bit slow and correct is better, no?
The computation of the sky image distance images and bounding boxes could be optimised if it turns out to be a real slowdown.
So bottom line: I suggest to change the cutout slice computation to be distance-imaged based for now to avoid this truncation effect.
We could change to completely skycoord-array based eventually, then no cutout box is needed at all, since here in MapMaker no PSF is involved. Then it would work for HEALPix directly.
@adonath - Could it be that we have similar truncation issues in the model image computations, where cutouts are used? We probably need to add tests for exotic cases some day?
@adonath @registerrier @AtreyeeS - Thoughts?
The text was updated successfully, but these errors were encountered: