lanl / OpenFWI

A collection of codes with OpenFWI project
BSD 3-Clause "New" or "Revised" License
61 stars 10 forks source link

numpy to image #3

Closed quanhuiyuan closed 8 months ago

quanhuiyuan commented 10 months ago

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

Shihang-LANL commented 10 months ago

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.

quanhuiyuan commented 10 months ago

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🙏👍

Shihang-LANL commented 9 months ago

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.

quanhuiyuan commented 9 months ago

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 ?

Shihang-LANL commented 9 months ago

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

quanhuiyuan commented 9 months ago

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

quanhuiyuan commented 9 months ago

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?

Shihang-LANL commented 9 months ago

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.

quanhuiyuan commented 9 months ago

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