diff --git a/geomagio/residual/SpreadsheetAbsolutesFactory.py b/geomagio/residual/SpreadsheetAbsolutesFactory.py index 1f50f794faff107c7663f9c7db9ba947749a1c1b..00e3d4c4e4f117c7c9b259febd4d4d94fdf92e61 100644 --- a/geomagio/residual/SpreadsheetAbsolutesFactory.py +++ b/geomagio/residual/SpreadsheetAbsolutesFactory.py @@ -320,22 +320,46 @@ class SpreadsheetAbsolutesFactory(object): degrees=sheet["C12"].value, minutes=sheet["D12"].value ), baseline=Angle.from_dms(minutes=sheet["F12"].value), - endtime=parse_relative_time(base_date, sheet["B12"].value), - starttime=parse_relative_time(base_date, sheet["B12"].value), + endtime=parse_relative_time( + # base_date is already a string; sheet "times" are ints + base_date, + "{:04d}".format(sheet["B12"].value), + ), + starttime=parse_relative_time( + # base_date is already a string; sheet "times" are ints + base_date, + "{:04d}".format(sheet["B12"].value), + ), ), Absolute( element="H", absolute=sheet["C17"].value, baseline=sheet["F17"].value, - endtime=parse_relative_time(base_date, sheet["B17"].value), - starttime=parse_relative_time(base_date, sheet["B17"].value), + endtime=parse_relative_time( + # base_date is already a string; sheet "times" are ints + base_date, + "{:04d}".format(sheet["B17"].value), + ), + starttime=parse_relative_time( + # base_date is already a string; sheet "times" are ints + base_date, + "{:04d}".format(sheet["B17"].value), + ), ), Absolute( element="Z", absolute=sheet["C22"].value, baseline=sheet["F22"].value, - endtime=parse_relative_time(base_date, sheet["B22"].value), - starttime=parse_relative_time(base_date, sheet["B22"].value), + endtime=parse_relative_time( + # base_date is already a string; sheet "times" are ints + base_date, + "{:04d}".format(sheet["B22"].value), + ), + starttime=parse_relative_time( + # base_date is already a string; sheet "times" are ints + base_date, + "{:04d}".format(sheet["B22"].value), + ), ), ] return absolutes @@ -355,7 +379,11 @@ class SpreadsheetAbsolutesFactory(object): residual = "residual" in m and sheet[m["residual"]].value or None time = ( "time" in m - and parse_relative_time(base_date, sheet[m["time"]].value) + and parse_relative_time( + # base_date is already a string; sheet "times" are ints + base_date, + "{:06d}".format(sheet[m["time"]].value), + ) or None ) h = "h" in m and sheet[m["h"]].value or None