# Limiting correction to a radius around the well data

## Calculate a residual correction without any constraints applied

- To calculate the residual correction:
- Use
*Create horizon from well markers*to create a sparse horizon of your well marker to be tied. - Use
*Regrid*to resample the sparse marker horizon to a regular grid at your final grid spacing eg 50m - Use
*Horizon maths*to subtract the sparse horizon from the seismic horizon, the formula is h1-h2. - Use
*Interpolate/extrapolate*to fill the entire area with the residual correction.

- Use

## Calculate a template defined by a radius from a well

- To calculate the template:
- Use
*Horizon maths*to modify the regridded (sparse) horizon marker horizon to value 1. The formula is h1/h1. - Use
*Create constant horizon*to create a horizon value 0 across the area of your final horizon. Use an X/Y spacing similar to or less than your final grid spacing e.g. 50m. - Use
*Horizon maths*to merge the 2 horizons above together. The formula is merge (h1, h2), ensure the well marker horizon is listed first, h1.

- Use

- Use Smooth to create non zero values around the well locations defined by a smoothing radius of your choice e.g. 1500m. If this takes a very long time, consider changing your grid increment in the previous steps.

**Note: **Create a new horizon each time if you want an audit trail, otherwise replace to update the template and reduce horizons generated.

- Use
*Horizon maths*to cut out the nonzero values. The formula if (h1>0, Nan, h1) should be used.

- Use
*Horizon maths*to merge the 0 template with holes together with the marker horizon value 1. The formula is merge (h1, h2), ensure the well marker horizon is first, h1. - Use
*interpolate/extrapolate*on the merged horizon to create a smooth transition from value 0 away from the wells to value 1 at the well locations. Make sure the interpolated distance is larger than the radius used during smoothing eg 2000m - QC the template horizon in the
*Map View*.

- To apply the template to the residual correction, use
*Horizon maths*to multiply the residual correction from part 1 with the template from part 2. The formula is h1*h2.

- To apply the adjusted residual correction to the depth map, use
*Horizon maths*to subtract the adjusted residual correction map from the seismic depth map. The formula is h1 - h2. - QC work in an arbline that passes through marker location.