@@ -147,29 +147,26 @@ def add_section(self, geological_feature=None, axis='x', value=None, **kwargs):
147147 -------
148148
149149 """
150- print ('aa' )
151150 if axis == 'x' :
152151 tri , yy , zz = create_surface (self .bounding_box [:, [1 , 2 ]], self .nsteps [[1 , 2 ]])
153152 xx = np .zeros (zz .shape )
154153 if value is None :
155- xx [:] = np .nanmean (self .bounding_box [:, 0 ])
156- else :
157- xx [:] = value
154+ value = np .nanmean (self .bounding_box [:, 0 ])
155+ xx [:] = value
158156 if axis == 'y' :
159157 tri , xx , zz = create_surface (self .bounding_box [:, [0 , 2 ]], self .nsteps [[0 , 2 ]])
160158 yy = np .zeros (xx .shape )
161159 if value is None :
162- yy [:] = np .nanmean (self .bounding_box [:, 1 ])
163- else :
164- yy [:] = value
160+ value = np .nanmean (self .bounding_box [:, 1 ])
161+ yy [:] = value
165162 if axis == 'z' :
166163 tri , xx , yy = create_surface (self .bounding_box [:, 0 :2 ], self .nsteps [0 :2 ])
167164 zz = np .zeros (xx .shape )
168165 if value is None :
169- zz [:] = np .nanmean (self .bounding_box [:, 2 ])
170- else :
171- zz [:] = value
172- name = kwargs . get ( 'name' , axis + '_slice' )
166+ value = np .nanmean (self .bounding_box [:, 2 ])
167+ zz [:] = value
168+ name = kwargs . get ( 'name' , geological_feature . name )
169+ name = '{}_section_at_{}_of_{}' . format ( axis , value , name )
173170 colour = kwargs .get ('colour' , 'red' )
174171
175172 # create an array to evaluate the feature on for the section
@@ -208,9 +205,7 @@ def add_section(self, geological_feature=None, axis='x', value=None, **kwargs):
208205 cmap = lavavu .cubehelix (100 )
209206 if 'cmap' in kwargs :
210207 cmap = kwargs ['cmap' ]
211- # logger.info("Colouring section with %s min: %f, max: %f" % (
212- # geological_feature.name, geological_feature.min(), geological_feature.max()))
213- # surf.colourmap(cmap, range=[geological_feature.min(), geological_feature.max()])
208+
214209 def add_isosurface (self , geological_feature , value = None , isovalue = None ,
215210 paint_with = None , slices = None , colour = 'red' , nslices = None ,
216211 cmap = None , filename = None , names = None , colours = None ,** kwargs ):
0 commit comments