Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

dz, dx, and dy should be float #229

Open
Yuri-Albuquerque opened this issue Dec 30, 2021 · 4 comments
Open

dz, dx, and dy should be float #229

Yuri-Albuquerque opened this issue Dec 30, 2021 · 4 comments

Comments

@Yuri-Albuquerque
Copy link

def _get_dimensions(vp, bbox):

Hi, @krober10nd I think dz, dx, dy needs to be float. Using int() is causing a division by zero in _build_domain_pad function, when some of the widths (in x, z, or y directions) are smaller than nx, nz, or ny.

@krober10nd
Copy link
Owner

Hey Yuri, thanks. Could you post some code they causes the error you mention? I think I understand but would be nice to have a minimum failing example.

@Yuri-Albuquerque
Copy link
Author

I'm trying to generate the sizing function from a simple segy file whose data is an array of 1200 x 1200 using a bbox of 1000x1000 (probably this is my mistake). I was expecting a better resolution with a bbox smaller than the array data and indeed I got the sizing function but without padding the domain.

## Generates a sizing function from segy file
fname_guess = immersed_disk_guess.segy
bbox=(-1000.0, 0.0, 0.0, 1000.0)
ef_guess = SeismicMesh.sizing.get_sizing_function_from_segy(fname_guess, bbox,
    dt=0.001,
    wl = 10,
    freq = 2,
    hmin = 7.62,
    units = "m-s",
    domain_pad=100.0,
    pad_style="edge",
)

Below is the image of the data of this simple segy file (I can send it to you through email if you want). It is just an array of 1200X1200 with values of 4500 inside the ellipse and 1200 outside.
1_a_segy_ellipse

@krober10nd
Copy link
Owner

I see. Yea the problem is the width/height divided by the number of points in the two dimensions is below 1. You're right that this should improve the location of the level set in the velocity model.

I would just remove the type casts to int for the dx and dz and see what happens.

I won't be able to do this for a couple more days but please feel free to try it and run the tests and your example. Then submit a pull request from your fork, if you want.

@krober10nd krober10nd mentioned this issue Jan 7, 2022
@krober10nd
Copy link
Owner

@Yuri-Albuquerque please try this again with the latest commit on master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants