forked from jaigupta/Plugged-in-Ocean
/
ReflectionCoefficient.cs
74 lines (61 loc) · 2.22 KB
/
ReflectionCoefficient.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using Slb.Ocean.Petrel.Workflow;
using Slb.Ocean.Core;
using Slb.Ocean.Petrel.Seismic;
using Slb.Ocean.Petrel.DomainObject.Well;
using Slb.Ocean.Petrel.DomainObject.Seismic;
using Slb.Ocean.Petrel.UI.Controls;
using Slb.Ocean.Petrel;
using Slb.Ocean.Petrel.DomainObject;
using Slb.Ocean.Basics;
using Slb.Ocean.Data;
using Slb.Ocean.Petrel.UI;
using Slb.Ocean.Geometry;
namespace LogAnalysis
{
class ReflectionCoefficient
{
WellLog AcImpLog;
public ReflectionCoefficient(WellLog LogType)
{
this.AcImpLog = LogType;
}
public void FromAcImp()
{
int count;
count = AcImpLog.SampleCount;
List<WellLogSample> LogAcImp = new List<WellLogSample>(AcImpLog.Samples);
double[] RC = new double[count];
for (int i = 0; i < count; i++)
{
if(i!=count-1)
RC[i] = (LogAcImp[i + 1].Value - LogAcImp[i].Value) / (LogAcImp[i + 1].Value + LogAcImp[i].Value);
}
Borehole b1 = AcImpLog.Borehole;
using (ITransaction trans = DataManager.NewTransaction())
{
IPropertyVersionService pvs = PetrelSystem.PropertyVersionService;
ILogTemplate glob = pvs.FindTemplateByMnemonics("Reflection coefficients");
PropertyVersion pv = pvs.FindOrCreate(glob);
trans.Lock(b1);
WellLog log = b1.Logs.CreateWellLog(pv);
//log.Name = "rhoB";
WellLogSample[] tsamples = new WellLogSample[count];
for (int i2 = 0; i2 < count; i2++)
{
double md = LogAcImp[i2].MD;
float val = (float)RC[i2];
tsamples[i2] = new WellLogSample(md, val);
}
log.Samples = tsamples;
trans.Commit();
}
PetrelLogger.InfoBox("The Reflection coefficient Log has been created in the same Well");
}
}
}