FormingWorlds / PROTEUS

Coupled atmosphere-interior framework to simulate the temporal evolution of rocky planets.
https://fwl-proteus.readthedocs.io
Apache License 2.0
12 stars 1 forks source link

Plotting I/O improvements #195

Closed nichollsh closed 1 month ago

nichollsh commented 1 month ago

Improvements to plotting speed at runtime by avoiding extra file reads. There are now common functions for reading NetCDF and JSON files from the disk. These are used to read the data into memory only once (or keep it in memory entirely for some cases), rather than having each plotting function individually read the data from the disk. Closes #194.

Note that the improvement scales with the number of data files to be read, and the frequency at which plotting is performed. We should still consider using larger plot_iterfreq values for further performance gains.

Should also make things easier when implementing Aragog, since we won't need to read files from the disk at all when making plots at runtime.

Also added some more instrument bandpasses for reference.

nichollsh commented 1 month ago

It doesn't make a difference to the dummy case because the plotting frequency is low, and it's not reading NetCDFS or JSON files anyway. When I ran some longer cases with JANUS, plotting every iteration, it reduced the runtime by between 5 and 10%. There's some variation depending on the number of model levels, and the the number of files it has to read.

nichollsh commented 1 month ago

Thanks for the review!

lsoucasse commented 1 month ago

It doesn't make a difference to the dummy case because the plotting frequency is low, and it's not reading NetCDFS or JSON files anyway. When I ran some longer cases with JANUS, plotting every iteration, it reduced the runtime by between 5 and 10%. There's some variation depending on the number of model levels, and the the number of files it has to read.

Good to know. Thanks.