From 8139b97c47826ecff487fe5c5c179f8bdeae7174 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Wed, 22 Jan 2014 20:54:28 +0100 Subject: [PATCH] Correct identifier writing. --- ChangeLog | 6 +++--- NEWS | 10 +++++++--- inst/cta/src/GCTAModelBackground.cpp | 7 +++++-- inst/cta/src/GCTAModelRadialAcceptance.cpp | 9 ++++++++- src/model/GModelSky.cpp | 4 ++++ 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ac6703..f27ae30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,12 @@ -2014-01-21 Juergen Knoedlseder +2014-01-22 Juergen Knoedlseder * Bug fix Version 0.8.1 released ================================ Added missing hyphens in pfiles synchronisation section (#1091) Add configuration test script (#1091) - GCTAModelBackground writes out run ids in XML file (#1092) - + GModelSky, GCTAModelBackground and GCTAModelRadialAcceptance write + id attribute into XML file (#1092) 2014-01-18 Juergen Knoedlseder diff --git a/NEWS b/NEWS index b57c79b..0658e92 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ New Features and Important Changes in GammaLib 00-08-01 Author(s) : Juergen Knoedlseder -21 January 2014 +22 January 2014 1. Introduction @@ -49,7 +49,8 @@ None 8. Model module --------------- -None +The GModelSky class now writes the id attribute to the XML file in case +that identifiers are specified. 9. Numerics module @@ -109,7 +110,10 @@ None 20. CTA interface ----------------- -None +The GCTAModelBackground and GCTAModelRadialAcceptance classes now write +the id attribute to the XML file in case that identifiers are specified. +Furthermore, GCTAModelRadialAcceptance no longer write the temporal +model component. 21. COMPTEL interface diff --git a/inst/cta/src/GCTAModelBackground.cpp b/inst/cta/src/GCTAModelBackground.cpp index c5e459f..2901adb 100644 --- a/inst/cta/src/GCTAModelBackground.cpp +++ b/inst/cta/src/GCTAModelBackground.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCTAModelBackground.cpp - Generic CTA background model class * * ----------------------------------------------------------------------- * - * copyright (C) 2013 by Michael Mayer * + * copyright (C) 2013-2014 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -846,10 +846,13 @@ void GCTAModelBackground::write(GXmlElement& xml) const // Set model type, name and optionally instruments src->attribute("name", name()); src->attribute("type", type()); - src->attribute("ids",ids()); if (instruments().length() > 0) { src->attribute("instrument", instruments()); } + std::string identifiers = ids(); + if (identifiers.length() > 0) { + src->attribute("id", identifiers); + } // Write spectral model if (spectral() != NULL) { diff --git a/inst/cta/src/GCTAModelRadialAcceptance.cpp b/inst/cta/src/GCTAModelRadialAcceptance.cpp index 8f06aff..007f8bd 100644 --- a/inst/cta/src/GCTAModelRadialAcceptance.cpp +++ b/inst/cta/src/GCTAModelRadialAcceptance.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCTAModelRadialAcceptance.cpp - Radial acceptance model class * * ----------------------------------------------------------------------- * - * copyright (C) 2011-2013 by Juergen Knoedlseder * + * copyright (C) 2011-2014 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -714,6 +714,7 @@ void GCTAModelRadialAcceptance::write(GXmlElement& xml) const src = xml.append("source"); if (spectral() != NULL) src->append(GXmlElement("spectrum")); if (radial() != NULL) src->append(GXmlElement("radialModel")); + //if (temporal() != NULL) src->append(GXmlElement("temporalModel")); } // Set model type, name and optionally instruments @@ -722,6 +723,10 @@ void GCTAModelRadialAcceptance::write(GXmlElement& xml) const if (instruments().length() > 0) { src->attribute("instrument", instruments()); } + std::string identifiers = ids(); + if (identifiers.length() > 0) { + src->attribute("id", identifiers); + } // Write spectral model if (spectral() != NULL) { @@ -736,12 +741,14 @@ void GCTAModelRadialAcceptance::write(GXmlElement& xml) const } // Write temporal model + /* if (temporal()) { if (dynamic_cast(temporal()) == NULL) { GXmlElement* temp = src->element("lightcurve", 0); temporal()->write(*temp); } } + */ // Return return; diff --git a/src/model/GModelSky.cpp b/src/model/GModelSky.cpp index 4adeb51..30d6383 100644 --- a/src/model/GModelSky.cpp +++ b/src/model/GModelSky.cpp @@ -738,6 +738,10 @@ void GModelSky::write(GXmlElement& xml) const if (instruments.length() > 0) { src->attribute("instrument", instruments); } + std::string identifiers = ids(); + if (identifiers.length() > 0) { + src->attribute("id", identifiers); + } // Write spectral model if (spectral() != NULL) { -- libgit2 0.21.4