コード例 #1
0
    def test_simple_plot(self):
        '''
		Test the capability of plotting by passing only the data file
		'''

        output_file = os.path.join(self.out_dir, 'grid_slice_plot1.png')
        try:
            _ = gs.grid_slice_plot(self.data, output_file=output_file)
        except Exception as ex:
            self.fail(
                'Unable to test the grid slice plot with simple settings \n{}'.
                format(str(ex)))

        self.assertEqual(os.path.isfile(output_file), True)
コード例 #2
0
    def test_orient_slice_number_plot(self):
        '''
		Test the capability of specifying number of slices and orientation
		'''

        output_file = os.path.join(self.out_dir, 'grid_slice_plot2.png')
        try:
            _ = gs.grid_slice_plot(self.data,
                                   orient='xz',
                                   n_slice=5,
                                   output_file=output_file)
        except Exception as ex:
            self.fail(
                'Unable to test the grid slice plot with number of slices and orientation \n{}'
                .format(str(ex)))

        self.assertEqual(os.path.isfile(output_file), True)
コード例 #3
0
    def test_nrow_ncol_plot(self):
        '''
		Test the capability of specifying number of rows or columns required for the slices
		'''

        output_file = os.path.join(self.out_dir, 'grid_slice_plot3.png')
        try:
            _ = gs.grid_slice_plot(self.data,
                                   orient='xz',
                                   n_slice=6,
                                   ncol=2,
                                   nrow=3,
                                   output_file=output_file)
        except Exception as ex:
            self.fail(
                'Unable to test the grid slice plot number of rows or columns required for the slices \n{}'
                .format(str(ex)))

        self.assertEqual(os.path.isfile(output_file), True)
コード例 #4
0
    def test_custom_plot(self):
        '''
		Test the ability to specify slice_plot kwargs using this function, so we can apply consistent
		custom formatting to all of the subplots:
		'''

        output_file = os.path.join(self.out_dir, 'grid_slice_plot4.png')
        try:
            _ = gs.grid_slice_plot(self.data,
                                   nrow=2,
                                   ncol=5,
                                   start_slice=10,
                                   end_slice=25,
                                   n_slice=10,
                                   cmap='hot',
                                   vlim=(-3, 3),
                                   output_file=output_file)
        except Exception as ex:
            self.fail(
                'Unable to test the grid slice plot to specify slice_plot kwargs \n{}'
                .format(str(ex)))

        self.assertEqual(os.path.isfile(output_file), True)
コード例 #5
0
import pygeostat as gs
# load some data
data = gs.ExampleData('3d_grid',
                      griddef=gs.GridDef([40, 1, 2, 40, 1, 2, 40, 0.5, 1]))
# plot the grid slices
_ = gs.grid_slice_plot(data, orient='xz', n_slice=5)
コード例 #6
0
import pygeostat as gs
# load some data
data = gs.ExampleData('3d_grid',
                      griddef=gs.GridDef([40, 1, 2, 40, 1, 2, 40, 0.5, 1]))
# plot the grid slices
_ = gs.grid_slice_plot(data)
コード例 #7
0
import pygeostat as gs
# load some data
data = gs.ExampleData('3d_grid',
                      griddef=gs.GridDef([40, 1, 2, 40, 1, 2, 40, 0.5, 1]))
# plot the grid slices
_ = gs.grid_slice_plot(data, orient='xz', n_slice=6, ncol=2, nrow=3)
コード例 #8
0
import pygeostat as gs
# load some data
data = gs.ExampleData('3d_grid',griddef = gs.GridDef([40,1,2,40,1,2,40,0.5,1]))
# plot the grid slices
_ = gs.grid_slice_plot(data, nrow=2, ncol=5, start_slice=10, end_slice=25, n_slice=10, cmap='hot', vlim=(-3,3))