ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
SEG-Y files are huge, in general. and you dont read them 4 bytes at a time. It is least efficient way of doing it. You have to read them in binary mode, so you open the file in binary mode.
Read 3200 bytes and assign it to a datastructure ccalled EBCDICHeader, then read 400 bytes and allocate it to BinaryHeader.
From Binaryheader, get length of seismic trace(No. Of samples * sample size + 240 bytes for traceheader). Keep reading this chunk of bytes until all the data is done.
You cant do it in a simple 5 line program. Large data structures are involved.
Thanks a lot, but i really did't understand how to get normal data from this crazy symbols.
For example, this code (i think) must read 4 bytes into buffon;
So i see only that crazy delirium!
////////////////////////////////////////////////////
for (int i=0;i<1000;i++){
char buffon[1024];
int k=4;
l=f.readBlock(buffon,k);
cout << buffon << endl;}
////////////////////////////////////////////////////
What's wrong?
The data is in binary format. Thats it. You have to convert it to int or float or what-ever-it-is and then "cout" it. Unless ofcourse your data is ascii characters.
If you are trying to print first 3200 bytes of the SEG-Y file, they are characters alright, but they are in EBCDIC format. So you just cant print them.
ppanyam,
Am i right that after 3600 bytes there are the numerals?
And i need to find 21 byte.
After that i need to find last byte.
Of course i need to take the normal numerals (12 or 324) but not that abra-cadabra.
I think that's all i need to.
So my 21 byte will be 1st (conditionally) and i need to get the last numeral.
I home my English is enough to explain what i want.
Thanks for you participation.
I am on a vacation now. I will send a perl script to do it when I get back to work next week. You are right in assumption that there are numbers after 3600 bytes. I presume you are looking for inline or xline number. But I have not understood what you meant by
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.