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

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

updated by selatham for bug fixes and new write methods

  • 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#$Log$
11#Revision 1.3  2004/11/03 16:25:28  selatham
12#updated by selatham for bug fixes and new write methods
13#
14#
15
16import os
17import sys ; sys.path.append(os.path.join("..",".."))
18import nappy ; reload(nappy)
19
20for ffi in [1001, 1010, 2010, 3010, 4010]:
21    infile=os.path.join("..", "data_files", "%s.na" % ffi)
22    print "Reading in ", infile
23    x=nappy.openNAFile(infile)
24    x.readData()
25    d=x.getNADict()
26    del d["FFI"]
27
28    outfile=os.path.join("..", "output", "out%s.na" % ffi)
29    print "Writing output ", outfile
30    y=nappy.openNAFile(outfile, 'w', d)
31    print "\nFile written successfully, so let's open it."
32
33    x=nappy.openNAFile(outfile)
34    print "variables are:\n"
35    print x.getVariables()
Note: See TracBrowser for help on using the repository browser.