Skip to content

importing with from_Solis fails for acquired data timestamped with fractional seconds. #1246

Description

@DLafayetteII

My new combination of Andor software with Ikon-M camera takes data where the date and time is recorded as such:
Date and Time: Tue Jun 30 10:44:22.653 2026
In WrightTools.data.from_Solis(), we take this string and throw it into time.strptime('Tue Jun 30 10:44:22.06 2026', "%a %b %d %H:%M:%S %Y"), which throws an error while the seconds has decimals:
"ValueError: time data 'Tue Jun 30 10:44:22.06 2026' does not match format '%a %b %d %H:%M:%S %Y'"
Previous data (from the Wright Group PL Table) was not exported with fractional seconds in the timestamp, so there was no issue.

While the time library does have the option of using %f to assign a value in microseconds, it does not appear that time.strptime cares about microseconds, so this information is discarded, we just want it to not stop the import. There are many ways to do this:

  1. We could have a try and accept specific to this case
  2. Given that we already assume the time format, we could separate the seconds portion of the string, round it, and recombobulate the string
  3. We could loop and check that all numerical time components are nondecimal floats.

Given that this will make our code viable for use with new setups, it seems worthwhile to address. I can implement the update pending input on the preferred approach.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions