Change request #1824

Add model parameters to spectral registry handling

Added by Knödlseder Jürgen over 8 years ago. Updated over 8 years ago.

Status:ClosedStart date:07/22/2016
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.1.0
Duration:

Description

So far, each model in a spectral registry is identified by it’s name which is extracted from the type() method of the model (the same is true for the other registries, in particular the spatial registry).

It is proposed to add the parameter names of each model to the registry so that the XML parser can allocate the right class based on a combination of model type and model parameters (see #1821).

Thinking about the possible implementation, it occurred to me that the actual model name needs not to be stored in the registry class (as it is done now), since it can in fact be extracted from the model’s type. In the same way, the parameters can be extracted from the model class through the model parameter access operator. Hence the only thing that is needed is a replacement of the

GModelSpectralRegistry::alloc(const std::string& name)
method by a
GModelSpectralRegistry::alloc(const GXmlElement& spectral)
that is called in the GModelSky::xml_spectral method. The new GModelSpectralRegistry::alloc method would then determine all parameter names in the XML file and search for an appropriate class in the registry.

To allow for legacy parameter names in a spectral parameter (for example the existence of both the Scale and the PivotEnergy parameter names) it would be sufficient to create a type and parameter name constructor for each spectral class that takes as input the type and parameter name strings.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 8 years ago

  • Assigned To set to Knödlseder Jürgen
  • Target version set to 1.1.0

#2 Updated by Knödlseder Jürgen over 8 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

The change was done, merged into devel.

Also available in: Atom PDF