@Michael.Young
I’m not claiming to be the most proficient programmer either, but here’s what I have to say about your workflow.
Originally, I assumed you needed a human-readable file format. Hence why I suggested those file formats above. However, if the analysis results are rich and are better understood with graphs, quite often I would save those in binary files. I work quite a bit with Python, and I like the simplicity of Pickle
for that.
https://www.geeksforgeeks.org/understanding-python-pickling-example/
I was told that Pickle
isn’t good for large amount of data, but it hasn’t been an issue for me so far, and my analysis results remain small. Then, I would have a sort of Python dashboard to load the binary analysis results and display them how I like.
Regarding naming. I like using a timestamp as the suffix, but an increment is good as well I guess. Then, instead of your file being called:
geometricimageanalysis_myfile_fieldsize-1.2_imagesize-2.3_rays-1000_etc.txt
I would give the text file a short name that relates to the experiment such as analysis_of_lens_x_001.txt
. And then, within the text file you’d have a header with the analysis settings:
[settings]
analysis = "Geometric Image Analysis"
lens_file = "my_file.zmx"
field_size = 1.2
image_size = 2.3
rays_x_1000 = 1000
[misc]
start_time = 2024-02-07T15:03:45.2211466Z
[results]
my_results = ...
As I mentioned, if the analysis is complex, I would “query” it with Python. And in that sense, it might be more straightforward to work with the ZOS-API from the beginning. If you really need to maintain a high level of “hygiene”, I’d suggest to save the lens file as a ZAR after running the analysis and keeping this archive alongside the metadata, and perhaps add an identifier in the ZAR file name that will also be present in the text file so you always know which analysis and which file go together.
Its probably far from perfect, but I hope you can take something away from this.
Take care,
David