TCDSolar / stixpy

STIX data analysis in python
https://stixpy.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
17 stars 20 forks source link

Units on timeseries `.plot` and `.quantity` are inconsistent #104

Closed wtbarnes closed 4 months ago

wtbarnes commented 5 months ago

When I extract a quantity from a STIX quicklook lightcurve using .quantity, the units are in ct. However, when I visualize that same data with peek or plot, the y-label says the units are ct s-1 keV-1. The latter appears to be hardcoded in the plot method.

samaloney commented 4 months ago

Thanks for reporting, yes the raw data is ct but often for plotting want it in ct s-1 keV-1 or even ct s-1 keV-1 cm-2. I'm not sure what to do here as I dont think there's a way to support different units in Timeseries? I guess as a hack I could create addition columns for the different units counts: ct, count_rate: ct s-1, differential_count_rate: ct s-1 keV-1, differential_count_flux: ct s-1 keV-1 cm-2.

samaloney commented 4 months ago

There is also a bug in the code which I will fix where the units are hardcoded to be ct but the data are converted to ct s-1 keV-1 during loading.