This is a tool and library for post-processing data from the gyrokinetic magnetised plasma turbulence code GS2.
It consists of a command line tool and wrapper which provides an common interface to a series of separate packages, each of which presents a standardised interface to the wrapper.
$ gs2pp <package> <command> <package_function> <options>
where command is one of:
run
: a generic command which will simply run the analysis. Useful when analysis is complicated and it's more natural to write results and plots to file at the same time.plot
: display results to screen or save them to an image file.write
: write the results to a file (NetCDF, JSON, CSV) decided by package (typically using the output file extension, sometimes using an option value).dict
: return a dictionary of results for further manipulation.help
: return a list of available package functions and associated options
For example
$ gs2pp basic_plot plot {'var':hflux_tot}
Each separate package within gs2pp defines the following standard function
def gs2pp_interface(command, package_function, options):
The parameters command
and package_function
are strings, and options is a dict. This function must do different things according to the value of command
. The analysis package does not need to implement all command
functions, only the ones which make sense for the package. The wrapper will handle exception handling to the user based on a (yet to be defined) way of getting the implemented methods from a given package.