bennomeier / leCroyParser

A Python Module to parse LeCroy Binary Trace Files
MIT License
12 stars 8 forks source link

triggerTime precision #12

Closed ferdymercury closed 1 year ago

ferdymercury commented 2 years ago

Hello, thanks for this package!

I see that the triggerTime is rounded to 'centiseconds'. Is there a reason why this is done?

Could there maybe be a setting to specify the precision when querying the trigger time, rather having it hard-coded to .2f in https://github.com/bennomeier/leCroyParser/blob/master/lecroyparser/__init__.py#L193 ?

Thanks!

ferdymercury commented 2 years ago

(For the moment, as a workaround, I use the C++ version that returns the full trigger-time struct with the seconds as double precision: https://igit.ific.uv.es/ferhue/lecroyparser)

JeroenvO commented 1 year ago

I'd say this can be increased. Do you know how much is stored in the binary file and how much precision makes sense?

ferdymercury commented 1 year ago

The binary file stores the number of seconds with double (floating) precision. I'd say it would belpful to let the user configure the number of digits when constructing the class. {.Nf}

bennomeier commented 1 year ago

Hi, apologies for the wait. I did add said option to the corresponding routine. Does that work for you?

ferdymercury commented 1 year ago

Thanks a lot! Could you 'forward' the variable also here? https://github.com/bennomeier/leCroyParser/blob/57920d8bdd33ccd655b721ca1b47e6885798c1d6/lecroyparser/__init__.py#L27

(passing then the value to the parseFile and parseData functions, and finally to https://github.com/bennomeier/leCroyParser/blob/57920d8bdd33ccd655b721ca1b47e6885798c1d6/lecroyparser/__init__.py#L125)

So that it can be specified directly from the constructor function.

bennomeier commented 1 year ago

Just this once :-)

ferdymercury commented 1 year ago

Thanks so much!