0xCoto / PICTOR

📡 The official repository for the free-to-use PICTOR Radio Telescope
https://www.pictortelescope.com/
GNU General Public License v3.0
229 stars 25 forks source link

Transpose data in CSV files #13

Closed andy8025 closed 4 years ago

andy8025 commented 4 years ago

Change the way data are stored in __data_spectrum.csv and data_time_power.csv__ files that are emailed to user. Transpose rows and columns - to store samples in rows instead of columns.

Current layout:

foo 1000 1001 1002 ...
bar 2000 2001 2002 ...

Proposed layout:

foo bar
1000 2000
1001 2001
1002 2002
... ...

Current CSV file layout prevents LibreOffice Calc from reading all the data. LibreOffice error: "The data could not be loaded completely because the maximum number of columns per sheet was exceeded".

andy8025 commented 4 years ago

Made changes to plot.py and __plot_hi.py to save the new transposed CSV files, in addition to the original CSV files. Did not modify the code in observe.py__ that emails the CSV files.

Don't know how to check what Python libraries are available on the actual telescope system. I see that NumPy is available, hope that Pandas is available as well :)

ministerofsillywalks commented 4 years ago

When I first did this, I wanted to use pandas to make the CSVs the way you want them, @0xCoto asked that I stick with just numpy instead.

ministerofsillywalks commented 4 years ago

You shouldn't need pandas because you can do the transposition without reopening the csvs, just do it before they are saved.

0xCoto commented 4 years ago

Thanks for the PR, just approved! The changes have been applied to the telescope, so feel free to try it out. :)