Exemplo n.º 1
0
 def output(self, ddf_op, var_name):
     ndims = len(self.atts.numSamples)
     ddf_oname = "%s_%s_%dd" % (var_name, ddf_op, ndims)
     if len(self.atts.numSamples) == 1:
         src_fname = "%s.ultra" % self.atts.ddfName
         des_fname = "%s.ult" % (self.atts.ddfName)
         common.sexe("mv %s %s" % (src_fname, des_fname))
         lines = open(des_fname).readlines()
         f = open(des_fname, "w")
         f.write("# %s\n" % (ddf_oname))
         for l in lines[1:]:
             f.write(l)
         f.close()
     else:
         src_fname = "%s.vtk" % self.atts.ddfName
         orig_vtk_var = "SCALARS %s float" % var_name
         ddf_vtk_var = "SCALARS %s float" % ddf_oname
         des_fname = "%s%s_%04d.vtk" % (Params.output.file_base,
                                        self.atts.ddfName, ts())
         common.sexe("mv %s %s" % (src_fname, des_fname))
         data = open(des_fname).read()
         f = open(des_fname, "w")
         data = data.replace(orig_vtk_var, ddf_vtk_var)
         f.write(data)
     print "[ddf output: %s]" % des_fname
     return des_fname
Exemplo n.º 2
0
 def test_sexe(self):
     ofile = pjoin(output_dir, "_sexe_test")
     if os.path.exists(ofile):
         os.remove(ofile)
     common.sexe("touch %s" % ofile)
     self.assertTrue(os.path.isfile(ofile))
Exemplo n.º 3
0
 def test_sexe(self):
     ofile = pjoin(output_dir,"_sexe_test")
     if os.path.exists(ofile):
         os.remove(ofile)
     common.sexe("touch %s" % ofile)
     self.assertTrue(os.path.isfile(ofile))