sede-open / synthoseis

Generating seismic data and associated labels to train deep learning networks.
MIT License
52 stars 10 forks source link

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 2 months ago

klaas-koster commented 2 months ago

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.