Action #1295
New branch in GCTAExposure::fill()
Status: | New | Start date: | 07/24/2014 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assigned To: | Lu Chia-Chun | % Done: | 0% | |
Category: | - | |||
Target version: | - | |||
Duration: |
Description
Now GCTAExposure only allows combining GCTAResponseIrf-type response functions.
We should add a conditional loop to fill a GCTAExposure cube by another CTAExposure cube.
Recurrence
No recurrence.
History
#1 Updated by Lu Chia-Chun over 10 years ago
The difficulty I have is to identify the type of cta→response(). How can I get it?
Shouldn’t we put a flag in GCTAObservation?
#2 Updated by Knödlseder Jürgen over 10 years ago
Lu Chia-Chun wrote:
The difficulty I have is to identify the type of cta→response(). How can I get it?
Shouldn’t we put a flag in GCTAObservation?
I don’t really understand what you are trying to do? You can always test the response type by checking if a dynamic_cast returns NULL.
What is exactly the purpose of filling one exposure cube from the other?
#3 Updated by Lu Chia-Chun over 10 years ago
- I want to know we are using 'irf’ or 'cube’
- Why do I want to add up two exposure cubes?
Because I don’t like the current GCTAAeff2D. I think it’s a bad format. We either should use GCTAAeff3D(detx, dety, energy) or GCTAExposure(skyx, skyy,energy). Other formats don’t make sense for me.
Knödlseder Jürgen wrote:
Lu Chia-Chun wrote:
The difficulty I have is to identify the type of cta→response(). How can I get it?
Shouldn’t we put a flag in GCTAObservation?I don’t really understand what you are trying to do? You can always test the response type by checking if a dynamic_cast returns NULL.
What is exactly the purpose of filling one exposure cube from the other?
#4 Updated by Knödlseder Jürgen over 10 years ago
Lu Chia-Chun wrote:
- I want to know we are using 'irf’ or 'cube’
Ok. In Python this is now pretty easy:
>>> import gammalib >>> obs=gammalib.GCTAObservation("crab_cntmap.fits","expcube.fits","psfcube.fits") >>> type(obs.response()) <class 'gammalib.cta.GCTAResponseCube'>
And in C++ you would do something like:
const GCTAResponseCube* cube = dynamic_cast<const GCTAResponseCube*>(obs.response()); if (cube != NULL) { ... we have a cube ...
The latter is a little time consuming, that’s why I started to add class codes so that one can use an enumerate to identify a class. This is not yet implemented for
GCTAResponse
...
- Why do I want to add up two exposure cubes?
Because I don’t like the current GCTAAeff2D. I think it’s a bad format. We either should use GCTAAeff3D(detx, dety, energy) or GCTAExposure(skyx, skyy,energy). Other formats don’t make sense for me.
I’m sure the formats still will evolve, and we will get something like GCTAAeff3D in the future. So if I understand you correctly, you want to export the H.E.S.S. data in a format similar to the exposure cube? It would then be better to create a new GCTAAeffxxx class for that. Then we’re back to our old question on how to store the data. Sky coordinates or instrument coordinates? The actual code uses instrument coordinates, hence access in that format would be easier.