Skip to content

Commit

Permalink
Merge branch 'HinodeXRT:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jslavin authored Nov 29, 2023
2 parents 9f8f9db + 7180f57 commit 22b2cda
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions xrtpy/util/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,5 @@

import astropy.time

from datetime import timedelta

# Hinode-XRT mission elapsed time "Epoch" is Sept 22, 2006 21:36:00.
epoch = astropy.time.Time("2006-09-22 21:36:00")


def xrt_data_time_to_dt(data_time, epoch):
"""
Converting data time (float64) to a datetime object.
Parameters
----------
data_time : real number (?)
Description...
epoch : `datetime.datetime`
This function will convert the requested date and time into a datetime
object in seconds from the respected launched date to collect the correct date.
"""
data_dates_dt = []
data_dates_seconds = []

for time in data_time:
t0 = data_time[0]
t1 = time
dt = t1 - t0
data_dates_dt.append(epoch + timedelta(0, dt))
data_dates_seconds.append(float((epoch + timedelta(0, dt)).strftime("%s")))
return (data_dates_dt, data_dates_seconds)

0 comments on commit 22b2cda

Please sign in to comment.