For example, when converting an MET to datetime, I use
from gdt.missions.fermi.time import Timet1 = Time(trigtime, format='fermi', scale='utc').datetime
This object does not have timezone information and when comparing to another datetime object, e.g.,
t2 = datetime.datetime(y, m, d, dt, tzinfo=datetime.timezone.utc),
I receive this error: TypeError: can't compare offset-naive and offset-aware datetimes
However, in the GBM Data Tools, when using
from gbm.time import Mett = Met(met)
This automatically returns a datetime object with the UTC timezone specified:
self.__time.utc.to_datetime(datetime.timezone.utc)
It would be nice to have this capability in the GDT without having to call
from gdt.missions.fermi.time import Timet1 = Time(trigtime, format='fermi', scale='utc')t1 = t1.to_datetime(datetime.timezone.utc)
For example, when converting an MET to datetime, I use
from gdt.missions.fermi.time import Time
t1 = Time(trigtime, format='fermi', scale='utc').datetime
This object does not have timezone information and when comparing to another datetime object, e.g.,
t2 = datetime.datetime(y, m, d, dt, tzinfo=datetime.timezone.utc)
,I receive this error:
TypeError: can't compare offset-naive and offset-aware datetimes
However, in the GBM Data Tools, when using
from gbm.time import Met
t = Met(met)
This automatically returns a datetime object with the UTC timezone specified:
self.__time.utc.to_datetime(datetime.timezone.utc)
It would be nice to have this capability in the GDT without having to call
from gdt.missions.fermi.time import Time
t1 = Time(trigtime, format='fermi', scale='utc')
t1 = t1.to_datetime(datetime.timezone.utc)