# Calculating Well Marker-Horizon Mistie

Use this workflow to determine the well marker and horizon intersection depths at a specified well marker location and use these to either generate a table of residuals, or calculate a residual map.

## Build a map of marker locations

The workflow requires a table of XY locations for each marker location. The table will be used create a well marker location horizon and to sample the structural horizon data at that location for comparison. If the wells are vertical, all the marker locations will be the same and so only one generic table is required.

In additional to a well name, the table should also include a reference number for each row, it must be numeric, and should be a well number or code. Exported results will refer to this ID.

1. Open a text editor and create a column of well ID besides the well marker X/Y locations.

Note: For wells without a marker, either exclude them from the table or set the Well No. to a missing value such as -999.99.

1. Save this file as a .dat file.
2. Open Insight and import them as horizons (see Using the horizon text importer).
1. In the Import window, set the X,Y values in their respective columns.
2. Set the well ID as “Extra Attribute”
3. Click OK to continue importing.
4. Go to Control Panel > Map View.
1. Display the imported horizon in the map view
2. Click the Operations tab and select the Regrid Operation to regrid the imported XY  well locations to the 3D Survey (ILCL) (see Regrid Horizon)
3. Click Regrid.
4. Save as a new horizon (ILCL).

## Extract the horizon depths at the markers

Use the marker location map to filter the horizon depths, i.e. keep only the depth values at these locations.

Use the marker location map to sample and store the structural horizon at the well marker locations.

1. Go to the Operations tab and select Horizon Maths operation.
2. Click the blue "+" button and add two symbols:
• h1:  Imported well list
• h2:  Depth converted horizon
3. In the formula field, use: (h1*0)+h2.
• Note: This formula discards the "Well ID" value by multiplying by zero. Because "h1" only has values at marker locations, the "missing points remain missing". Only the structural horizon points coincident with the Wellid locations will be included.
4. Click Run.
5. Click the Add property button, select the well marker location horizon and type a property name to identify the structural horizon as a source. (e.g. Horizonname_TVDSS)
6. Click OK.

## Create a Current Marker Value Horizon

Note: The initial table (Step 1) can optionally include a column of marker Z values to avoid this calculation. To be of use in the workflow, the table values would need to be stored as TVD. If the marker depth of interest in the well was then adjusted the table would need to be updated accordingly and reloaded.

By calculating a marker map, using the steps below, these factors are automatically taken care of, the latest marker is always used with the correct TVD.

1. Enable the wells in the Control Panel > Wells tab.
2. Click the Operations tab and select Create Horizon from Well Markers operation.
3. Select the Marker name.
4. Select a polygon that includes the wells of interest.
5. Click Run.
6. Click the Create New button, rename the horizon to reflect the markers as the source. (e.g. WellMarkers_markername)

## Extract the Marker depths at the Marker Locations

This samples the current marker horizon at the defined locations for comparison with the structural horizon.

Note: This calculation can be skipped if the table in Step 1 includes a valid TVD marker depth.

1. Go to the Operations tab and select Horizon Maths operation.
2. Click the blue "+" button to add two symbols:
• h1:  Imported well list
• h2:  WellMarkers horizon
3. In the formula field, use: (h1 * 0)+h2
4. Click Run.
5. Click the Add property button, select the well marker location horizon  and type a property name to identify the markers as a source. (e.g. WellMarkers_markername)
6. Click OK.

## Calculate the Residual Mistie

This is the main (and final) calculation that determines the difference between the well marker TVD and the structural horizon at the same location.

1. Go to the Operations tab and select Horizon Maths operation.
2. Click the blue "+" button and add two symbols:
• h1:  Depth horizon sampled at well list
• h2:  WellMarkers horizon sampled at well list
3. In the formula field, use: (h1 - h2)
4. Click Run.
5. Click the Add property button, select the Well marker location horizon  and type a property name  to identify the residual . (e.g. Markername_ResidualMistie)
6. Click OK.

Depending on your ultimate objective, you can now either look at the residual differences as a table, or turn the differences into a horizon for surface correction

## Results 1: Export Residual Mistie

This optional section explains how to view the results as a table of values.

1. Export the horizon as a customise text file from the control panel (see export customised text file).
2. Select all the attributes of interest.
3. Click OK to export these attributes.

Note: The well name was dropped during the regrid operations, which is why the Well ID (number) column was introduced in order to identify the final results.

## Results 2: Map Residual Mistie

This optional section explains how to create a residual horizon for surface correction.

Horizon regrid and interpolate / extrapolate operate on the primary stored value of a horizon, not the additional (residual) attributes that have just been calculated. Create a separate horizon distinct from the custom attribute horizon to ensure that the correct attribute is being used in the interpolation process.

Use Horizon Math:

1. Go to Map View > Operations > Horizon Math.
2. Click the blue (+) and add your well marker location horizon with calculated residual as an attribute.
3. Choose the Property to use (e.g. Markername_Residual Mistie).
4. Use formula: h1 (or whatever symbol you've chosen).
5. Check the Class is set to Depth (TVDSS)
6. Click Run.
7. Click Create New to save as a new horizon. Provide a suitable name for easy identification (e.g. Markername_Residual Mistie).

Interpolate the residual data

1. Select the new TVDSS horizon of residual mistie values.
2. Select Operations > Interpolate/Extrapolate.
3. Click Interpolate.
4. Save as new horizon.

Note: This horizon can then be added to the original structural horizon to create an accurate well tie.