⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pssort

📁 su 的源代码库
💻
字号:
#! /bin/sh# set PostScript Previewer here if environment variable PSPREVIEWER not setVIEWER=$PSPREVIEWERGRAPHER=psgraphIMAGER=supsimageWIGGER=supswigpLINES=18COMMANDS=Commands_Onlyindata=data.seisoutdata1=data.fullfoldoutdata2=data.sortdownoutdata3=data.unsortoutdata4=data.recgatheroutdata5=data.stackoutdata6=data.nearoutdata7=data.far# Eventually put Model here# First make the synthetic data for the sorting demo.echo "Making synthetic data for demo"######START OF MODEL######REF1="1.0:-2,0.2;4,0.2"REF2="1.0:-2,2.0199;3.5495,0"REF3="1.0:-2,4.3955;3.2384,0"REF4="1.0:-2,8.8603;3.1155,0"dvdz=.015  # velocity gradient (dv/dz)dvdx=-0.2  # velocity gradient (dv/dx)v00=5.0  # P-wave velocity at surface in km/snxo=6 fxo=0.04 dxo=0.04 # offset information: number, first and spacingnxs=12 fxs=1.0 dxs=0.04 # shot information: number, first and spacingnt=200 dt=0.004         # time information: number and spacingsusynlv v00=$v00 ndpfz=10 dvdz=$dvdz dvdx=$dvdx \		dt=$dt nt=$nt verbose=0 \		ref=$REF1 ref=$REF2 ref=$REF3 ref=$REF4 \		nxo=$nxo fxo=$fxo dxo=$dxo \		nxs=$nxs fxs=$fxs dxs=$dxs  |suchw key1=cdp key2=gx key3=sx b=1 c=1 d=2 >$indata######END OF MODEL######echoecho "ADVICE: GO THROUGH THIS DEMO SLOWLY, THINKING CAREFULLY ABOUT EACH SCREENFUL"echoecho "Let's display the model data: 12 shot gathers each with 6 offsets"$IMAGER <$indata perc=99 title="Shot Gathers"\	label1="Time (sec)" label2="Shot Gather" f2=1 d2=0.166667 | $VIEWER # SORTING EXAMPLES# Use surange to get overview of header values set, etc.echoecho "########EXAMPLE: GET OVERVIEW OF DATA SET########"echo "Use surange to see the header values that are set."echoecho "surange <$indata"pause run commandsurange <$indataechoecho "The results from surange are consistent with our model having"echo "12 shot gathers of 6 traces each.  Indeed, we see that there are 72"echo "traces, 12 shot points, offsets ranging from 40 to 240. Moreover,"echo "each trace has 200 samples at 4ms sampling interval, etc."echoecho "Remarks: in this model, we've set the cdp to (sx + gx)/2, instead"echo "of using the conventional numbering 1, 2, 3, ...  Also, to make things"echo "interesting, the model has a whopping lateral velocity variation."# Get a stacking chartechoechoecho "Now get a stacking chart (the command is from the suchart self-doc):"echoecho "suchart <$indata |"            echo "$GRAPHER n=72 title=\"Stacking Chart\" label1=\"sx\" label2=\"gx\" \\ "echo "linewidth=0 marksize=2 mark=8 | $VIEWER"pause run commandssuchart <$indata |                     $GRAPHER n=72 title="Stacking Chart" label1="sx" label2="gx" \ linewidth=0 marksize=2 mark=8 | $VIEWER                     echoecho "The stacking chart is consistent with the model having"echo "its shot spacing equal to its geophone spacing.  Indeed, in such a"echo "data set, the fold is always half the number of offsets, here 6/2 = 3,"echo "and the offset values alternate in successive traces."# Find region of full foldechoecho "########CONTINUE OVERVIEW AND DETERMINE REGION OF FULL FOLD########"echo "We can pin these facts down precisely by using susort:"echo "We sort to cdp on the fly to get region of full fold."echo "Since the default sort key is \"cdp\", we need not mention it."echo "After sorting, pipe into sugethw to verify the sort:"echoecho "susort <$indata | sugethw cdp offset"echoecho "Note: This list will over-run the screen, we hope you can scroll back."echo "We promise not to do it again!"pause run commandssusort <$indata | sugethw cdp offsetechoecho "We now see that the region of full fold (here only 3-fold) is between"echo "cdps 1100 and 1480."echoecho "Also note that the near offset alternates between 40 and 80,"echo "while the far offset alternates between 200 and 240."pause# Window to full fold region and sort by cdp and offsetechoecho "IMPORTANT:"echo "We displayed the offset values along with the cdp values"echo "to make a point:  On some machines, the \"natural\" offset"echo "order is preserved; but on many machines it is not.  Even if your"echo "your present compiler preserves the natural order, DON'T come to"echo "depend on this---if you CARE about the order of the offsets, then"echo "use SECONDARY SORT KEYS in susort applications.  We'll do this"echo "in our next example."echoecho "########WINDOW TO REGION OF FULL FOLD########"echo "Window to full fold region and sort by cdp and then by offsets"echo "within a given cdp.  Afterwards check the cdp and offset order"echo "(from now on we only show the first ${LINES} lines from sugethw):"echoecho "suwind <$indata key=cdp min=1100 max=1480 |"echo "susort cdp offset >$outdata1"echo "sugethw<$outdata1 cdp offset | sed ${LINES}q"pause run commandssuwind <$indata key=cdp min=1100 max=1480 |susort cdp offset >$outdata1sugethw<$outdata1 cdp offset | sed ${LINES}qecho "        . . ."echoechoecho "Looks OK!"echoecho "And we see the expected two step alternation of the offsets."echopause Display the selected data in cdp order$IMAGER <$outdata1 perc=99 title="CDP and +Offset"\	label1="Time (sec)" label2="CDP Gather" f2=1 d2=0.333333 | $VIEWER# sort data by decreasing cdp and within each cdp by offsetecho "########EXAMPLE: SORT WITH DECREASING OFFSET ORDER########"echo "Now we exercise the sort options without regard to geophysical"echo "meaning.  First, re-sort the full-fold data by cdp, but within each cdp"echo "use DECREASING offset and check result with sugethw."echoecho "susort <$outdata1 cdp -offset >$outdata2"echo "sugethw <$outdata2 cdp offset | sed ${LINES}q"pause run commandsusort <$outdata1 cdp -offset >$outdata2 sugethw <$outdata2 cdp offset | sed ${LINES}qecho "        . . ."echopause Display the full fold data in reverse offset order$IMAGER <$outdata2 perc=99\	title="CDP and -Offset"\ 	label1="Time (sec)" label2="CDP Gather" f2=1 d2=0.333333 | $VIEWER# reconstruct windowed data $outdata1 from $outdata2echoecho "########EXAMPLE: RE-SORT TO INCREASING OFFSET ORDER AND CHECK########"echo "Next, return to increasing cdp order and check:"echoecho "susort <$outdata2 cdp offset >$outdata3"echo "sudiff $outdata1 $outdata3 | sumax"pause run commandssusort <$outdata2 cdp offset >$outdata3sudiff $outdata1 $outdata3 | sumaxechoecho "Good, no difference in the two data sets."# make receiver gathers from shot gathersechoecho "########EXAMPLE: GET RECEIVER SORT########"echo "Next, make receiver gathers from original shot gathers:"echoecho "susort <$indata gx offset >$outdata4"echo "sugethw <$outdata4 gx sx cdp offset | sed ${LINES}q"pause run commandssusort <$indata gx offset >$outdata4sugethw <$outdata4 gx sx cdp offset | sed ${LINES}qecho "        . . ."echopause Display receiver gathers--receiver numbering is arbitrary$IMAGER <$outdata4 perc=99 title="Receiver Gathers"\	label1="Time (sec)" label2="Receiver Gather" f2=1 d2=1 | $VIEWER# application: stackingechoecho "########EXAMPLE: STACK THE DATA########"echo "We sort the full fold data by cdp and then stack it."echo "Now we don't care about offset ordering and can just"echo "use the default susort and sustack keys which are both \"cdp\"."echo "After stacking, use sugethw to check the fold values (nhs keyword)."echoecho "susort <$outdata1 |"echo "sustack >$outdata5"echo "sugethw <$outdata5 cdp nhs | sed ${LINES}q"pause run commandssusort <$outdata1 |sustack >$outdata5sugethw <$outdata5 cdp nhs | sed ${LINES}qecho "        . . ."echopause Display the stacked data$WIGGER <$outdata5 perc=99 title="Stacked Data"\	label1="Time (sec)" label2="CDP Location" f2=1100 d2=20 | $VIEWER# get near and far common offset sections (doesn't use susort, but ...)echoecho "########EXAMPLE: GET NEAR OFFSET SECTION########"echo "Get near and far common offset sections (doesn't use susort, but ...)"echo "Recall that the near offsets in the full-fold portion of the data"echo "vary between 0 and 40 and the fars between 160 and 200."echo "First the nears:"echoecho "suwind <$indata key=offset min=40 max=80 >$outdata6"echo "sugethw <$outdata6 cdp offset | sed ${LINES}q"pause run commandsuwind <$indata key=offset min=40 max=80 >$outdata6sugethw <$outdata6 cdp offset | sed ${LINES}qecho "        . . ."echopause Display the near offset data$WIGGER <$outdata6 perc=99 title="Near Offsets"\	label1="Time (sec)" label2="CDP Location" f2=1020 d2=20 | $VIEWERechoecho "########EXAMPLE: GET FAR OFFSET SECTION########"echo "Then the fars:"echo "suwind <$indata key=offset min=200 max=240 >$outdata7"echo "sugethw <$outdata7 cdp offset | sed ${LINES}q"pause run commandssuwind <$indata key=offset min=200 max=240 >$outdata7sugethw <$outdata7 cdp offset | sed ${LINES}qecho "        . . ."echopause Display the far offset data$WIGGER <$outdata7 perc=99 title="Far Offsets"\	label1="Time (sec)" label2="CDP Location" f2=1100 d2=20 | $VIEWERechoecho "Observe the two step \"jitter\" in the shallow layer.  This is typical"echo "of data gathered with shot spacing equal to receiver spacing."echoecho "For your convenience, the file $COMMANDS contains the commands"echo "used in this demo, with brief comments, but without the lines serving"echo "to control the flow of the demo."echo "########EXITING SORT DEMO########"exit

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -