DavidT3 / XGA

X-ray: Generate and Analyse is a module designed to make the analysis of XMM observations simple and efficient. It provides an interface with SAS for the creation of XMM data products, as well as a way to easily perform fits (scalable for multiple observations) and retrieve information about an object, all within a Python package.
BSD 3-Clause "New" or "Revised" License
31 stars 3 forks source link

Started prototyping spectral map measurements for clusters (and other extended objects) #1232

Open DavidT3 opened 4 weeks ago

DavidT3 commented 4 weeks ago

There is no branch yet, but I have started prototyping spectral property measurements in two spatial dimensions, which will be included in XGA to produce things like temperature, metallicity, and entropy maps.

Started off with simple square pixels, as considerably easier to mess around with than abstract polygons. The SAS selection language can easily be used for this.

I think in the final implementation, when there will probably be an option for square pixels, I may not generalise them to polygons, because I suspect that would be considerably slower than just using the box region.

When it gets to the property map classes though, they should be generalised as polygons.

My test case is Abell 3667, which has a very interesting thermal structure, and has had temperature maps measured before. I will include updates (and the prototyping notebook) in this issue when possible.

astrophysics-megan commented 4 weeks ago

Could Jeremy’s region definition program be adapted to Xmm?

Sent from my iPhone

On Oct 28, 2024, at 3:12 PM, David Turner @.***> wrote:



There is no branch yet, but I have started prototyping spectral property measurements in two spatial dimensions, which will be included in XGA to produce things like temperature, metallicity, and entropy maps.

Started off with simple square pixels, as considerably easier to mess around with than abstract polygons. The SAS selection language can easily be used for this.

I think in the final implementation, when there will probably be an option for square pixels, I may not generalise them to polygons, because I suspect that would be considerably slower than just using the box region.

When it gets to the property map classes though, they should be generalised as polygons.

My test case is Abell 3667, which has a very interesting thermal structure, and has had temperature maps measured before. I will include updates (and the prototyping notebook) in this issue when possible.

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/DavidT3/XGA/issues/1232__;!!HXCxUKc!wSSAeBecl6PTfkMKK7t1LocQdapyQGsBQs6mCr21E5bUr_n0MiUPruXjqdk7R3ps8pjQJUUCR3CIb2JUiU9tQ4d2YQ$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ASKK4PZME5FHLOMD4RLKMILZ5Z5ALAVCNFSM6AAAAABQYEAZK2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGYYTSMZRGM4TANI__;!!HXCxUKc!wSSAeBecl6PTfkMKK7t1LocQdapyQGsBQs6mCr21E5bUr_n0MiUPruXjqdk7R3ps8pjQJUUCR3CIb2JUiU_VzG_9Dg$. You are receiving this because you are subscribed to this thread.Message ID: @.***>

DavidT3 commented 4 weeks ago

First pass didn't go well:

image

Was far too ambitious in terms of number of pixel regions - also the grid is meant to be evenly spaced in RA and DEC and for some reason there is overlap in DEC (significant) in the boxes specified as the 'pixels'. I almost certainly screwed up something wrt projection of a spherical coordinate system, because I always do.

DavidT3 commented 4 weeks ago

image

I appear to have knitted a scarf

DavidT3 commented 4 weeks ago

Not my greatest plot, but it is a start:

image

And one with coords:

image

So the prototype does function somewhat, not that I was expecting the spectrum generation and XSPEC fitting to be the hard parts here.

DavidT3 commented 4 weeks ago

My main worry right now is the seemingly messed up spacing in RA:

image

(these are meant to be square)

Probably me screwing up some projection thing as I mentioned earlier - but does mean that in the RA direction this map's pixels overlap significantly, so that above image should not be trusted.

DavidT3 commented 4 weeks ago

The other caveats of this prototype map is that I'm not sure the background is actually working for these fits, and I am not accounting for the PSF effects (i.e. cross-arf, that is gonna be a fun one for something like this).

I also reduced the detmap resolution used to weight ARFs to make it run faster, but I'm not feeling too bad for that, as the small region size of each spectrum likely means the ARF doesn't have much spatial variation anyway.

DavidT3 commented 4 weeks ago

I also had the fear earlier that the sky coordinate systems for XMM detectors across different observations/instruments might not have the same rotation. So 'pixels' with coverage from multiple observations/instruments might not have spectra with the same region.

DavidT3 commented 4 weeks ago

As another indication of the RA woes, here are some debug images for the spectra generated (for the same ObsID-inst in this case, for demonstrative purposes) - these images represent the exact spatial selection used for the spectra. When I set the cross-hairs for all of them to match the same RA-DEC coords, we can see that the dec binning is working perfectly:

image

DavidT3 commented 4 weeks ago

But the RA alignment is way off:

image

In the RA direction each pixel will be overlapping by almost half...

DavidT3 commented 4 weeks ago

But then an equally spaced grid overlaid by DS9 looks like this:

image

HOW DO RA-DEC MAPPING TO OTHER COORDINATE SYSTEMS ALWAYS MANAGE TO CONFUSE ME THIS MUCH?!