New JSON format version #7
Replies: 2 comments 4 replies
-
Matthias, I see what you have done. I already did something similar in Impulse for the optional 3D spectrum function, but instead of repeating the whole schema I just appended multiple spectra as an array like this "spectrum": [[0.0.0.0],[0,0,0,0]] Technically this is not true NPES scheme and it does have some issues running in Impulse, because as the file gets bigger and bigger the program runs slower and slower. I don't think it is the loop appending the data, it is more likely the screen update which is slowing things down. But when running 3D spectra it would make sense to reduce the number of bins and update intervals. We can achieve the same result using your NPESv2 albeit with a slightly larger scale. If not for 3D spectra, what other use cases do you think it is useful for? I am currently in the middle of updating Impulse for use with ATOM-NANO devices and it is becoming quite complicated because it is a USB serial device with UART communication protocol. Fortunately Am6er (Albert) has done most of the hard work. Rendering the spectrum from ATOM-NANO is the easy part, most of the changes are about making it user friendly, so all the prompts that relate to sound card devices are hidden when a serial device is connected and new prompts that are required show up. I will stick with NPESv1 until the current version is published and tested. Steven |
Beta Was this translation helpful? Give feedback.
-
Impulse is now NPESv2 compatible as well as backwards compatible with NPESv1 but for the moment only saves one spectrum per file. |
Beta Was this translation helpful? Give feedback.
-
So, I created a new draft version of the NPES file format that you're using for the JSON files in impulse. It newly adds the possibility of having multiple spectra inside one file in a data array. These entries inside the array are called data packages and are basically almost identical to an entire "old" v1 file. This also means that each data package is completely independent from one another, so you could store totally unrelated data from different devices, etc.
So again, you would now be required to have a data array, which contains an arbitrary number of data packages, which in turn are almost identically formatted like the old standard version. Roughly speaking, you're able to take the data from the old files and just put them in an array inside a single file.
I created a branch in my repo for the draft with all the updated documentation: https://github.com/OpenGammaProject/NPES-JSON/tree/draft
There are also updated example files if you wanna have a look: https://github.com/OpenGammaProject/NPES-JSON/tree/draft/examples
This should hopefully now also comply with the requirements for BecqMoni to be implemented in the software too (fingers crossed :D), see this issue: Am6er/BecqMoni#2
What do you think? Any suggestions or comments? Would you want to implement this in impulse?
It's not a lot of work to implement this, you'd only have to pull out the individual data packages from the array and then parse them just like the old JSON files since the structure inside them is identical. I think the most difficult part would be to decide on how to handle this in the UI, i.e. letting the user decide to save multiple spectra in one file or creating multiple files. The same is true for importing then of course.
Beta Was this translation helpful? Give feedback.
All reactions