Skip to content

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

Description

@klaas-koster

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions