Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cube_shape Z axis must be at least 500 to avoid index out of bound errors caused by hardwired onlap parameters #21

Open
klaas-koster opened this issue Jul 11, 2024 · 0 comments

Comments

@klaas-koster
Copy link

The parameters for the onlap layers are hardwired in Horizons.py on line 349:

onlap_layer_list = np.sort(
    np.random.uniform(
        low=5, high=200, size=int(np.random.triangular(1, 4, 7) + 0.5)
    ).astype("int")
)

This means that there will be between 1 and 7 onlap layers that fall in the range of layer number 5 to 200 - even if the model as defined with cube_shape in the configuration JSON file is samller than that.

Curiously, the array that contains zeroes and ones to indicate the onlap layers is not consistent with this, but has its own hardwired scalars set on line 370 in Horizons.py:

onlap_array_dim = int(500 / 1250 * self.cfg.cube_shape[2])
self.onlaps = np.zeros(onlap_array_dim, "int")
self.onlaps[onlap_layer_list] = 1

This means that the number of z-samples in the cube_shape defined in the configuration JSON file must be at least 500 in order to avoid randomly occurring 'index out of bounds' errors.

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

No branches or pull requests

1 participant