yaptide / ui

Yet Another Particle Transport IDE - frontend
https://yaptide.github.io/web_dev/
GNU General Public License v3.0
9 stars 4 forks source link

Add possibility to export data for further processing #523

Open grzanka opened 2 years ago

grzanka commented 2 years ago

The easiest would be a CSV file.

I'd imagine an "export to CSV" button next to each plot

image

grzanka commented 2 years ago

Take a look here https://github.com/libamtrack/web/blob/03e57c88e9ede2cc5fc6a2a091568e1790978407/src/components/functions/modals/DownloadDataModal.js

grzanka commented 2 years ago

Let's limit this feature to 1-D plots at the moment.

File should have the same name as the plot. Let's avoid whitespace characters and replace them with _. So if plot is called "Fluence only protons" then I expect a file "Fluence_only_protons.csv".

Example file contents:

# --------------------------------
#  ESTIMATOR metadata
#         "Tmax_MeV": "0.0",
#        "error_type": "ErrorEstimate.none",
#        "file_corename": "yz_profile_",
#        "file_counter": "16",
#      (....)
# --------------------------------
#  PAGE metadata
#             "detector_type": "39",
#            "detector_unit": "Gy",
#    (...)
Position (Z) [cm], DOSE-GY [Gy]
0, 0.5
0.1, 0.6
0.2, 0.7
(....)