0

I have a DX file containing PME data, I want to plot an average potential profile through python code. Can anyone please help with the code

I do not know how to write a python code for the same

  • Please provide enough code so others can better understand or reproduce the problem. – Community Oct 31 '22 at 11:29
  • You could use [GridDataFormats](https://www.mdanalysis.org/GridDataFormats/) to load the DX file as a [Grid](https://www.mdanalysis.org/GridDataFormats/gridData/core.html#gridData.core.Grid) object and then work with the numpy array: Load file `g = gridData.Grid("potential.dx")` and then work with the [underlying numpy array](https://www.mdanalysis.org/GridDataFormats/gridData/core.html#gridData.core.Grid.grid) `g.grid`. E.g., `g.grid.average(axis=2)` will average along the z axis but **you need to decide for yourself if this gives you the correct scientific answer**. – orbeckst Oct 31 '22 at 16:26

0 Answers0