cositools / cosipy

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

Spectral fitting issue with SpacecraftFile dwell time map #91

Closed eneights closed 8 months ago

eneights commented 8 months ago

The spectral fit (SpectralFit.ipynb) is converging incorrectly after PR #79. The_get_dwell_time_map function in COSILike.py now uses get_dwell_map from SpacecraftFile, which outputs a different dwell time map than before. I suspect the problem might have to do with the coordinate system transformation.

Yong2Sheng commented 8 months ago

Hi Eliza, could you please tell me the difference? Did you used the exact same orientation response and source location?

Thank you!

eneights commented 8 months ago

Hi @Yong2Sheng, the only difference is the _get_dwell_time_map function in COSILike.py (lines 174-175). If I replace these lines with the code that was there previously (see lines 169-185 in PR #78), it outputs a different dwell time map and the spectral fit works again. Everything else is exactly the same.

Yong2Sheng commented 8 months ago

OK, thanks! I will take a look at it.

eneights commented 8 months ago

Fixed in PR #93 by getting rid of sc_orientation.frame = 'icrs' when opening orientation file