#defien BINDIR ../../Bin
#define FIGDIR ../Fig
#include <SEP.defs>
#define FIGLIST cdp641

#define DIR ../../Data/Oseberg
#define DATA Line_124.H
#define ATTR Line_124.HDR


/* ------------------------------- for aniso seminar paper */
jsemban641.S.H:
	Window n1=750 <semball-0.4-2.0.H >jjj.H
	Window j1=10 f4=7 n4=1 <jjj.H >jsemban641.S.H

jsemban641.S.T: jsemban641.S.H
	Byte <jsemban641.S.H gainpanel=all >jsemban641.S.T

OseSemban641.V3: 
        Cubeplot movie=1<jsemban641.S.T color=IC  flat=n >OseSemban6411.V3

OseSemban641.v3:
        Vppen <OseSemban641.V3 out=/wrk7/martin/Aniso.seminar/Fig/OseSemban641.v3 head=/dev/null

OseSemban641.V:
        Cubeplot movie=0 frame1=50 <jsemban641.S.T color=IC  flat=n >OseSemban641.V 

OseSemban641.v:
        Vppen <OseSemban641.V out=/wrk7/martin/Aniso.seminar/Fig/OseSemban641.v head=/dev/null

/* ---------------------------- */


vgrid:
	Merge 
	Vgrid option=1 <../RealPick/cdp.641.h nmid=2 


before+after&: semb641.h sembdmo641.h
	Window n1=750 <semb641.h >junk1
	Window n1=750 <sembdmo641.h >junk2
	Merge junk1 junk2 space=n >compvelan641.h


semb641.h: cdp.H BINDIR/VeltranI
	Window f3=7 n3=1 <cdp.H >cdp641.h
	VeltranI semb=1 eps=1.e-15 ns=200 vel=1 vmin=1400 vmax=4400 conj=1 <cdp641.h >semb641.h
	
sembdmo641.h: cdpbigdmo.h BINDIR/VeltranI
	Window f3=60 n3=1 <cdpbigdmo.h >cdpdmo641.h
	VeltranI semb=1 eps=1.e-15 ns=200 vel=1 vmin=1400 vmax=4400 conj=1 <cdpdmo641.h >sembdmo641.h

/* get a semblance around the well */

semb641.v:
	Window <semball.h f3=7 n3=1 >semb641.h
	Contour <semb641.h out=semb641.v  head=/dev/null

semb639.h&: cdp.h BINDIR/VeltranI
	Window f3=5 n3=1 <cdp.h >cdp639.h
	VeltranI semb=1 eps=1.e-15 ns=200 vel=1 vmin=1400 vmax=4400 conj=1 <cdp639.h >semb639.h

semball.h&: BINDIR/VeltranI
	VeltranI semb=1 eps=1.e-15 ns=200 vel=1 vmin=1400 vmax=4400 conj=1 <cdp.h >semball.h

semball-0.8-1.2.H&: BINDIR/VeltranA
	VeltranA semb=1 eps=1.e-15 ns=200 vel=1 vmin=1400 vmax=4400 conj=1 vel=1 f0=0.8 df=0.04 nf=15 <cdp.H >semball-0.8-1.2.H

Ovelinv50-0-2.0.H&: BINDIR/VeltranA
	VeltranA semb=1 eps=1.e-15 ns=200 vel=1 vmin=1400 vmax=4400 conj=1 vel=1 f0=0.4 df=0.05 nf=33 <cdp.H >semball-0.4-2.0.H datapath=/scr2/martin/TensorLog/

cdp.H:  jsort.h 
	Window f3=531 n3=11  <jsort.h >cdp.H

FIGDIR/cdp641.v: cdp641.H
	Window n1=750 <cdp641.H |Tpow tpow=1.5 >jj
	Taplot <jj gpow=1 |Ta2vplot title="well site cdp gather" out=FIGDIR/cdp641.v head=/dev/null label1="time [sec]" label2="offset [m]"

cdp641.H: cdp.H
	Window f3=7 n3=1 <cdp.H >cdp641.H

/* takes some time */
jsort.h: DIR/DATA 
	cp DIR/DATA DATA
	echo in=DIR/DATA@ >> DATA
	echo attrfile=DIR/ATTR >> DATA
	Cubify <DATA >jsort.h  attrout=jsort.hdr.h axis2=sg_dist axis3=cdp_no           d2=50.0 n2=48

testsort&:
	Cubify <DATA >jtestsort.h  attrout=jsort.hdr.h axis2=sg_dist axis3=cdp_no d2=25.0 n2=48


/* apply 2D DMO to data */

dmo& cdpbigdmo.h: cofbig.h
	Hdmo <cofbig.h >cofbigdmo.h
	Transp plane=23 <cofbigdmo.h >cdpbigdmo.h

cdpbig.h: jsort.h if not exist cdpbig.h
	Window <jsort.h f3=479  n1=900>cdpbig.h
	echo "o3=0 d3=25.0" >> cdpbig.h

cofbig.h: cdpbig.h
	Transp plane=23 <cdpbig.h >cofbig.h

BINDIR/Veltran%: if not {{ cd ../../Bin ; cake -q Veltran% }}
	( cd ../../Bin ; cake Veltran% )

clean&:
	-RM_CMD   *.x j*  *.o *.f *.H *.h *.hh *.V *.V3

veryclean&:
	RM_CMD *.h  rho vel* *log  

#include <SEP.obj.rules>
#include <SEP.prog.rules>
#include <SEP.idoc.rules>
