cositools / cosipy

The COSI high-level data analysis tools
Apache License 2.0
3 stars 16 forks source link

Error propagation in spectral fit when position is free #84

Open eneights opened 9 months ago

eneights commented 9 months ago

When propagating the error for the fitted spectrum, there is an error if the source position is free in the fit (see PR #78).

We define results_err = results.propagate(results.optimized_model["source"].spectrum.main.shape.evaluate_at, **parameters) where parameters are all of the free parameters in the fit. However, evaluate_at is a method of the spectrum, so when we evaluate the spectrum at energy e flux = results_err(e), it only expects spectral parameters, and I get a key error for 'l' and 'b'.

israelmcmc commented 2 months ago

@eneights Is this still an issue?

eneights commented 1 month ago

@israelmcmc Yes, still an issue. It's on my to-do list