Calculating the moving average of a log curve

This example will show you how to create a virtual log curve whose values are calculated programmatically. As an example, we calculate the moving average of the density (RHOB) curve. This average is calculated along a symmetric sliding window of 40 ft (assuming that the MD values are in feet).

You can download this script at the bottom of this page.

This screenshot shows the well after the moving average has been added to the track.

This example only takes one log curve as an input. There is no limit to the number of log curves you can use as input in your Python code.

To save this log curve, go to File --> Save Well Data and add save as a separate well file or rewrite your current file.