source: nappy/trunk/na2cdms.py @ 339

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/nappy/trunk/na2cdms.py@339
Revision 339, 657 bytes checked in by astephen, 15 years ago (diff)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1"""
2na2cdms.py
3==========
4
5Module holds the na2cdms function to convert a NASA Ames file to a CDMS
6file (NetCDF).
7
8"""
9
10# Imports from python standard library
11import sys
12import os
13
14# Import from nappy package
15import naCore, textParser, naFile, general
16
17def na2cdms(nafile, ncfile, rules=None):
18    print "Reading data from: %s" % nafile
19    file=general.openNAFile(nafile)
20
21    print "Writing output NetCDF file: %s" % ncfile
22    file.toCdmsFile(ncfile)
23
24    return 1
25
26if __name__=="__main__":
27
28   args=sys.argv[1:]
29   if not len(args)==2:
30       print "Usage:   na2cdms.py <infile> <outfile>\n"
31       sys.exit()
32   else:
33       na2cdms(args[0], args[1]) 
Note: See TracBrowser for help on using the repository browser.