Commit 6f25bd37 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

corrected mpc calculation

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 5350
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 9d5f972d
......@@ -254,14 +254,15 @@ c
c override traditional options
c ============================
c
if (opt_Savgref) opt_Smode=3
if (optset(24)) plflag_linestyle=opt_Lcycle
if (optset(29)) plflag_color=opt_Ccycle
if (optset(46)) plpar_expo=opt_Sexp
if (optset(49)) plpar_mode=opt_Smode
plpar_forceminoff=optset(53)
if (plpar_forceminoff) plpar_minoff=opt_Sminoff
if (optset(54)) plpar_radius=opt_Sradius
if (opt_Savgref) opt_Smode=3
plpar_mode=opt_Smode
print *,plpar_mode
c
c evaluate options as far as possible
c ===================================
......
......@@ -47,7 +47,8 @@ c
c
cE
integer i,j,tref
real trefoff, refmpc, maxamp
real trefoff, refmpc, maxamp, thisamp
c real avgoff
c
c scaling mode 1: individual scaling
c ----------------------------------
......@@ -95,23 +96,26 @@ c ----------------------------------------------------------
elseif (plpar_mode.eq.3) then
c go for files
do i=1,nfiles
print *,'ifile ',i
c print *,'ifile ',i
if (plflag_m3avg) then
c refer scaling to amplitude average
navg=0
maxamp=0.
c avgoff=0.
do j=1,ntraces
print *,'itrace ',j,' offset ',fieldoffset(j)
c print *,'itrace ',j,' offset ',fieldoffset(j)
if ((fileindex(j).eq.i)
& .and.(fieldoffset(j).ge.plpar_m3avgxmin)
& .and.(fieldoffset(j).le.plpar_m3avgxmax)) then
navg=navg+1
if (plpar_remav) then
maxamp=maxamp+max(abs(maxval(j)-average(j)),
thisamp=max(abs(maxval(j)-average(j)),
& abs(minval(j)-average(j)))
else
maxamp=maxamp+max(abs(maxval(j)),abs(minval(j)))
thisamp=max(abs(maxval(j)),abs(minval(j)))
endif
maxamp=maxamp+thisamp*(fieldoffset(j)**plpar_expo)
c avgoff=avgoff+fieldoffset(j)
endif
enddo
if (navg.lt.1) then
......@@ -121,6 +125,8 @@ c refer scaling to amplitude average
stop 'aborting...'
endif
maxamp=maxamp/navg
c avgoff=avgoff/navg
refmpc=plpar_amp/maxamp
else
c refer scaling to nearest offset trace
c find trace with least fieldoffset within file
......@@ -147,8 +153,8 @@ c calculate reference scale with respect to total reference
else
maxamp=max(abs(maxval(tref)),abs(minval(tref)))
endif
refmpc=plpar_amp/(maxamp*(fieldoffset(tref)**plpar_expo))
endif
refmpc=plpar_amp/(maxamp*(fieldoffset(tref)**plpar_expo))
c set mpc factors within file
do j=1,ntraces
if (fileindex(j).eq.i) then
......
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