示例#1
0
def render_proba_contour(prob_volume, color_name, proba_level=0.5, title=None):
    s = prep_proba_for_contour(prob_volume)
    f = mlab.figure(size=(800, 800))
    mlab.contour3d(s, contours=[proba_level], color=to_rgb(color_name))
    mlab.outline()
    mlab_label(mlab.xlabel, text=EASTING_COL)
    mlab_label(mlab.ylabel, text=NORTHING_COL)
    mlab_label(mlab.zlabel, text='mAHD')
    if not title is None:
        mlab_title(title)
    return f
示例#2
0
 def overlay_bore_classes(self,
                          dem_mesh,
                          vol_mesh,
                          bore_data,
                          vol_colorname,
                          z_label=None,
                          points_scale_factor=None,
                          title=None):
     x_dem, y_dem, z_dem = dem_mesh
     vol_x, vol_y, vol_z, vol_s = vol_mesh
     bore_x, bore_y, bore_z, bore_s = bore_data
     f = mlab.figure(size=(1200, 800))
     if points_scale_factor is None:
         points_scale_factor = self.POINTS_SCALE_FACTOR
     p3d = mlab.points3d(bore_x,
                         bore_y,
                         bore_z,
                         bore_s,
                         colormap='spectral',
                         scale_factor=points_scale_factor,
                         scale_mode='none')
     self.set_litho_class_colormap_with_unclassified(
         get_colorscale_lut(p3d))
     mlab.outline()
     mlab_label(mlab.xlabel, text=EASTING_COL)
     mlab_label(mlab.ylabel, text=NORTHING_COL)
     if z_label is None:
         z_label = 'AHD x ' + str(self.z_scaling)
     mlab_label(mlab.zlabel, text=z_label)
     surface = mlab.surf(x_dem, y_dem, z_dem, colormap='terrain')
     surface.enable_contours = True
     surface.contour.number_of_contours = 20
     _ = mlab.contour3d(vol_x,
                        vol_y,
                        vol_z,
                        vol_s,
                        color=to_rgb(vol_colorname))
     if not title is None:
         mlab_title(title)
     # iso_surface.actor.property.color = (0.0, 1.0, 0.0)
     # iso_surface.actor.property.opacity = 0.0881
     # iso_surface.actor.property.representation = 'wireframe'
     return f
示例#3
0
    def render_class(self, volume_lithologies, class_value):
        """Render a give lithology class as a volume within the interpolated volume

        Args:
            volume_lithologies (3D array): gridded lithology classes
            class_value (int, or numeric cast to int): the numeric value (code) of the lithology class to render.
        """
        class_index = int(class_value)
        class_name = self.class_names[class_index]
        color_name = self.color_names[class_index]
        single_litho = extract_single_lithology_class_3d(volume_lithologies, class_value)
        mlab.figure(size=(800, 800))
        s = single_litho
        mlab.contour3d(s, contours=[class_value-0.5], color=to_rgb(color_name))
        mlab.outline()
        mlab_label(mlab.xlabel, text=self.dfcn.easting_col)
        mlab_label(mlab.ylabel, text=self.dfcn.northing_col)
        mlab_label(mlab.zlabel, text='mAHD')
        mlab_title(class_name)