lanl / OpenFWI

A collection of codes with OpenFWI project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

numpy to image

quanhuiyuan opened this issue · comments

Hello author, may I ask how to convert the numpy array loaded with data.npy back into an image of seismic data

Hello, is the seismic data image you mean in SEGY format? If so, you can convert it to SEGY by saving the array as a binary file and then adding a header to the file using either Madagascar or Seismic Unix.

Sorry, that's not what I meant.
Taking data1. npy from the FlatVel-A dataset as an example, its dimensions are (500, 5, 1000, 70), which means there are a total of 500 samples. The array loaded through load is a numpy array, and I don't know how to convert this array back to the seismic graph?
Thank you for replying to my question🙏👍

Certainly. The number 500 represents sample numbers, while 5 corresponds to the source number. Additionally, 1000 represents the time sample, and 70 represents the receiver number. If you wish to obtain a common shot gather image, you can extract a slice from the dataset using the notation [0, 0, :, :]. Alternatively, for a common receiver gather, you can use [0, :, :, 0]. Please inform me if this is the desired outcome.

Yes. Besides, if we obtain an image of a common receiver gather, how can we convert this array into the corresponding image after taking [0,:,:, 0]? Can I call the function " plot_single_seismic() "in vis.py ?

Yes. You can use plot_single_seismic() to output the image, but I prefer to use matplotlib to plot it directly.

With your help, I have solved my problem. Thank you!

Hello, I have another question. I have read all the code and it seems that there is no need for the intervention of acoustic and elastic wave equations at all. It is all achieved through convolutional layer encoding and decoding of images, right?

Yes. InversionNet and VelocityGAN operate independently of physics, relying solely on data-driven techniques. In contrast, UPFWI in the OpenFWI paper is the only method that incorporates physical principles. Unfortunately, the release of the UPFWI code has not yet received approval from the DOE. Nonetheless, I believe that reproducing UPFWI should prove straightforward, as our paper and the original UPFWI paper by Jin et al. provide sufficient guidance.

Okay, thank you. I have reproduced it and it is indeed written very clearly💗