Commit 8805bcdb authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[TASK] (issue7_refract): remove obsolete file

sub/refract_settracevpold.f
was kept for historical reasons to provide a reference to an obsolete way to
set the trace view port. This file is from pre-CVS times. Source code history
now is recorded in the repository. The file is obsolete.
parent 4d67ddca
c this is <refract_settracevp.f>
c------------------------------------------------------------------------------
c
c 30/04/98 by Thomas Forbriger (IfG Stuttgart)
c
c set viewport and world coordinate values for a specific trace
c
c ----
c refract is free software; you can redistribute it and/or modify
c it under the terms of the GNU General Public License as published by
c the Free Software Foundation; either version 2 of the License, or
c (at your option) any later version.
c
c refract is distributed in the hope that it will be useful,
c but WITHOUT ANY WARRANTY; without even the implied warranty of
c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c GNU General Public License for more details.
c
c You should have received a copy of the GNU General Public License
c along with this program; if not, write to the Free Software
c Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
c ----
c
c REVISIONS and CHANGES
c 30/04/98 V1.0 Thomas Forbriger
c
c==============================================================================
cS
c
logical function settracevp(i)
c
c set viewport and world coordinate values for trace i
c
c returns true in case there is at least one sample to be plot
c
integer i
c
include 'refract_dim.inc'
include 'refract_data.inc'
include 'refract_seipar.inc'
include 'refract_para.inc'
c
cE
c
c tov stands for total viewport
c trv stands for trace viewport
c
c vppm (viewport per meter) is the scaling factor from "normalized device
c coordinates" to "world coordinates" (the latter are meters)
c
c all calculations will be carried out in the offset-domain and will be
c converted to "world coordinates" in the last step
c
c the result flag is used to check whether any part of the curve is
c visible within the global viewport
c
logical result
real vppm, tormin, tormax, trcmin ,trcmax, ttmin, ttmax
real maxamp
c
vppm=(tov_vptop-tov_vpbot)/(tov_rmax-tov_rmin)
result=.true.
c
c get absolute maximum of curve
if (plpar_remav) then
maxamp=max(abs(maxval(i)-average(i)),abs(minval(i)-average(i)))
else
maxamp=max(abs(maxval(i)),abs(minval(i)))
endif
c get offset values equivalent to minimum an maximum of trace
tormax=roffset(i)+maxamp*trv_mpc(i)
tormin=roffset(i)-maxamp*trv_mpc(i)
c
c respect cutting by cut value and border of global viewport
trcmax=min(tormax,roffset(i)+plpar_clip)
trcmin=max(tormin,roffset(i)-plpar_clip)
if ((trcmax.le.tov_rmin).or.(trcmin.ge.tov_rmax)) result=.false.
c
if (result) then
trv_rtop=min(trcmax,tov_rmax)
trv_rbot=max(trcmin,tov_rmin)
c
c remap equivalent offset to seismogram counts
trv_vmax=maxamp-(tormax-trv_rtop)/trv_mpc(i)
trv_vmin=-maxamp+(trv_rbot-tormin)/trv_mpc(i)
c
c map to a viewport range
trv_vpbot=(trv_rbot-tov_rmin)*vppm+tov_vpbot
trv_vptop=(trv_rtop-tov_rmin)*vppm+tov_vpbot
c
c move trace within viewport in case we want to remove the average
if (plpar_remav) then
trv_vmax=trv_vmax+average(i)
trv_vmin=trv_vmin+average(i)
endif
c
c now check time scale
ttmin=toffset(i)
ttmax=toffset(i)+(nsamples(i)-1)*dt(i)
if ((ttmin.ge.tov_tmax).or.(ttmax.le.tov_tmin)) result=.false.
endif
c
c set time scale if needed
if (result) then
trv_tmin=tov_tmin
trv_tmax=tov_tmax
trv_tleft=tov_tmin
trv_tright=tov_tmax
trv_vpleft=tov_vpleft
trv_vpright=tov_vpright
endif
c
settracevp=result
c
return
end
c
c ----- END OF refract_settracevp.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