equinor / segyio

Fast Python library for SEGY files.
Other
469 stars 213 forks source link

More speed =) #525

Closed grisha-lu closed 2 years ago

grisha-lu commented 2 years ago

Hey! Is it possible to increase the speed of the following when:

with segyio.open(files, mode='r', ignore_geometry=True) as sgy:
         RP = sgy.attributes(147)[:]

I have about 2 million traces and this procedure takes a very long time. And one more question. Is it also possible to increase the performance of this code:

with segyio.open(files, mode='r+', ignore_geometry=True, strict = False) as sgy:
         for x in sgy.header[:]:
             x.update({69: 10, 71: 10 })

Thanks!

ErlendHaa commented 2 years ago

Hi,

attributes is designed to be the faster faster option in this case, compared to header. Your second example looks ok too. How slow are we talking here? Do you have any measurement for the two scripts?

grisha-lu commented 2 years ago
with segyio.open(files, mode='r', ignore_geometry=True) as sgy:
          RP = sgy.attributes(147)[:]

2163064 trace 348 seconds Thanks! Error in another. Data on the server, but launched from a PC. It's stupid not to think about it.