02.05.2014 Views

Ocean for Petrel Plugin Creation - Ocean - Schlumberger

Ocean for Petrel Plugin Creation - Ocean - Schlumberger

Ocean for Petrel Plugin Creation - Ocean - Schlumberger

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

// intersect the log with the grid and return cells traversed<br />

IEnumerable logInCells = log.GetLogInCells(grid);<br />

// find the average value of the log in the cell<br />

<strong>Petrel</strong>Logger.Info("******* Log in cells ********");<br />

<strong>for</strong>each(LogInCell lic in logInCells)<br />

{<br />

// get first and last log points in the cell and cell index<br />

double MDIn = lic.MD_In;<br />

double MDOut = lic.MD_Out;<br />

Index3 ind = lic.Index;<br />

// compute average of points entering and leaving cell<br />

float avg = ((float)logLUT[MDIn] + (float)logLUT[MDOut])/2;<br />

prop[ind] = avg;<br />

}<br />

// dump the result an increment the counter<br />

<strong>Petrel</strong>Logger.InfoOutputWindow(MDIn + " " + logLUT[MDIn] +<br />

" " + MDOut + " " + logLUT[MDOut] + " " +<br />

ind.I + " " + ind.J + " " + ind.K + " " + avg );<br />

count++;<br />

}<br />

// commit the transaction to save the data<br />

trans.Commit();<br />

}<br />

return count;<br />

11. Build the solution.<br />

Figure 3-15 Code <strong>for</strong> private method UpscaleLog<br />

3.3. Running the Examples<br />

When the example projects were created the petrel.exe.config file was updated<br />

by the wizard with the module name and assembly. The wizard also set up the<br />

projects in Visual Studio to start <strong>Petrel</strong> when you start debugging. Per<strong>for</strong>m the<br />

following tasks to run the examples:<br />

1. Start debugging from Visual Studio after building the solution. If you<br />

prefer not to debug you may start <strong>Petrel</strong> outside Visual Studio.<br />

2. Open a project in <strong>Petrel</strong> that has a Point set object in the <strong>Petrel</strong><br />

Explorer Input tab (see Figure 3- 16). If no Point set object is available,<br />

then use the Process diagram Utilities folder Make/Edit polygons<br />

process to create one. Use a 3D object to place your points in space.<br />

42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!