gammasky / cta-dc

CTA data challenge 2017
BSD 3-Clause "New" or "Revised" License
1 stars 5 forks source link

Fix image_sources/ctadc_skymodel_gps_sources_images.xml #8

Closed cdeil closed 7 years ago

cdeil commented 7 years ago

@robertazanin - I've fixed a few formatting issues i image_sources/ctadc_skymodel_gps_sources_images.xml. Now the model file fails to load by ctools because it contains a SmoothBrokenPowerLaw, which is not a ctools model:

https://github.com/gammasky/cta-dc/blob/ea85ee4532cb256efc1f97d8391ccc94214fe94e/sky_model/image_sources/ctadc_skymodel_gps_sources_images.xml#L60

$ python -c 'import gammalib; gammalib.GModels("image_sources/ctadc_skymodel_gps_sources_images.xml")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/gamma/lib/python3.5/site-packages/gammalib/model.py", line 283, in __init__
    this = _model.new_GModels(*args)
ValueError: *** ERROR in GModelSpectralRegistry::alloc(GXmlElement&): Invalid value. Spectral model of type "SmoothBrokenPowerLaw" not found in registry. Possible spectral model types are: "BrokenPowerLaw" "BrokenPowerLaw" "Constant" "ConstantValue" "ExponentialCutoffPowerLaw" "ExponentialCutoffPowerLaw" "ExpCutoff" "SuperExponentialCutoffPowerLaw" "PLSuperExpCutoff" "FileFunction" "Gaussian" "LogParabola" "LogParabola" "LogParabola" "Multiplicative" "NodeFunction" "PowerLaw" "PowerLaw" "PowerLaw" "PowerLaw2" "PowerLaw" "Composite".

In the future, please try to always do this check for XML model files ... see if they parse by ctools. I'll do the same thing from now on.

cdeil commented 7 years ago

This is working in master now. It must have been fixed a while ago.