Skip to content

How to use decimate_mean #226

Answered by orbeckst
frchalaoux asked this question in Q&A
Discussion options

You must be logged in to vote

If you just want to plot, use xvg.plot() with method and maxpoints (using the example):

xvg.plot(columns=[0,1], method="mean", maxpoints=100)   # bin-averaged data (100 bins)
xvg.plot(columns=[0,1], maxpoints=None, alpha=0.1)           # all data, light gray

The xvg.decimate() method itself takes a 1D or 2D array as input. A 1D array is turned into a 2D array where the first column is just the index. If you want to use it with the data in the xvg you could do something like:

time_pressure = xvg.array[[0, 1]]  # select column 0 as time and column 1 as P
time_pressure_coarse = xvg.decimate("mean", time_pressure, maxpoints=1000)

should 'a' be the pressure column from the xvg file, i.e colu…

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by orbeckst
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #106 on June 30, 2022 00:00.