ALBA-Synchrotron / IcepapOSC

GNU General Public License v3.0
0 stars 8 forks source link

Implement record to file #2

Open rhomspuron opened 5 years ago

rhomspuron commented 5 years ago

Implement the record button to save in a file before to plot the data.

rhomspuron commented 5 years ago

As first version, the file format can be CSV.

CSV can be:

IcepapOSC generated file. 
host: <icepap host>
port: <icepap port>
start date: yyyy-mm-dd
start time: HH:MM:SS

PointNo; <axisX_register>; <axisY_register>; ...... 
1; 343434; 3.234; .....
.....
n; value; value;

As a second, step we can implement the saving to a HDF5 file. In this case, we should implement a structure to save the data. And we should evaluate if we wants to save more than one acquisition on the same file.

@inki2, What do you thinks about it?

inki2 commented 5 years ago

If writing to the file will be ongoing as the data is collected; would it not be better to write data line by line (so that the above rows become columns)? @rhomspuron

rhomspuron commented 5 years ago

It depends how you wants to save the data, the easy way is append on the file, for that reason you should have the data of all channel for the point, if all channel are measured at the same frequency.

If the channels have different acquisition frequency your are right, and maybe its better to implement the saving to the HDF5 first, because it is a binary file and you can access to the data in a easer way. In this case the CVS should be:

IcepapOSC generated file. 
host: <icepap host>
port: <icepap port>
start date: yyyy-mm-dd
start time: HH:MM:SS

PointNo; 1; 2; 3; .....;n 
<axisX_register> 32565; 45454; ....; m
<axisY_register>  3.4; 21; ....; p

And the channels can have difference length of the data n != m != p, the PointNo should have the maximum lenght

When you try to import the CVS file in excel to plot the data can be complicated if we use this implementation. We can investigate how a real oscilloscope export the data to a cvs file.

inki2 commented 5 years ago

The following is an example output from a real oscilloscope. This model produces one file per signal.

LECROYWM8500,204,Waveform Segments,1,SegmentSize,100002 Segment,TrigTime,TimeSinceSegment1

1,12-Nov-2008 14:20:42,0

Time,Ampl -5.1601e-005,0.000104508 -5.16e-005,0.000178177 -5.1599e-005,0.00012164 -5.1598e-005,0.000104508 -5.1597e-005,9.59414e-005 -5.1596e-005,5.99634e-005 -5.1595e-005,5.65369e-005 -5.1594e-005,8.05223e-005 -5.1593e-005,3.76913e-005 ...

rhomspuron commented 5 years ago

@inki2 thanks for the investigation. In our case, as first approach, we can save in the same file all the signal, and use only one acquisition frequency. In the future, if it is needed, we can implement different acquisitions frequencies and save one signal per file.