source: TI02-CSML/trunk/Examples/scanning/iotest.py @ 1674

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI02-CSML/trunk/Examples/scanning/iotest.py@1674
Revision 1674, 1.1 KB checked in by domlowe, 13 years ago (diff)

iotest.py updated to include test of cdml interface

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/usr/bin/env python
2
3import csml.csmllibs
4import sys
5
6testnetcdf = '/home/users/domlowe/CSML/Coapec/testfiles/xaaqda@pxt09c1.nc'
7testnasa ='/home/users/domlowe/CSML/Acsoe/eae-96/challenger/ca960608.rc1'
8testcdml='/home/users/domlowe/cdml/e40-1.0-am-195709-200208_expanded.xml'
9
10
11#CDML
12f = csml.csmllibs.csmldataiface.DataInterface()
13f=f.getUnknownInterfaceType(testcdml)
14f.openFile(testcdml)
15axeslist=f.getListOfAxes()
16print f.getSizeOfAxis('latitude')
17f.setAxis('latitude')
18print f.getDataForAxis()
19print f.getListofVariables()
20
21f.closeFile()
22
23
24
25#NETCDF/PP
26f1 = csml.csmllibs.csmldataiface.DataInterface()
27f1=f1.setInterfaceType('cdunif')
28
29f1.openFile(testnetcdf)
30axeslist=f1.getListOfAxes()
31print f1.getSizeOfAxis('latitude')
32f1.setAxis('latitude')
33print f1.getDataForAxis()
34print f1.getSizeOfAxis('latitude')
35print f1.getListofVariables()
36
37f1.closeFile()
38
39
40#NASA Ames
41f2=csml.csmllibs.csmldataiface.DataInterface()
42f2=f2.setInterfaceType('nappy')
43f2.openFile(testnasa)
44axeslist=f2.getListOfAxes()
45print axeslist
46print f2.getSizeOfAxis('Midpoint of Sampling Interval in Decimal Julian Day')
47print f2.getListofVariables()
48
49f2.closeFile()
Note: See TracBrowser for help on using the repository browser.