edoddridge / aronnax

An idealised isopycnal model that can be run either with n+1/2 layers, or with n layers and variable bathymetry.
http://aronnax.readthedocs.io/en/latest/
MIT License
23 stars 5 forks source link

Allow for saving simple diagnostics and statistics during a simulation #162

Closed edoddridge closed 6 years ago

edoddridge commented 6 years ago

Initially I think these are useful diagnostics:

With the option to add others in the future, such as

Because these are such lightweight outputs, that will grow dynamically as the run progresses, the output format should preference being easy to read, rather than cheap to store. A text file is probably a good choice.

I envision to output file to look something like:

time | vol1 | ... | voln | hmin1 | ... | hminn | ... | vavn |
-----+------+-----+------+-------+-----+-------+-----+------+
its  |      |     |      |       |     |       |     |      |
axch commented 6 years ago

I suggest there are two other things you should be optimizing for: the output file should be easy to write code to produce, and should be machine readable. In fact, a table of diagnostics as large as this will almost certainly be more useful to read by machine than directly, because the user will most likely want to plot them. This suggests json, csv, or maybe tab-separated value so the cells will be more visually aligned.

Having one big file may get a bit awkward to implement if the natural places in the simulation core where different diagnostics are available are not all the same. If that is likely, then a format involving several files may be preferable; but on the other hand, a single file is easier for the client to deal with.

edoddridge commented 6 years ago

Thanks @axch.

I was thinking machine readable, but apparently didn't write it.

Multiple files is a good suggestion. I had originally discounted it as causing undue clutter, but on reflection I'm not sure that's such a strong reason. It would also be easier to extend to add additional files for more diagnostics in the future.

Of the formatting options, csv is probably the simplest.