I want to create some functionality in my C code that allows to model data and store them in SEG-Y files for usage later. I couldn't find an example that demonstrates how to write files from scratch, and I find it difficult to get started with it. I would appreciate any help that could give me a point to start working on this, e.g. a minimal example/script that shows how to write a trace and a trace_header, or so.
I have the following data-structure in my C code, which I want to store into a SEG-Y:
typedef struct wavefield {
float xmin, xmax, dx; // receivers across X-axis
float ymin, ymax, dy; // receivers across Y-axis
float tmin, tmax, dt; // time-range and sample interval
float *data; // pointer to data
float srcx, srcy; // source position
int nx, ny, nt; // dimensions
int ldx, ldy, ldt; // leading dimensions ( ldx==1, ldy==nx, ldt==ny*nx )
} wavefield;
I want to create some functionality in my C code that allows to model data and store them in SEG-Y files for usage later. I couldn't find an example that demonstrates how to write files from scratch, and I find it difficult to get started with it. I would appreciate any help that could give me a point to start working on this, e.g. a minimal example/script that shows how to write a
trace
and atrace_header
, or so.I have the following data-structure in my C code, which I want to store into a SEG-Y:
my goal is to implement an interface like this:
Any piece of code, hint, or link where to look further would be much appreciated:)