Commit 969f44e3 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: FMRIB loader sets timezone (although not taking into account summer time)

parent 7b795f6a
......@@ -10,7 +10,7 @@ which contain data on imaged subjects.
import functools as ft
import datetime
import datetime as dt
import calendar
import pandas as pd
......@@ -50,19 +50,20 @@ def load_FMRIBImaging(infile):
year = int(date[ :4])
month = int(date[4:6])
day = int(date[6:8])
return, month, day)
return, month, day)
def parse_acq_time(time):
hour = int(time[ :2])
minute = int(time[2:4])
second = int(time[4:6])
micro = int(time[7:])
return datetime.time(hour, minute, second, micro)
return dt.time(hour, minute, second, micro,
def combine_datetime(date, time):
date = date.to_pydatetime().date()
time = time.to_pydatetime().time()
return datetime.datetime.combine(date, time)
time = time.to_pydatetime().timetz()
return dt.datetime.combine(date, time)
names = ['eid',
......@@ -82,7 +83,9 @@ def load_FMRIBImaging(infile):
print('origtime', df['acq_time'])
df['acq_time'] = df['acq_date'].combine(df['acq_time'], combine_datetime)
print('combined', df['acq_time'])
df.drop('acq_date', axis=1, inplace=True)
return df
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment