I have a code that does the following: Give an input seismic cube, creates a cropped version of it with half the size and then realizes this cropped cube.
The plugin seems to work fine. However if I try to delete the realized cube using Petrel, (right-clicking on the realized cube and selecting “Delete…”) the cube remains in the Petrel input tree.
I can even open its settings dialog, but I cannot display it in any window and can’t access its context menu. Besides that, the values of any Inline, Xline or Timeslice under it changes to what seems to be coordinates values.
Is this a bug or am I doing something wrong?
Here is my code (cube is the input seismic cube):
Index3 start = new Index3(0, 0, 0);
Index3 end = new Index3(cube.NumSamplesIJK / 2);
SeismicCube croppedCube;
using (var t = DataManager.NewTransaction())
{
t.Lock(cube);
VolumeCroppingInfo croppingInfo = new VolumeCroppingInfo(start, end, new Index2(0, 0));
croppedCube = SeismicSystem.SeismicCroppingService.CreateVirtualCroppedVolume(
cube, croppingInfo);
t.Commit();
}
var realizeWorkstep =
PetrelSystem.WorkflowEditor.RegisteredWorksteps.Processes.GetGeophysicsGroup().RealizeSeismic;
RealizeSeismicArguments realizeArgPack =
(RealizeSeismicArguments)realizeWorkstep.CreateArgumentPackage(DataManager.DataSourceManager);
realizeArgPack.RealizationQuality = RealizationBitNumber.Bit32;
realizeArgPack.Seismic = croppedCube;
realizeArgPack.UseExactSourceValue = true;
realizeWorkstep.InvokeSimple(realizeArgPack);
If you save the project and then perform the Delete in Petrel the cropped realized cube is deleted. Prior to saving the project it is not deleted. I duplicated the behavior you documented by creating a plug-in using your code.
I'm not sure if it is a bug, but suspect it may be a feature. Certainly your code is not an issue.
Perhaps a more Petrel savy person will comment on the logic Petrel is using here.