Problem using patch.coords.update_coords #451
-
Hello! I have a data in SEGY format in which the time step was written wrongly. I tried to solve it in the following way: file_path = fetch(path+arq)
spool = dc.spool(file_path)
patch = spool[0]
initial_time = patch.coords.get_array('time').min() # The initial time is correct
final_time= initial_time + np.timedelta64(500, 'us') * patch.coords.get_array('time').size # The time array length is correct.
new_time_array = np.arange(initial_time , final_time, np.timedelta64(500, 'us')) # Got the correct time array by doing this.
patch.coords.update_coords(time=new_time_array )
patch.io.write(pathout+arq.replace('.sgy', '.h5'), "dasdae") # Saved the file in DASDAE format When I open the new file, the data still have the old values. How can I solve it? |
Beta Was this translation helpful? Give feedback.
Answered by
tiago-pitchon
Oct 25, 2024
Replies: 1 comment
-
I found out that |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tiago-pitchon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found out that
patch.coords.update_coords()
is not a "inplace" method and returns an updatedpatch.coords
.So, I decided to create a new patch from zero using the data from the older one as describe in Manually create a patch.