source: nappy/trunk/test/testWrites.py @ 347

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/nappy/trunk/test/testWrites.py@347
Revision 347, 707 bytes checked in by selatham, 15 years ago (diff)

Incorporates changes by selatham and Ag Stephens. as of 5/11/04.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/usr/bin/env python
2
3"""
4testWrites.py
5==============
6
7Tests all working write routines for nappy package.
8
9"""
10
11import os
12import sys ; sys.path.append(os.path.join("..",".."))
13import nappy ; reload(nappy)
14
15for ffi in [1001, 2010, 3010, 4010]:
16    infile=os.path.join("..", "data_files", "%s.na" % ffi)
17    print "Reading in ", infile
18    x=nappy.openNAFile(infile)
19    x.readData()
20    d=x.getNADict()
21    del d["FFI"]
22
23    outfile=os.path.join("..", "output", "out%s.na" % ffi)
24    print "Writing output ", outfile
25    y=nappy.openNAFile(outfile, 'w', d)
26    print "\nFile written successfully, so let's open it."
27
28    x=nappy.openNAFile(outfile)
29    print "variables are:\n"
30    print x.getVariables()
Note: See TracBrowser for help on using the repository browser.