/[escript]/trunk/weipa/py_src/__init__.py
ViewVC logotype

Diff of /trunk/weipa/py_src/__init__.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4356 by caltinay, Mon Mar 25 04:01:25 2013 UTC revision 4357 by caltinay, Thu Apr 11 06:07:14 2013 UTC
# Line 175  def saveVoxet(filename, **data): Line 175  def saveVoxet(filename, **data):
175    
176      from esys.escript import ReducedFunction      from esys.escript import ReducedFunction
177      from esys.escript.util import interpolate      from esys.escript.util import interpolate
178      from esys.ripley.ripleycpp import _writeBinaryGrid      from esys.ripley.ripleycpp import DATATYPE_FLOAT32, BYTEORDER_BIG_ENDIAN
179    
180      new_data={}      new_data={}
181      domain=None      domain=None
182      for n,d in list(data.items()):      for n,d in list(data.items()):
# Line 210  def saveVoxet(filename, **data): Line 211  def saveVoxet(filename, **data):
211          spacing=spacing+(1.,)          spacing=spacing+(1.,)
212          NE=NE+(1,)          NE=NE+(1,)
213          midpoint=midpoint+(0,)          midpoint=midpoint+(0,)
214            axis_max=axis_max+(0,)
215    
216      mainvar=new_data.keys()[0]      mainvar=new_data.keys()[0]
217      f=open(filename,'w')      f=open(filename,'w')
# Line 237  END_ORIGINAL_COORDINATE_SYSTEM\n""") Line 239  END_ORIGINAL_COORDINATE_SYSTEM\n""")
239      for n,d in list(new_data.items()):      for n,d in list(new_data.items()):
240          num=num+1          num=num+1
241          propfile=fileprefix+n          propfile=fileprefix+n
242          _writeBinaryGrid(propfile, d, '>', 'f', '4')          domain.writeBinaryGrid(d, propfile, BYTEORDER_BIG_ENDIAN, DATATYPE_FLOAT32)
243          f.write("\nPROPERTY %d %s\n"%(num, n))          f.write("\nPROPERTY %d %s\n"%(num, n))
244          f.write("PROPERTY_SUBCLASS %d QUANTITY Float\n"%num)          f.write("PROPERTY_SUBCLASS %d QUANTITY Float\n"%num)
245          f.write("PROP_ESIZE %d 4\n"%num)          f.write("PROP_ESIZE %d 4\n"%num)

Legend:
Removed from v.4356  
changed lines
  Added in v.4357

  ViewVC Help
Powered by ViewVC 1.1.26