Package: pyDataView
pyDataView"A graphical user interface for people who hate graphical user interfaces"If you know how to read your data by writing Python code, PyDataView simply provides a way to quickly explore the data with a slider/file viewer. Once you see something you like, click Save Script to generate a starting point for further analysis.IntroductionA Data Viewer GUI written in python, wxpython and matplotlib.This is a lightweight interface for quick insight into scientific data.
Data can be explored as a matplotlib lineplot or contour using sliders to traverse the range of existing records and bins.
For more detailed analysis, a figure can be saved, the data output as a csv file or a minimal python script generated.
The emphasis of this project is the provision of a simple reader to get data into python, a minimal GUI to get quick insight into that data and generation of python scripts for more detailed analysis.QuickstartOn linux, you need Python3, numpy, wxpython and matplotlib installed. You can then clone the repository and run pyDataView from the command line,python3 pyDataView.py -d ./path/to/dirChoosing the path to point it at directory which contains the data.If you use Windows, a pre-compiled executable using pyinstaller is availableAction Autobuild (latest version)hereStable downloadhere(Built 23/12/21)pyDataView uses fields of five dimensional data: three spatial, one temporal and one for dimensionality of data.
Currently, support is provided for field data written by a number of binary format MPI/Fortran codes, OpenFOAM, Channelflow (h5 format) and LAMMPS.or you can runpyDataView.pyand choosing the directory.
Any files which can be converted to fields are displayed on the left hand side.As well as the raw data fields, derived fields are also supported, for example, dividing momentum by density to get velocity.If the code/datatype is already supported, all available data should be displayed.
In order to add new datatypes, the user must create a raw data reader innewreader.py,fromrawdataimportRawDataclassSomeNewReader(RawData):def__init__(self,fdir,fname,dtype,nperbin):if(fdir[-1]!='/'):fdir+='/'self.fdir=fdirself.fname=fnameself.dtype=dtypeself.nperbin=nperbinself.filepath=self.fdir+self.fname+'/'self.header=self.read_header(fdir)#The user should write theseself.grid=self.get_gridtopology()#The user should write theseself.maxrec=self.get_maxrec()defread(self,startrec,endrec):# Read a 5D array [nx, ny, nz, nperbin, nrecs]# where nrecs=endrec-startrec+1 and nperbin is 1 for scalar field# and 3 for vector field, etcreturnbindataTo use this raw data, a field datatype can then be added tonewfield.py,fromfieldimportFieldfromnewreaderimportSomeNewReaderclassSomeNewVectorField(Field):dtype='d'nperbin=3def__init__(self,fdir):Raw=SomeNewReader(fdir,self.fname,self.dtype,self.nperbin)Field.__init__(self,Raw)self.header=self.Raw.headerself.axislabels=['x','y','z']This field type can now be called in any python script, allowing 5D data fields to be read as well as data preparation for plots, including profiles, contours, fft, etc. To add these new fields to the GUI, they should be added tonewpostproc.pyfrompostprocimportPostProcfromnewfieldimportSomeNewVectorFieldclassNew_PostProc(PostProc):def__init__(self,resultsdir,**kwargs):self.resultsdir=resultsdirself.plotlist={}possibles={'New Field':SomeNewVectorField}self.plotlist={}forkey,fieldinpossibles.items():try:self.plotlist[key]=field(self.resultsdir)exceptAssertionError:passwhich must be instantiated inallpostproc.pyallowing pyDataView to find and display the new field format.There are many examples of different data formats in the postproclib file which can be used as a template.