source: inundation/ga/storm_surge/pmesh/scripts/thin_out_vertices.py @ 643

Last change on this file since 643 was 349, checked in by duncan, 20 years ago

adding pmesh

File size: 675 bytes
Line 
1#!/usr/bin/python
2"""
3Script to thin out the number of vertices in an xya file.
4Put's a square mesh over the domain and then only keeps
5one vertice in each square.
6"""
7import os, sys
8sys.path.append('..')
9from mesh import *
10
11usage = "usage: %s file_name square_length" %         os.path.basename(sys.argv[0])
12
13if len(sys.argv) < 3:
14    print usage
15else:
16    file_name_path= sys.argv[1]
17    square_length= float(sys.argv[2])
18    wallis_name = file_name_path[:-4] + "_" + str(square_length) + ".xya"
19    m = loadxyafile(file_name_path," ")
20    m.thinoutVertices(square_length)
21    print "Saving file " + wallis_name + "."
22    m.exportxyafile(wallis_name)
Note: See TracBrowser for help on using the repository browser.