Showing posts with label Macro. Show all posts
Showing posts with label Macro. Show all posts

VBA Macro: Clastic Sedimentary Lithology Interpreter based on Geophysical logs-Density and Gamma




The code is using geophysical gamma and density data to interpret the lithology. However, even in simplest conditions, other interpreting criterion will be required to make an accurate interpretation. So, the code and Macro provided here is for your reference, and I am not take any responsibility of you using this macro. BTW, the density and gamma logs have to corrected (no trends or tool errors or anything), otherwise the result looks like a joke...

Right, I am not a programmer, and this is something I came out in work and think might of help to some geologists. The code is quite lazy and there must be efficient ways to do this, and I will be grateful if you can offer some suggestions and help or ideas to improve the function/performance or the code, you can leave your comments here or email me. Also, if you have questions, please leave some words as well. 

What is it again? what can it do if anything at all?

Function: The purpose of the this marco is to interpret the lithology based on the geophysical logs (gamma and density) and the criteria you set for the common clastic sedimentary rocks, as Coal, Mudstone, Sandstone, Siltstone, Carbonaceous Mudstone, Overburden...

As shown in the below screenshots, it allows you to input the gamma and density criteria for each of the lithology, and also the OVB thickness, and the thin layer thickness to be merged which will be explained below. 

Mechanism: Three steps are taken in the code,

1. Interpret each line of the geophysical log based on the sampling interval (such as 0.01m per line) and assign a lithology name based on the density and gamma value of this sampling interval. Such as, in the interval of 100m to 100.05m, the density is 2 G/CC, and the gamma is 100 API, and you think it is sandstone, the sandstone is assigned to this line.

2. After the lithologies are assigned to the raw geophysical data, you will have thousands if not more of lines of lithology, but that is not what you want for the result. So, we combine then. Here, the code combines the lithology of intervals with the same lithology above and below of that interval. This will shorten the lithology list, but that is still too much. So, we process further.

3.  Consolidate/merge the very thin layers which has similar or very close lithology to the overlying or underlying layers, or where you think the lithology and underlying and overlying can be merged. Probably it is more reasonable/conservative to merge the spatially and lithologically close ones, such as merge the thin layer of mudstone into overlying and/or underlying siltstone, and siltstone into sandstone etc, not coal into sandstone.

Meanwhile, the step 2 and step 3 are executed sequentially and repeatedly for the resultant consolidated lithology list.