Skip to content

TraceHeader duplication is time consuming #423

@seisgo

Description

@seisgo

segyio version: 1.8.6

I created a new segyfile based on an existed one, and duplicated the trace headers from the existed one. While, this process is time consuming, especially for big-size data. For example, the size of the existed segy file is 5.8G, for about 4 hour, the size of the new segy file is only about 1G. Actually, the time consumed of this process depends on the trace count of segy file, here the trace count is 641*1851=1186491.

Following is part of my code:

with segyio.open(args['input'], 'r') as iFile:
    spec = segyio.tools.metadata(iFile)

    # create output file
    with segyio.create(args['output'], spec) as oFile:
        for i in range(1+spec.ext_headers):
            oFile.text[i] = iFile.text[i]
        oFile.bin = iFile.bin
        oFile.header = iFile.header

This code is almost same as the example of 'create' in segyio documentation.

So, is this time-consuming process is normal?
If not, could anyone give a suggestion about copying traceheader when creating new segy file?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions