Commit ace77fabe0bc2848ad105944ec54483199dc5972

Authored by Jürgen Knödlseder
1 parent 2db20761

Extend the tool to all model parameters.

Showing 1 changed file with 6 additions and 6 deletions
src/cterror/cterror.cpp
@@ -261,14 +261,14 @@ void cterror::run(void) @@ -261,14 +261,14 @@ void cterror::run(void)
261 throw GException::invalid_value(G_RUN, msg); 261 throw GException::invalid_value(G_RUN, msg);
262 } 262 }
263 263
264 - // Get number of spectral parameters  
265 - int npars = model->spectral()->size(); 264 + // Get number of parameters
  265 + int npars = model->size();
266 266
267 - // Loop over spectral parameters of sky model 267 + // Loop over parameters of sky model
268 for (int i = 0; i < npars; ++i) { 268 for (int i = 0; i < npars; ++i) {
269 269
270 // Skip parameter if it is fixed 270 // Skip parameter if it is fixed
271 - if (model->spectral()->at(i).is_fixed()) { 271 + if (model->at(i).is_fixed()) {
272 continue; 272 continue;
273 } 273 }
274 274
@@ -278,7 +278,7 @@ void cterror::run(void) @@ -278,7 +278,7 @@ void cterror::run(void)
278 // Get pointer on sky model parameter 278 // Get pointer on sky model parameter
279 GModels& current_models = const_cast<GModels&>(m_obs.models()); 279 GModels& current_models = const_cast<GModels&>(m_obs.models());
280 GModelSky* current_model = dynamic_cast<GModelSky*>(current_models[m_srcname]); 280 GModelSky* current_model = dynamic_cast<GModelSky*>(current_models[m_srcname]);
281 - m_model_par = &(current_model->spectral()->at(i)); 281 + m_model_par = &(current_model->at(i));
282 282
283 // Extract current value 283 // Extract current value
284 m_value = m_model_par->factor_value(); 284 m_value = m_model_par->factor_value();
@@ -352,7 +352,7 @@ void cterror::run(void) @@ -352,7 +352,7 @@ void cterror::run(void)
352 } 352 }
353 353
354 // Save error result 354 // Save error result
355 - model->spectral()->at(i).factor_error(m_error); 355 + model->at(i).factor_error(m_error);
356 356
357 } // endfor: looped over spectral parameters 357 } // endfor: looped over spectral parameters
358 358