[cig-commits] r4498 - mc/3D/CitcomS/trunk/visual
tan2 at geodynamics.org
tan2 at geodynamics.org
Fri Sep 8 12:14:42 PDT 2006
Author: tan2
Date: 2006-09-08 12:14:42 -0700 (Fri, 08 Sep 2006)
New Revision: 4498
Added:
mc/3D/CitcomS/trunk/visual/h5tocap.py
Removed:
mc/3D/CitcomS/trunk/visual/h52combined.py
Modified:
mc/3D/CitcomS/trunk/visual/visRegional.cfg
Log:
Renamed the conversion script
Deleted: mc/3D/CitcomS/trunk/visual/h52combined.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/h52combined.py 2006-09-08 19:14:12 UTC (rev 4497)
+++ mc/3D/CitcomS/trunk/visual/h52combined.py 2006-09-08 19:14:42 UTC (rev 4498)
@@ -1,126 +0,0 @@
-#!/usr/bin/env python
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#<LicenseText>
-#
-# CitcomS.py by Eh Tan
-# Copyright (C) 2002-2006, California Institute of Technology.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-#</LicenseText>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-'''Convert the HDF5 output file to ASCII file(s), with the format of the
-combined cap files
-
-usage: h5tocap.py h5file frame1 [frame2 [...] ]
-'''
-
-import tables
-
-
-def find_prefix(h5file):
- suffix = '.h5'
-
- if h5file.endswith(suffix):
- prefix = h5file[:-len(suffix)]
- else:
- prefix = h5file
-
- return prefix
-
-
-
-def convert(h5file, prefix, frame):
- f = tables.openFile(h5file)
- try:
- caps = int(f.root.input._v_attrs.caps)
- steps = f.root.time.col('step')
-
- # loop through all the caps
- for cap in range(caps):
- cap_no = 'cap%02d' % cap
- group = getattr(f.root, cap_no)
-
- x = group.coord
- v = group.velocity[frame,:]
- t = group.temperature[frame,:]
- visc = group.viscosity[frame,:]
-
- outputfile = '%s.%s.%d' % (prefix, cap_no, steps[frame])
-
- print 'writing to', outputfile, '...'
- output(outputfile, x, v, t, visc)
-
- finally:
- f.close()
-
- return
-
-
-
-def output(outputfile, x, v, t, visc):
- out = file(outputfile, 'w')
- try:
- # write header (shape of the arrays)
- nx, ny, nz = t.shape[:3]
- header = '%d x %d x %d\n' % (nx, ny, nz)
- out.write(header)
-
- # write data
- format = '%.6e '*7 + '%.6e\n'
- for j in range(ny):
- for i in range(nx):
- for k in range(nz):
- #n = k + i*nz + j*nz*nx
- xx = x[i, j, k, :]
- vv = v[i, j, k, :]
- tt = t[i, j, k]
- hh = visc[i, j, k]
- line = format % (
- xx[0], xx[1], xx[2],
- vv[0], vv[1], vv[2],
- tt, hh )
- out.write(line)
-
- finally:
- out.close()
-
- return
-
-
-
-if __name__ == '__main__':
- import sys
-
- if len(sys.argv) < 3:
- print __doc__
- sys.exit(1)
-
-
- h5file = sys.argv[1]
- file_prefix = find_prefix(h5file)
-
- frames = [ int(x) for x in sys.argv[2:] ]
-
-
- for frame in frames:
- # write to outputfile
- convert(h5file, file_prefix, frame)
-
-
Copied: mc/3D/CitcomS/trunk/visual/h5tocap.py (from rev 4497, mc/3D/CitcomS/trunk/visual/h52combined.py)
Modified: mc/3D/CitcomS/trunk/visual/visRegional.cfg
===================================================================
--- mc/3D/CitcomS/trunk/visual/visRegional.cfg 2006-09-08 19:14:12 UTC (rev 4497)
+++ mc/3D/CitcomS/trunk/visual/visRegional.cfg 2006-09-08 19:14:42 UTC (rev 4498)
@@ -1,35 +1,50 @@
//
-// time: Fri Jun 17 11:17:40 2005
+// time: Mon Sep 4 13:48:03 2006
//
// version: 3.2.0 (format), 4.3.2 (DX)
//
+// Message Window:
+// window: position = (0.0000,0.0000), size = 0.5012x0.3292
//
-// panel[2]: position = (0.0055,0.0146), size = 0.3680x0.4316, startup = 1, devstyle = 1
+// panel[2]: position = (0.0481,0.0000), size = 0.2950x0.3500, startup = 1, devstyle = 1
// title: value = Control Panel
//
// workspace: width = 500, height = 500
// layout: snap = 0, width = 50, height = 50, align = NN
//
-// interactor FileSelector[1]: num_components = 1, value = "path to your data"
-// instance: panel = 2, x = 0, y = 0, style = FileSelector, vertical = 1, size = 180x55
+// panel[3]: position = (0.0000,0.0000), size = 0.2344x0.3750, startup = 1, devstyle = 1
+// title: value = Control Panel
+//
+// workspace: width = 500, height = 500
+// layout: snap = 0, width = 50, height = 50, align = NN
+//
+// interactor FileSelector[1]: num_components = 1, value = "/home/tan2/pangu0.h5"
+// instance: panel = 2, x = 0, y = 0, style = FileSelector, vertical = 1, size = 180x57
// filter = ./*.general
//
-// interactor Integer[8]: num_components = 1, value = 2
-// component[0]: minimum = -1e+06, maximum = 1e+06, global increment = 1, decimal = 0, global continuous = 0
-// instance: panel = 2, x = 0, y = 57, style = Stepper, vertical = 1, size = 180x54
+// interactor Integer[10]: num_components = 1, value = 100
+// component[0]: minimum = 0, maximum = 1e+06, global increment = 1, decimal = 0, global continuous = 0
+// instance: panel = 2, x = 0, y = 68, style = Stepper, vertical = 1, size = 201x56
// local continuous: value = 0, mode = global
// local increment[0]: value = 1, mode = global
//
-// interactor Integer[9]: num_components = 1, value = 1
+// interactor Integer[8]: num_components = 1, value = 3
+// component[0]: minimum = 1, maximum = 1e+06, global increment = 1, decimal = 0, global continuous = 0
+// instance: panel = 2, x = 7, y = 136, style = Stepper, vertical = 1, size = 180x56
+// label: value = Reduced factor
+// local continuous: value = 0, mode = global
+// local increment[0]: value = 1, mode = global
+//
+// interactor Integer[9]: num_components = 1, value = 0
// component[0]: minimum = 0, maximum = 2, global increment = 1, decimal = 0, global continuous = 0
-// instance: panel = 2, x = 257, y = 178, style = Stepper, vertical = 1, size = 148x54
+// instance: panel = 2, x = 246, y = 178, style = Stepper, vertical = 1, size = 148x56
// label: value = Slab cut dimension:
// local continuous: value = 0, mode = global
// local increment[0]: value = 1, mode = global
//
-// interactor Integer[1]: num_components = 1, value = 4
-// component[0]: minimum = 0, maximum = 300, global increment = 1, decimal = 0, global continuous = 0
-// instance: panel = 2, x = 265, y = 239, style = Stepper, vertical = 1, size = 133x54
+// interactor Integer[1]: num_components = 1, value = 1
+// component[0]: minimum = 0, maximum = 10000, global increment = 1, decimal = 0, global continuous = 0
+// instance: panel = 2, x = 246, y = 236, style = Stepper, vertical = 1, size = 133x56
// label: value = Slab cut position:
// local continuous: value = 0, mode = global
// local increment[0]: value = 1, mode = global
@@ -46,17 +61,17 @@
// input[12]: defaulting = 0, value = { 0.0 1.0 }
// input[17]: defaulting = 0, value = 0.0
// input[18]: defaulting = 0, value = 1.0
-// window: position = (0.0000,0.0000), size = 0.5078x0.4395
+// window: position = (0.0000,0.0000), size = 0.5075x0.4392
//
-// interactor ScalarList[1]: num_components = 1, value = { 0.8 0.4 }
+// interactor ScalarList[1]: num_components = 1, value = { 0.8 0.7 }
// component[0]: minimum = -1, maximum = 1, global increment = 0.05, decimal = 2, global continuous = 0
-// instance: panel = 2, x = 253, y = 0, style = List Editor, vertical = 1, size = 166x176
+// instance: panel = 2, x = 282, y = 0, style = List Editor, vertical = 1, size = 166x176
// local continuous: value = 0, mode = global
// local increment[0]: value = 1, mode = global
//
-// interactor Scalar[5]: num_components = 1, value = 0.55
+// interactor Scalar[5]: num_components = 1, value = 0.54
// component[0]: minimum = 0, maximum = 1, global increment = 0.05, decimal = 2, global continuous = 0
-// instance: panel = 2, x = 5, y = 119, style = Stepper, vertical = 1, size = 159x54
+// instance: panel = 2, x = 13, y = 214, style = Stepper, vertical = 1, size = 159x56
// label: value = Core radius:
// local continuous: value = 0, mode = global
// local increment[0]: value = 1, mode = global
@@ -64,16 +79,16 @@
// node Image[3]:
// title: value = Gridded_3D_2ormorevar_notseries
// depth: value = 24
-// window: position = (0.0000,0.4141), size = 0.5703x0.4863
+// window: position = (0.0119,0.4583), size = 0.4387x0.4867
// input[1]: defaulting = 0, value = "Image_3"
// input[4]: defaulting = 0, value = 1
-// input[5]: defaulting = 0, value = [0.748306 0.193767 -0.0777607]
-// input[6]: defaulting = 0, value = [1.36948 -1.83101 0.112188]
-// input[7]: defaulting = 0, value = 1.13956
-// input[8]: defaulting = 0, value = 716
-// input[9]: defaulting = 0, value = 0.63757
-// input[10]: defaulting = 0, value = [0.953206 0.282276 -0.108249]
-// input[11]: defaulting = 1, value = 30.0004
+// input[5]: defaulting = 0, value = [0.00038147 0 0]
+// input[6]: defaulting = 0, value = [-3.02239 -4.58645 6.21812]
+// input[7]: defaulting = 0, value = 4.44628
+// input[8]: defaulting = 0, value = 688
+// input[9]: defaulting = 0, value = 0.788517
+// input[10]: defaulting = 0, value = [-0.049952 0.815208 0.57701]
+// input[11]: defaulting = 1, value = 30.0001
// input[12]: defaulting = 0, value = 0
// input[14]: defaulting = 0, value = 1
// input[15]: defaulting = 0, value = "none"
More information about the cig-commits
mailing list