gempy
gempy copied to clipboard
plotting/integrating custom grid cell properties
Is your feature request related to a problem? Please describe. Currently, model grid cell data derived from the lith_block solutions cannot be easily plotted, and require one e.g. to set and overwrite the solutions.lith_block = derived_data (assuming both shapes are equal). A future feature request would be to allow for custom model grid cell data to be added to the geo_model class.
Describe the solution you'd like Define new function in visualisations_2d that allow for the specification of a custom "block" parameter to plot_regular_grid, maybe something as per below. Update plot_2d to allow for custom_block_data as input (in future, update geo_model class with a model_grid_data_properties df).
def plot_custom(self, ax, custom_block_data: np.ndarray, section_name=None, cell_number=None, direction='y', **kwargs):
assert np.shape(custom_block_data) == np.shape(self.model.solutions.lith_block)
self.plot_regular_grid(ax,` section_name, cell_number, direction, block=custom_block_data)
As for 3d, similar as above, update plot_structured_grid() in _vista to include custom_data_block. Add a new name ("custom"), and set
elif name == "custom":
assert np.shape(custom_data_block) == np.shape(self.model.solutions.lith_block)
vals = custom_data_block
Speaking of, is there any plan on implementing a basic model_grid_data_properties function? (Or is there already something like it? in which case, my apologies for not having found it!)
Describe alternatives you've considered Overwriting lith_block or solutions with other properties (it works), though can be tedious. As for the integrated model_grid_data_properties functionality; for the time being these can just be stored in a dataframe that is not part of the geo_model - though would be useful to have as an integrated function.
Additional context
Example showing distance from a fault zone (useful for creating varying fault core thicknesses):
and in 2d:
In both cases, I had to overwrite the lith_block values for easy displaying (as per the suggestions in #326 and #503)