Skip to main content

Lifespec FL

Parse .FL files from a Lifespec TRPL machine.

Install with python -m pip install lifespec-fl

Parser

The lifespec_fl.parse(<file>) method is used to parse a .FL file. This is the main function of this package.

File format description

Parsing the .FL binary file uses the parse_binary_file package. This package uses configuration files to describe the structure of a binary file format for parsing.

You can find this configuration file at lifespec_fl/data/fl_descriptor.yaml.

CLI

Installs a command line interface (CLI) named lifespec_fl that can be used to convert .FL files to .csv.

Example

Library

import pandas as pd
import lifespec_fl as fl


# parse the 'my_trpl.FL' file
(counts, data) = fl.parse('my_trpl.FL')

# place counts into a pandas Series
df = pd.Series(counts[:, 1], index = counts[:, 0])

CLI

Convert all .FL files in the current directory to .csv.

lifespec_fl

Convert all .FL files ending in trpl in the current directly into a single .csv.

lifespec_fl --join *trpl.FL

File Format Notes

  • 3 lines separated by \r\n (0d0a)
  • Little Endian
  • latin-1 encoded
  • Heads of lines 1 and 2 follow similar pattern

Line 0 (0x00 - 0x14, 0x15 bytes)

EAI Multiple Scans null terminated (0x00) string followed by \r\n

Line 1 (0x15 - 0x60, 0x4d bytes)

head (0x34 bytes)

  1. bytes 0x00 - 0x01 (0x02 bytes): dc05
  2. bytes 0x02 - 0x05 (0x04 bytes): 0000 0033
  3. bytes 0x06 - 0x09 (0x04 bytes): 0000 0096
  4. bytes 0x0a - 0x10 (0x07 bytes): null
  5. bytes 0x11 - 0x14 (0x04 bytes): Stop time as a float
  6. bytes 0x15 - 0x19 (0x05 bytes): X axis label (e.g. 'Time') as a null terminated string
  7. bytes 0x1a - 0x1c (0x03 bytes): Time scale (e.g. 'ns', 'us') as a null terminated string
  8. bytes 0x1d - 0x20 (0x04 bytes): null
  9. bytes 0x21 - 0x24 (0x04 bytes): ?, possibly no. of counts in 1000 as float
  10. bytes 0x25 - 0x2b (0x07 bytes): Y axis label (e.g. 'Counts') as a null terminated string
  11. bytes 0x2c - 0x33 (0x08 bytes): '1.4.5.0' null terminated string, version?

body

  1. bytes 0x36 - 0x3d (0x08 bytes): Seems to always be 6400 0000 0100 0000
  2. bytes 0x3e - 0x4c (0x0d bytes): Scan type as null terminated string
  3. bytes 0x4d - 0x4e (0x02 bytes): \r\n to end line

Line 2 (0x61 - end)

head (0x34 bytes)

  1. bytes 0x00 - 0x01 (0x02 bytes): 8813
  2. bytes 0x02 - 0x06 (0x04 bytes): ?, float
  3. bytes 0x07 - 0x09 (0x04 bytes): 0100 0096, control sequence?
  4. bytes 0x0a - 0x10 (0x07 bytes): null
  5. bytes 0x11 - 0x14 (0x04 bytes): Stop time as a float
  6. bytes 0x15 - 0x19 (0x05 bytes): X axis label (e.g. 'Time') as a null terminated string
  7. bytes 0x1a - 0x1c (0x03 bytes): Time scale (e.g. 'ns', 'us') as a null terminated string
  8. bytes 0x1d - 0x24 (0x08 bytes): null
  9. bytes 0x25 - 0x2b (0x07 bytes): Y axis label (e.g. 'Counts') null terminated string
  10. bytes 0x2c - 0x33 (0x08 bytes): '1.4.5.0' null terminated string, version?

body

  1. Original file name, null terminated
  2. (0x01 bytes) 2c
  3. (0x04 bytes) 0100 0000, control secquence?
  4. (0x02 bytes) 0400
  5. (0x02 bytes) null
  6. (0x0f bytes) ?
  7. (0x02 bytes) 4090, control sequence?
  8. (0x04 bytes) 0100 0000, control sequence?
  9. (0x04 bytes) ?, null terminated
  10. (0x07 bytes) null
  11. (0x04 bytes) f401 0000, control sequence?
  12. (0x0c bytes) 'TCSPC Diode' string, null terminated
  13. (0x0a bytes) null
  14. (0x0a bytes) 'Reference' string, null terminated
  15. (0x02 bytes) null
  16. (0x03 bytes) 'HC' string, null terminated
  17. (0x04 bytes) f6ff ffff, control sequence?
  18. (0x02 bytes) 1000
  19. (0x03 bytes) null
  20. (0x02 bytes) 000c
  21. (0x0c bytes) 'TCSPC Diode' sting, null t2rminated
  22. (0x06 bytes) null
  23. (0x01 bytes) fe, control sequence?
  24. (0x04 bytes) 'K B' string, null terminated
  25. (0x01 bytes) null
  26. (0x0a bytes) 'HS PMT920' string, null terminated
  27. (0x05 bytes) ?, float
  28. (0x06 bytes) 00f6 ffff ff0d 00 control sequence?
  29. (0x03 bytes) null
  30. (0x0d bytes) '200nm-1000nm' string, null terminated
  31. (0x01 bytes) 05, control sequence?
  32. (0x12 bytes) 'High Speed PMT920' string, null terminated
  33. (0x02 bytes) 0001
  34. (0x16 bytes) null
  35. 002c 0100 0001 0000 00 control sequence?
  36. (0x04 bytes) ?, float?
  37. (0x04 bytes) ?, float?
  38. (0x0d bytes) c220 b043 2000 0000
  39. Time scale string (e.g. '50ns', '100ns'), null terminated
  40. (0x01 bytes) Data padding
    • If 30, skip next byte
    • If 31
      • If 2e39, skip next byte
      • if 392e, skip next 2 bytes

data

  • Each 4 bytes should be interpreted as a float

Metadata

Release files for lifespec-fl 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lifespec-fl 0.0.4
File Size Uploaded
lifespec_fl-0.0.4.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lifespec-fl 0.0.4
File Interpreter ABI Platform
lifespec_fl-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / lifespec_fl-0.0.4.tar.gz

Download URL lifespec_fl-0.0.4.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3346134ee7a7bcdd3a2777442aa7f6a0082aeda0e5ce39387a8ddcd7a510d2df
BLAKE2b-256 checksum
How to use checksums
2378e6b7ac3ce69468b39e4190793be1f967b4c79316ac314433b7d02ef95491
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8

Release files / lifespec_fl-0.0.4-py3-none-any.whl

Download URL lifespec_fl-0.0.4-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69fe05a7cec66d24e8a15dc39bfd129e57962ddb380adc4925e0a50d3e0c0d13
BLAKE2b-256 checksum
How to use checksums
42d94b5008bcf03d9efd868dec3b4b36471416b98a02ddaaa65653d2cd6d03aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page