stella
stella copied to clipboard
post_processing/stella_data.py: *.out.nc is not a valid NetCDF 3 file
Executing
$ python3 kspectra_plots.py
On my favourite stella *.out.nc file leads to the following error
Traceback (most recent call last):
File "kspectra_plots.py", line 3, in
This can be fixed by replacing the scipy netcdf module with
from NETCDF4 import dataset ncfile = Dataset(infile,'r', format='NETCDF4')
and remembering to add '.size' the the end of a dimension enquiry
The code changes to fix the issue raised here are in branch
https://github.com/stellaGK/stella/tree/bugfix/pythontools_netcdf4_compatibility
I have previously made a start converting some of these post-processing scripts to xarray, and to make them a bit more flexible, allowing them to be used from the command line with arguments, or importing them to use in other scripts.
Are there particular scripts that are used more than others?
I have now taken to using https://github.com/jfparisi/stella_tools/tree/master, a tool developed by jfparisi for stella, based on my original scripts for GS2. The main benefit of this script is speed: only data actually used for plotting is loaded. I found the scriptsi here to be too slow for the multiscale simulation that I wanted to inspect.