Commit 5f44aa20 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[FEATURE] (issue7_refract): robust display of zero offset trace

By introducing an upper limit for the world coordinate range (in counts) in
the display rectangle (viewport) of the trace, the program now is reobust in
cases where zero-offset traces shall be displayed with offset dependend
amplitude scaling.

This is the final commit to resolve issue7.
parent 04bfbc25
......@@ -55,6 +55,10 @@ c 21/03/2014 V4.12 optionally reverse order of legend strings (-TR)
c 07/12/2015 V4.13 add option -SN; make amplitude scaling with
c respect to offset range the standard (without
c alternative)
c 08/02/2016 V4.14 introduce upper limit for trace displays world
c coordinate range in counts; this makes the
c program robust, when displaying a zero offset
c trace with offset dependend scaling
c
c==============================================================================
c
......@@ -62,7 +66,7 @@ c
c
character*79 version
parameter(version=
& 'REFRACT V4.13 REFRACTion seismics - data interpretation')
& 'REFRACT V4.14 REFRACTion seismics - data interpretation')
c
c get common blocks
include 'refract_dim.inc'
......
......@@ -27,6 +27,8 @@ c 03/07/98 V1.1 new clear concept - leave clipping to pgplot
c 04/07/98 V1.2 introduced traveltime reduction
c 12/11/12 V1.3 do not apply travel time reduction, if offset of
c seismograms is shifted intentionally
c 08/02/16 V1.4 introduce upper limit for world coordinate range
c in counts
c
c==============================================================================
cS
......@@ -50,7 +52,7 @@ c defined in refract_seipar.inc
c
integer i
logical reverse
real limit
real limit, mpc, rmaxamp
parameter(limit=1.e38)
c
include 'refract_dim.inc'
......@@ -213,14 +215,26 @@ c map to a viewport range
c
c d) Find world coordinates for traces viewport in counts
c -------------------------------------------------------
c
c The smaller the mpc-factor, the smaller the wiggle amplitude in the
c display. This is adjusted by increasing the world coordinate range (in
c counts). If mpc approaches zero, the world coordinate range approaches
c infinity which results in numerical overflow.
c
c Value range with respect to trace offset
rmaxamp=max(abs(trv_rtop-roffset(i)),
& abs(trv_rbot-roffset(i)))
c
c Find smallest mpc-factor acceptable
mpc=max(trv_mpc(i),rmaxamp/(limit-abs(average(i))))
c
c remap equivalent offset to seismogram counts
if (reverse) then
trv_vmax=-(trv_rtop-roffset(i))/trv_mpc(i)
trv_vmin=-(trv_rbot-roffset(i))/trv_mpc(i)
trv_vmax=-(trv_rtop-roffset(i))/mpc
trv_vmin=-(trv_rbot-roffset(i))/mpc
else
trv_vmax=(trv_rtop-roffset(i))/trv_mpc(i)
trv_vmin=(trv_rbot-roffset(i))/trv_mpc(i)
trv_vmax=(trv_rtop-roffset(i))/mpc
trv_vmin=(trv_rbot-roffset(i))/mpc
endif
c
c move trace within viewport in case we want to remove the average
......@@ -238,8 +252,6 @@ c check actual world coordinate range versus seismogram range
& result=.false.
endif
endif
c
if (result) then
c
c
c ======================================================================
......@@ -247,6 +259,8 @@ c
c 2. Operate on horizontak coordinates, time domain and world
c coordinates in seconds.
c -----------------------------------------------------------
c
if (result) then
c
c now check TIME SCALE
ttmin=toffset(i)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment