Commit 3cae49838af262fb512cf14822f445a8b2fd135b
1 parent
d6760e15
Fix index bug for energy dispersion computation in GResponse
Showing
1 changed file
with
3 additions
and
3 deletions
src/obs/GResponse.cpp
| ... | ... | @@ -442,7 +442,7 @@ GVector GResponse::convolve(const GModelSky& model, |
| 442 | 442 | if (model.spectral() != NULL) { |
| 443 | 443 | int offset = n_spat; |
| 444 | 444 | for (int i = 0; i < n_spec; ++i) { |
| 445 | - GModelPar& par = (*(model.spectral()))[i]; | |
| 445 | + const GModelPar& par = (*(model.spectral()))[i]; | |
| 446 | 446 | if (par.is_free() && par.has_grad()) { |
| 447 | 447 | tmp_gradients[offset+i][k] = array[index++]; |
| 448 | 448 | } |
| ... | ... | @@ -453,7 +453,7 @@ GVector GResponse::convolve(const GModelSky& model, |
| 453 | 453 | if (model.temporal() != NULL) { |
| 454 | 454 | int offset = n_spat + n_spec; |
| 455 | 455 | for (int i = 0; i < n_temp; ++i) { |
| 456 | - GModelPar& par = (*(model.temporal()))[i]; | |
| 456 | + const GModelPar& par = (*(model.temporal()))[i]; | |
| 457 | 457 | if (par.is_free() && par.has_grad()) { |
| 458 | 458 | tmp_gradients[offset+i][k] = array[index++]; |
| 459 | 459 | } |
| ... | ... | @@ -1920,7 +1920,7 @@ GVector GResponse::edisp_kerns::eval(const double& etrue) |
| 1920 | 1920 | // array |
| 1921 | 1921 | if (m_grad) { |
| 1922 | 1922 | for (int i = 0; i < m_pars.size(); ++i, ++index) { |
| 1923 | - kernels[index++] = m_pars[i]->factor_gradient(); | |
| 1923 | + kernels[index] = m_pars[i]->factor_gradient(); | |
| 1924 | 1924 | } |
| 1925 | 1925 | } |
| 1926 | 1926 | ... | ... |