Closed zimmerst closed 4 years ago
for completeness, with this config, I get the following binning
dictionary:
{'binsperdec': 8.0,
'binsz': 0.1,
'coordsys': 'CEL',
'enumbins': None,
'hpx_ebin': True,
'hpx_order': 10,
'hpx_ordering_scheme': 'RING',
'npix': None,
'proj': 'AIT',
'projtype': 'HPX',
'roiwidth': 20.0}
Just a side note: this is very confusing, suggesting an axis ordering issue:
ValueError: Wrong shape for input data array. Expected (95582, 95582, 31) but got (31, 200, 200)
But actually it was just the error message that printed the shape with two different axis orders. I improved this in https://github.com/gammapy/gammapy/pull/1346/files#diff-e3f81d40e68a44a1d6cf5207f0e98aeaR39
It still leaves the issue in Fermipy reported by @zimmerst here. Should HPX work for that computation, or is it just not supported?
@adonath and I are about to release Gammapy v0.8; it would be good to know if this issue has been resolved.
@zimmerst or @dimauromattia - Could you please have a look? Maybe even add a regression test in Fermipy that shows if there is or isn't an issue with HPX maps in gammapy.maps?
@cdeil Thanks for the update. I'll need a moment to change back to my HealPix based analysis. I had abandoned this path a few months ago so I first need to reset myself to see if this has been resolved in GammaPy.
I tried the development versions of gammapy & fermipy respectively:
print "fermipy: %s -- gammapy: %s"%(fermipy.__version__, gammapy.__version__)
fermipy: 0.17.3+17.g6cbb -- gammapy: 0.8.dev7133
the code still crashes when calling gta.setup() but differently than before, for the first time revealing what seems to be the underlying cause:
2018-08-31 08:25:37 INFO GTBinnedAnalysis._create_binned_analysis(): Creating BinnedAnalysis for component 00.
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-3-1e27b2b06e27> in <module>()
----> 1 gta.setup()
/root/.local/lib/python2.7/site-packages/fermipy/gtanalysis.pyc in setup(self, init_sources, overwrite, **kwargs)
1042
1043 # Create likelihood
-> 1044 self._create_likelihood()
1045
1046 # Determine tmin, tmax
/root/.local/lib/python2.7/site-packages/fermipy/gtanalysis.pyc in _create_likelihood(self, srcmdl)
1067 self._like = SummedLikelihood()
1068 for c in self.components:
-> 1069 c._create_binned_analysis(srcmdl)
1070 self._like.addComponent(c.like)
1071
/root/.local/lib/python2.7/site-packages/fermipy/gtanalysis.pyc in _create_binned_analysis(self, xmlfile, **kwargs)
5289 self.logger.debug(kw)
5290
-> 5291 self._obs = ba.BinnedObs(**utils.unicode_to_str(kw))
5292
5293 # Create BinnedAnalysis
/home/ScienceTools/python/BinnedAnalysis.py in __init__(self, srcMaps, expCube, binnedExpMap, irfs, phased_expmap)
59 self.irfs = irfs
60
---> 61 pyLike.AppHelpers_checkExposureMap(srcMaps, binnedExpMap)
62 # EAC switch to using AppHelpers...
63 self.countsMap = pyLike.AppHelpers_readCountsMap(srcMaps)
/home/ScienceTools/python/pyLikelihood.py in AppHelpers_checkExposureMap(*args)
3548 def AppHelpers_checkExposureMap(*args):
3549 """AppHelpers_checkExposureMap(string cmapfile, string emapfile)"""
-> 3550 return _pyLikelihood.AppHelpers_checkExposureMap(*args)
3551
3552 def AppHelpers_checkExposureMap_wcs(*args):
RuntimeError: HistND::setSlice:
length of input data != histogram slice size.
Addendum: in the log file from the preparation stage, I found this line:
"2018-08-30 06:40:14 DEBUG GTBinnedAnalysis._create_expcube(): Skipping local gtexpcube for HEALPix"
Can someone explain to me why there's no local gtexpcube? Shouldn't this one still be generated, regardless of the projection?
That looks like a Fermi ST problem, I have no idea there.
If you can find an issue where you think the problem is in gammapy.maps
, please let me know, and if you can, please try to extract a snipped of Gammapy code that lets me reproduce the issue.
@cdeil I agree... I'm trying to get more information on the issue and will keep you posted.
Hi, this could be seen as clone of #203, which I just closed.
While I confirmed that gta.setup() works fine for arbitrary WCS projections with the 'component'-type summed likelihood, it seems that the current fermipy version does not support this when moving to healpix-based binning.
this is my configuration:
I can initialize the GTAnalysis object as usual:
and then call
gta.setup()
but then things crash violently:
without having looked at the code in detail, the 2nd last item in the call-back suggests that the code crashed outside the HPX frame (since it never executed the
elif p_method == 1: #HPX
instruction)