Conversion tool
In order to use data format presented in previous chapter we need to utilize a way of converting data format from the instrument into the HDF format. This can be achieve by conversion tool provided at address https://obr.ibt.biocev.org/converse. The conversion now support two methods:
UV-Spectroscopy (Cary 60)
NanoDFS (Prometheus NT.48)
User use cases
In case user want to convert file, process is fairly easy. First of all specific method has to be chosen. Then user is required to upload file which want to convert. Last step is push Send
button, and file will be converted.
Be aware that only supported file formats are .csv
and .xlsx
at the moment and they also have to have required structure, if some of this requirements are not met, user will be notify that he is trying to do illegal action, and conversion will not happen.
Converted file will be downloaded via web browser.
Programming documentation
From UI perspective convertor use standard Vue3 programming practices. View used for conversion page is called Converse.vue
. This page contains all layers of view used in conversion process. It also includes service code for requesting to a server. For more information regarding code, I recommend to read through comments of code.
From server perspective, server is build on Flask platform. This help to hold at least some part of compatibility between this two parts, if further development requires it. Main input function is in app.py
file, function upload()
.
It accepts HTTP POST
or GET
requests. If POST
request is intercepted by function, method name and file is accepted and are move next to instance of a convertor class, which is main work force behind the conversion process. Method name is used to choose JSON scheme which will be loaded with metadata from converted file. After JSON is loaded by metadata this serialized data structure is moved to file writer which will write down all data into a HDF file. After some timeout UI will send request again but this time with GET request. After interception of this request file will be send into a browser and automatically download converted file into computer. Also for more information I recommend to read through comments in code.