Closed joao-bapdm closed 3 years ago
bbox
is non-mutable because it's a tuple.
but the problem is both bbox and grid_spacing are integers so, it will create an integer when division is performed.
while we're at it, bbox=(0, 5110, 0, 5110)
and grid_spacing=(10, 10)
result in a space_model
with shape=(511, 511)
. But if I understand correctly, shape describes the number of grid points, so it should be (512, 512)
. If bbox
was (0, 10, 0, 10) you would still have shape=(2,2)
.
I have fixed the physical attributes (bounding_box, grid_spacing, damping length, source coordinates) type issue. Now, even if the user pass an integer value, it is converted to float.
while we're at it,
bbox=(0, 5110, 0, 5110)
andgrid_spacing=(10, 10)
result in aspace_model
withshape=(511, 511)
. But if I understand correctly, shape describes the number of grid points, so it should be(512, 512)
. Ifbbox
was (0, 10, 0, 10) you would still haveshape=(2,2)
.
Good point.
instead of:
nx = int((xmax - xmin) / x_spacing)
should be:
nx = int((xmax - xmin + x_spacing) / x_spacing)
or just:
nx = int((xmax - xmin) / x_spacing) + 1
while we're at it,
bbox=(0, 5110, 0, 5110)
andgrid_spacing=(10, 10)
result in aspace_model
withshape=(511, 511)
. But if I understand correctly, shape describes the number of grid points, so it should be(512, 512)
. Ifbbox
was (0, 10, 0, 10) you would still haveshape=(2,2)
.Good point.
instead of:
nx = int((xmax - xmin) / x_spacing)
should be:
nx = int((xmax - xmin + x_spacing) / x_spacing)
or just:
nx = int((xmax - xmin) / x_spacing) + 1
Done.
Only floats. Otherwise nothing is actually evaluated, as can be seen by running this MWE: