Skip to content

tofspec load error related to timestamp format #12

Description

@laurameredith

Unable to import .h5 files with tofspec load likely due to timestamp format

'2023-06-27T20:21:49-04:00' does not match format '%Y-%m-%dT%H:%M:%S+00:00'

Full information:
(py-tofspec) [laurameredith@cpu38 data]$ tofspec load -o V3_PolarChange_20230627_202149.csv --metadata V3_PolarChange_20230627_202149.h5
Traceback (most recent call last):
File "/home/u13/laurameredith/py-tofspec/bin/tofspec", line 8, in
sys.exit(main())
File "/home/u13/laurameredith/py-tofspec/lib/python3.8/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/home/u13/laurameredith/py-tofspec/lib/python3.8/site-packages/rich_click/rich_group.py", line 21, in main
rv = super().main(*args, standalone_mode=False, **kwargs)
File "/home/u13/laurameredith/py-tofspec/lib/python3.8/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/u13/laurameredith/py-tofspec/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/u13/laurameredith/py-tofspec/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/u13/laurameredith/py-tofspec/lib/python3.8/site-packages/click/core.py", line 760, in invoke
return _callback(*args, **kwargs)
File "/home/u13/laurameredith/py-tofspec/lib/python3.8/site-packages/tofspec/cli/init.py", line 72, in load
load_command(file, output, **kwargs)
File "/home/u13/laurameredith/py-tofspec/lib/python3.8/site-packages/tofspec/cli/commands/load.py", line 31, in load_command
timestamps, mass_axis, tof_data, metadata = load_vocus_data(file, metadata=metadata
)
File "/home/u13/laurameredith/py-tofspec/lib/python3.8/site-packages/tofspec/load.py", line 19, in load_vocus_data
timestamps = get_times(f)
File "/home/u13/laurameredith/py-tofspec/lib/python3.8/site-packages/tofspec/load.py", line 36, in get_times
start_time = datetime.strptime(start_time.decode('UTF-8'), "%Y-%m-%dT%H:%M:%S+00:00")
File "/opt/ohpc/pub/apps/python/3.8.2/lib/python3.8/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "/opt/ohpc/pub/apps/python/3.8.2/lib/python3.8/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2023-06-27T20:21:49-04:00' does not match format '%Y-%m-%dT%H:%M:%S+00:00'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions