Commit 380b80b9 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[!!!][WP] (issue7 refract): provide new subroutine setrefrange

Provide subroutine to set suitable offset range to determine reference
amplitude for scaling, if not set by the user on the command line.

This version does not compile.
parent 1abbb9c6
......@@ -90,7 +90,8 @@ REFSUB=refract_readdata.o refract_skipdata.o refract_setdefaults.o \
refract_varplot.o refract_pgparameters.o refract_ttreduce.o \
refract_message.o refract_dopicks.o refract_domodel.o refract_usage.o \
refract_cmdopt.o refract_selfilestyle.o refract_preread.o \
refract_pgdefaults.o refract_vpframe.o refract_plotoffset.o
refract_pgdefaults.o refract_vpframe.o refract_plotoffset.o \
refract_setrefrange.o
REFOBS=refract.o $(addprefix sub/, $(REFSUB))
# Fortran dependencies
......
......@@ -52,6 +52,9 @@ c unusual cases (see refract_setscale.f)
c 20/11/2012 V4.9 several new plot style options are implemented
c 24/10/2013 V4.10 added alternative definitions of ordinate scale
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
c==============================================================================
c
......@@ -59,7 +62,7 @@ c
c
character*79 version
parameter(version=
& 'REFRACT V4.12 REFRACTion seismics - data interpretation')
& 'REFRACT V4.13 REFRACTion seismics - data interpretation')
c
c get common blocks
include 'refract_dim.inc'
......
c this is <sub/refract_setrefrange.f>
c ----------------------------------------------------------------------------
c
c Copyright (c) 2015 by Thomas Forbriger (BFO Schiltach)
c
c Set offset range to take amplitude scaling reference from, if not set
c on command line.
c
c REVISIONS and CHANGES
c 07/12/2015 V1.0 Thomas Forbriger
c
c ============================================================================
c
cS
subroutine refract_setrefrange
c
c set default scaling
c
include 'refract_dim.inc'
include 'refract_data.inc'
include 'refract_para.inc'
include 'refract_opt.inc'
cE
c
c The default is read from the command line parameter defaults. Make
c sure that the range at least includes on trace of each file.
c
real rmin,rmax
integer i
real reffraction
c fraction of total offset range to be used for reference
parameter(reffraction=0.1)
c
c adjust offset range only if not specified on command line
if (.not.opt_Savgref) then
c
c find overall minimum and maximum field offset value
rmin=fieldoffset(1)
rmax=fieldoffset(1)
do i=1,ntraces
rmin=min(rmin,fieldoffset(i))
rmax=max(rmax,fieldoffset(i))
enddo
c
c set reference to the smalles reffraction fraction
plpar_avgrefxmin=rmin
plpar_avgrefxmax=rmin+(rmax-rmin)*reffraction
c
c check for at least one trace of each file being present in the
c selected range
do i=1,nfiles
rmin=plpar_avgrefxmin
do j=1,ntraces
if (fileindex(j).eq.i) then
rmin=min(rmin,fieldoffset(j))
endif
enddo
plpar_avgrefxmax=max(plpar_avgrefxmax,rmin)
enddo
c
if (verbose) then
print *,'offset range to which amplitude scaling is referred:'
print *,' ',plpar_avgrefxmin', m to '
print *,plpar_avgrefxmax', m'
endif
endif
c
return
end
c
c ----- END OF sub/refract_setrefrange.f -----
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