Feature #754

Allow fitting of elliptical morphology shapes

Added by Mayer Michael almost 12 years ago. Updated about 10 years ago.

Status:ClosedStart date:02/16/2013
Priority:NormalDue date:02/22/2013
Assigned To:-% Done:

100%

Category:-Estimated time:10.00 hours
Target version:1.0.0
Duration: 7

Description

Many of the extended VHE gamma-ray sources are asymmetric. Therefore, as a first step, we could implement analytical, asymmetric models like a 2D-Gaussian with different widths. As far as I can evaluate this, a new class, e.g. GModelSpatialAsymGaussian, which inherits from GModelSpatial would be necessary.
After introducing this new class one might think about adjusting the function GResponse::irf(). As far as I understand, only classes of type GModelRadial are supported as extended sources. One would also need to allow asymmetric models. As a consequence, do we also need GModelAsymmetric as a new base class for further implementations?

Do you think this implementation would be very easy, or do we have to consider more things I am not aware of?

GModelSpatial.jpg (60.6 KB) Knödlseder Jürgen, 02/14/2013 08:42 PM

GModelElliptical.png (20.4 KB) Mayer Michael, 02/15/2013 03:13 PM

Gmodelspatial Gmodelelliptical

Recurrence

No recurrence.


Subtasks

Action #761: Implement GModelSpatialEllipticalDisk classClosedMayer Michael

Action #784: Improve GCTAResponse integration methods for elliptical s...ClosedKnödlseder Jürgen

Action #758: Adapt GResponse to support elliptical modelsClosedKnödlseder Jürgen

Action #759: Implement GCTAResponse::irf_ellipticalClosedKnödlseder Jürgen

Action #760: Implement GCTAResponse::npred_ellipticalClosedKnödlseder Jürgen

Action #755: Implement GModelSpatialElliptical base classClosedKnödlseder Jürgen

History

#1 Updated by Deil Christoph almost 12 years ago

Jürgen, FYI, I am considering switching the HESS Galactic plane survey catalog pipeline from Sherpa to gammalib.
What is missing as far as I see is elongated source models and on-off-likelihood.
I have a student starting next week and hope we’ll finally get around to implementing the things we talked about last fall for gammalib, but it’s not clear if we will.

So +10 on implementing this in gammalib from my side.

#2 Updated by Knödlseder Jürgen almost 12 years ago

Here the inheritance diagram of GModelSpatial:

There is a class named GModelSpatialMap that is used for general extended models that are represented by skymaps. These models are however non-parametric.

When introducing a new base class, the first question is: will there be different asymmetric models that share common features? I guess the answer is yes, but maybe we should first specify what exactly is needed. What does asymmetric mean in your view? Elliptical shapes? Or something more complex.

If you want elliptical shapes, maybe a better name would be GModelElliptical. I agree that it would be very nice to have those, but implementation of these models for unbinned analysis will require quite some mathematics to be worked out (one has to integrate over the elliptical shape in an efficient way). This comes into play once the npred method needs to be implemented. Maybe there are clever ways to perform integrals over elliptical areas, some reading is probably needed here.

#3 Updated by Mayer Michael almost 12 years ago

  • File GModelElliptical.png added
  • Subject changed from allow fitting of asymmetric morphology shapes to allow fitting of elliptical morphology shapes

With asymmetric I meant elliptical in the first place . You are right, we need to define what kind of models are needed. I think we also have to draw a line, where a model gets too complex to be handled and a spatial map is more appropriate.

Therefore, my first suggestion would be the following structure:

I intensionally incorporated something like the Landau distribution - this will be a headache for sure. But in case of e.g. HESS J1825-137 showing a non-centre peaked distribution with a long tail, such a function would give a good parameterisation.
In practice, especially in this stage, nothing more than GModelEllipticalDisk and GModelEllipticalGaus would be needed for basic analyses. Of course, as Jürgen said, the mathematics in these cases is still something to get familiar with.

#4 Updated by Knödlseder Jürgen almost 12 years ago

Looks good. And I have nothing against being ambitious :) Once this is in place it will be fantastic.

Only for the Gauss, I propose we add a second s at the end for consistency.

So to summarize: an elliptical model would have (at least) 5 parameters:
  • 2 for the centre position
  • 1 for position angle
  • (at least) 2 for width along and perpendicular to the position angle (an elliptical shell will be more complicated)

#5 Updated by Deil Christoph almost 12 years ago

I agree, Gauss and disk are the most (only?) commonly used elongated models, so that’s the place to start.

Before you invest a lot of time: are you sure that it’s better to have separate classes instead of only having elongated Gaussians and disks where the symmetric versions are a special case?
This is how Sherpa and HAP / ParisAnalysis in the HESS software all do it:
http://cxc.harvard.edu/sherpa/ahelp/gauss2d.html

But I guess in the case of gammalib having separate classes would be better?
(I don’t understand how unbinned fitting on the sphere works, so I have no idea what math / computations this implies.)

#6 Updated by Mayer Michael almost 12 years ago

I absolutely agree to add an s to Gaus :)
Yes, the elongated Gaussian would have these 5 parameters. Maybe for this one we can learn from HESS and/or Sherpa. I didn’t even think about an elliptcial shell, but this would be very interesting. Indeed, these radial models are special cases of the elliptical ones, which would justify inheritations. But I don’t have a strong opinion on that.

#7 Updated by Knödlseder Jürgen almost 12 years ago

I think it’s better to have separate classes, since the computations will be quite different at the end. Having a special elliptical categorie will allow implementing optimised methods for elliptical models, while the radial models will have their own optimizations. Also, the XML parameter interface would be different for symmetric and elliptical models, and this is easier to handle by specific classes.

But some more thinking is needed for the global model organisation, as the radial models are actually the only possible spatial component of extended models. Probably we can add a branching point here (allowing the spatial component to be of type radial or elliptical), but I need to check the code and interfaces to see whether this needs some modifications.

Concerning the unbinned fitting, the models have to be integrated over a region of interest. The region of interest is a circle, and for radial models I had to work out the intersection of the circular model with the circular ROI (hence the intersection between 2 circles needed to be found). Now we have to work out the intersection of an ellipse with a circle, and then make sure that the integral is only taken over the intersection region.

#8 Updated by Deil Christoph almost 12 years ago

This sounds like a lot of work to make unbinned fitting with elliptical models work.
For the HESS Galactic plane survey I use ROIs of approx. 10 x 5 deg, i.e. rectangles where I fit groups of overlapping sources.
So this would not be possible with gammalib because only circular ROIs are supported?

In the end, do we need unbinned fitting?
Some reference points: Sherpa only has binned fitting and as I understand it it’s also out of fashion for Fermi, it was never available in the HESS software.

On the other hand, unbinned fitting was initially the cool thing I was excited about and looked at gammalib.
And probably if per-event position errors can be taken into account in the likelihood function somehow, a quite large gain in sensitivity could be obtained.
Maybe not everything (like elliptical models or rectangular ROIs) has to be possible in unbinned mode?

#9 Updated by Knödlseder Jürgen almost 12 years ago

Well, it’s some work, but I won’t qualify this as a lot :) But I think it’s worth the investment (you have to sweat just once, when it’s done it’s pretty cool, as you say).

In fact, the npred method has even not to be implemented, as a default method exists in the base class, see GResponse::npred_extended. The only reason for overloading this method and for calculating the intersection between the ROI and the model is efficiency.

Concerning the circular ROI, there is one ROI per observation (or run), and since the field of view is basically circular, a circular ROI should be fine. I guess your 10x5 deg regions are after combining the data, but for unbinned, nothing is combined.

#10 Updated by Knödlseder Jürgen almost 12 years ago

  • Subject changed from allow fitting of elliptical morphology shapes to Allow fitting of elliptical morphology shapes

#11 Updated by Knödlseder Jürgen almost 12 years ago

I added a couple of subtasks that specify more precisely what needs to be done.

#12 Updated by Knödlseder Jürgen almost 12 years ago

  • Target version set to HESS sprint #1

#13 Updated by Knödlseder Jürgen almost 12 years ago

  • Status changed from New to In Progress

#14 Updated by Knödlseder Jürgen almost 12 years ago

I implemented now the handling of elliptical source models in the CTA response class.

What is missing now is the coding of an elliptical source model to test the code. Michael, are you willing to implement an elliptical disk model? See action #761.

Once we have this model we can test the code and make sure that it works correctly.

#15 Updated by Mayer Michael almost 12 years ago

Yes, I’ll start.

#16 Updated by Mayer Michael almost 12 years ago

  • Due date set to 02/22/2013

due to changes in a related task

#17 Updated by Knödlseder Jürgen over 11 years ago

  • Target version changed from HESS sprint #1 to 00-08-00

#18 Updated by Knödlseder Jürgen about 11 years ago

  • Target version deleted (00-08-00)

#19 Updated by Knödlseder Jürgen over 10 years ago

  • Target version set to 1.0.0

#20 Updated by Knödlseder Jürgen about 10 years ago

  • Status changed from In Progress to Closed

We now have an elliptical disk model that works.

Also available in: Atom PDF