Open fleimgruber opened 1 month ago
I searched in the official DWDataReader C library and found struct DWComplex
in one of the header files. Will look into it.
edit: It seems that the DWDataReader C lib defines a parallel API for complex numbers, e.g. DWGetChannelList
-> DWGetComplexChannelList
. @costerwi Do you want to have a 2x API surface area increase in dwdatareader
? Do you have another idea how complex numbers could be handled with the existing public dwdatareader
API? I am interested in adding this feature.
Sorry for the delay! Do you have an idea to return complex data when it is available?
Never mind!
As mentioned in https://github.com/costerwi/dwdatareader/issues/67#issuecomment-2419737863 I see two main approaches:
I expect approach 1 to be straight forward, but at the cost of maintaining and exposing more APIs to the users. Approach 2 does not have these downsides, but I am not sure about the best way to check for and integrate complex numbers with the current implementation, e.g. at https://github.com/costerwi/dwdatareader/blob/master/dwdatareader/__init__.py#L394. I have not yet looked into the C lib behavior either. So I guess we should agree on one of the mentioned approaches and I would then go ahead and experiment with it a bit in a PR.
Yes, I agree that approach 2 would be more convenient for everyone.
Thanks for confirming. So next question then would be: how are users expected to refer to channels with complex type? This might depend on complex channel naming in the DEWE file. I have the feeling that users will need to somehow specify "complex" somewhere regardless for it to work.
Do you have a small example file you can attach? I haven't looked but maybe the complex channels are just the imaginary component of a corresponding real channel of the same name. Python should be able to combine both components when they are available.
For a channel with these settings (from DEWE GUI):
dwdatareader is not able to find a matching key in the
dewe_file
. Are complex numbers supported?