source: nappy/trunk/na2cdms.py @ 343

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

Latest version with new files in test directory.

  • 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
12sys.path.append(r"..")
13import os
14import re
15import time
16
17# Import from nappy package
18import general
19import cdmsMap
20
21def na2cdms(nafile, ncfile, rules=None):
22    print "Reading data from: %s" % nafile
23    file=general.openNAFile(nafile)
24
25    print "Writing output NetCDF file: %s" % ncfile
26    file.toCdmsFile(ncfile)
27
28    return 1
29
30if __name__=="__main__":
31
32   args=sys.argv[1:]
33   if not len(args)==2:
34       print "Usage:   na2cdms.py <infile> <outfile>\n"
35       sys.exit()
36   else:
37       na2cdms(args[0], args[1]) 
Note: See TracBrowser for help on using the repository browser.