资源描述:
《cgg和focus之间速度转换程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、CGG和Focus之间速度转换程序CGG和Focus之间速度转换程序GeoRisc在使用资料处理软件CGG和Focus时经常会遇到其间速度格式的转换问题。这里提供了两个用C-shell编写的程序v_focus2cgg和v_cgg2focus,利用它们可以实现从Focus的数据库速度到CGG的数据库速度以及到Focus的卡片格式的转换。(1)Focus数据库速度-->CGG速度格式%v_focus2cggprojectlinevel>velout.lv(2)CGG速度格式-->Focus速度卡片%catvelout.lvi
2、v_cgg2fo
3、cus>velout.dat或者,%v_cgg2focusvelout.dat(3)Focus数据库速度-->Focus速度卡片%v_focus2cggprojectlinevel
4、v_cgg2focus>velout.dat附录:(1)v_focus2cgg#!/bin/csh-f############################GeoRisc,Dec-04-2004############################setbdir=`dirname$0`setproject=$1setline=$2s
5、etvsdb=$3if($1==""
6、
7、$2==""
8、
9、$3=="")thenechoUsage:$0projectlinevsdbexitendifif($?PG_ROOT==0)thensetPG_ROOT=/PG2.0endifsetvfile=`echo$line$vsdb
10、awk'{printf("dir/file%s.veldefn.%squit",$1,$2)}'
11、$PG_ROOT/bin/sdbutl$project
12、grep$project`if($vfile=="")thenecho"$project:$l
13、ine.VELDEFN.$vsdbnotfound."endifsetawkfile=/var/tmp/v2_focus2cgg_$$.awktail+32$0>$awkfilechmod+x$awkfileif(-e$awkfile)then$awkfile$vfile/bin/rm-f$awkfileelseecho"$awkfilenotfound."endifexit#!/usr/bin/awk-fBEGIN{offset=17;local=34;count=0;pcdp=1;ncdp=1;n=split(FILENAME,a,"
14、/");lname=a[n];n=split(lname,a,".");lname=a[1];}{if(NR==3)handnum=$1;if(NR==4)total=$1;if(NR==5){pkeyname=$1;vtype=$2;printf("*LIBRIVI1TN(1-");}if(NR==local)num=$1;if(NR==local+1)pkey=$1;if(NR>local+offset+1&&NR15、ntf("(");printf("%7d)=T%5dV%5d,",pkey,$1+2,$2);printf("");fline=999;pcdp=pkey;}else{if((ncdp-1)%5==1)printf("");printf("T%5dV%5d,",$1,$2);if((ncdp-1)%5==0)printf("");}count++;}if(NR==local+offset+2+num){local=local+offset+3+num;printf("VF6000,");ncdp=1;}}END{print
16、f("VF6000,");if(total!=count){printf("ERROR!");}}(2)v_cgg2focus#!/bin/csh-f############################GeoRisc,Dec-04-2004############################sed-e's///g'
17、sed-e's/(//g'
18、sed-e's/)//g'
19、awk'{if(NF!=0){n=split($0,a,"-");printa[n];}}'
20、awk'{n=split($0,a,"=");i
21、f(n>1)printf("%s",$0);elseprintf("%s",$0);}'
22、sed-e's/=//g'
23、sed-e's/,//g'
24、awk'{if(NF==0)pr