source: nappy/trunk/test/testReadAllFFIs.py @ 361

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/nappy/trunk/test/testReadAllFFIs.py@361
Revision 361, 1.2 KB checked in by selatham, 15 years ago (diff)

bug fixes, write classes and other new classes as required.

  • 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#   Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ).
3#   This software may be distributed under the terms of the
4#   Q Public License, version 1.0 or later. http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt
5
6"""
7testReadAllFFIs.py
8==================
9
10Tests all read routines for nappy package.
11
12"""
13
14import os
15import sys
16sys.path.append(os.path.join("..", ".."))
17import nappy ; reload(nappy)
18
19
20FFIs=(1001, 1010, 1020, 2010, 2110, 2160, 2310, 3010, 4010)
21
22for ffi in FFIs:
23    print "\n\nTesting FFI: ", ffi
24    file=os.path.join("..", "data_files", "%s.na" % ffi)
25    if not os.path.exists(file): file=os.path.join("..", "data_files", "%sa.na" % ffi)
26    f=nappy.openNAFile(file)
27    f.readData()
28    print "DX:",f.DX
29    print "NX:" ,f.NX
30    print "X:", f.X
31    print "VNAME", f.VNAME
32    print "V:",f.V[0:]
33    f.getNADict()
34   # print "NNCOML:",f.NNCOML
35   # print "NCOM:",f.NCOM
36
37
38    if f.NAUXV>0:
39        print "AUXs:"
40        print f.ANAME[0:]
41        print "AUX scaling factors %s" %f.ASCAL[0:]
42        print "AUX missing values %s" %f.AMISS[0:]
43        print "AUX lengths %s" %f.LENA
44        print "AUX names %s" %f.ANAME[0:]
45        print f.A[0:]
Note: See TracBrowser for help on using the repository browser.