Saturday, December 3, 2011

Reading SEG-Y from Command Line

Yes, I've been gone for a month or so...

Here it is. If you don't have your favorite reader use these fun dd & hexdump commands from the command line.

Reading the EBCDIC header:
dd if=input_file.sgy conv=ascii conv=unblock


Reading the job number
hexdump -C -s 3201x -n 3 input_file.sgy | awk '{print $2 $3 $4;}'

Reading the line number:
hexdump -C -s 3205x -n 3 10_770.sgy | awk '{print $2 $3 $4;}'

Reading the reel number:
hexdump -C -s 3209x -n 3 10_770.sgy | awk '{print $2 $3 $4;}'

Reading the format code:
hexdump -C -s 3224x -n 2 10_770.sgy | awk '{print $2 $3;}'

Reading the sample interval:
hexdump -C -s 3216x -n 3 10_770.sgy | awk '{print $2 $3;}'

Reading the samples per trace:
hexdump -C -s 3220x -n 2 10_770.sgy | awk '{print $2 $3;}'

Reading the sort code:
hexdump -C -s 3228x -n 2 10_770.sgy | awk '{print $2 $3;}'

No comments:

Post a Comment