Пример #1
0
 def plot_to_file(self, filename, resolution):
     #####################################################################
     "write 1D model data to a file"
     #####################################################################
     f = open(filename, 'w')
     for i in range(resolution + 1):
         x = doubleArray(1)
         x[0] = -1.0 + (2.0 * i) / resolution
         f.write("%f %f %f\n" % (x[0],
                                 self.p.GetProba(x),
                                 self.p.GetStrength(x)))
Пример #2
0
 def plot_to_file_2d(self, filename, resolution):
     #####################################################################
     "write 2D model data to a file"
     #####################################################################
     f = open(filename, 'w')
     for i in range(resolution + 1):
         x = -1.0 + (2.0 * i) / resolution
         for j in range(resolution + 1):
             y = -1.0 + (2.0 * j) / resolution
             v = doubleArray(2)
             v[0] = x
             v[1] = y
             f.write("%f %f %f %f\n" % (x,
                                        y,
                                        self.p.GetProba(v),
                                        self.p.GetStrength(v)))
         f.write('\n')