chatcannon/pytnt — pull request #2 by thevorpalblade (2014-08-20 22:25:56+00:00)
Title: Code to parse Delay Tables

I've added some code to read in the delay tables in tnt files. Given that the format of the pulse sequence section of the file is in constant flux, it seemed that the best way to do this was by searching for anything that looks like the name of a delay table and parsing the data around it.
I do some minor sanity checks (checking that the delay table is of length more than one) before reading them into an ordinary (unordered, in this case) dictionary, following the current convention.

I also added a utility function that converts lists like ['1u', '2u', '3u'] to array([1e-6, 2e-6, 3e-6]),
since many of the delay tables are stored in the former format.
I've only tested it with files generated by our version of tnmr (2.11 or so), but the approach _should_ be fairly robust.

Let me know if there is anything I should change function or style-wise!