Changeset 344
- Timestamp:
- 15/06/04 13:46:45 (16 years ago)
- Location:
- nappy/trunk
- Files:
-
- 1 added
- 10 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
nappy/trunk/doc/00README.txt
r339 r344 1 NASAAmesIO-0.3 1 nappy 2 ===== 3 4 NASA Ames Package in Python. 5 6 Description: 7 ============ 8 9 A NASA Ames IO package - A python input/output package for NASA Ames file formats 10 11 12 Version history: 13 ================ 14 15 Most recent version 16 17 Version 0.9.7.2: Original - Ag Stephens, 14th May 2004. 18 19 20 Planning Notes: 21 =============== 22 23 Software written with reference to: 24 25 'Format Specification for Data Exchange' paper by Gaines and Hipkind (1998). 26 makeheader.f fortran application to write NASA Ames headers, Anne de Rudder (2000). 27 Ames python library developed by Bryan Lawrence (2003). 28 29 Conventions: 2 30 ============== 3 31 4 Current status on Sunday 25th April 2004. 32 The basic NASAAmes class holds a dictionary called naVars which holds all the 33 variables described in the Gaines and Hipkind document and these are all named 34 using CAPITAL LETTERS for compliance/reference with that document. 5 35 6 Most read classes now work. 36 For example the number of independent variables is held in the instance variable: 7 37 8 Use the test/testReadNNNN.py scripts to try and read them. 38 self["NIV"] 39 40 Return values are being calculated for many functions/methods are often prefixed with 41 'rt' symbolising 'return'. 42 43 44 CDMS-link 45 ========= 46 47 At the start, there are a number of formats that are not compatible with the CDMS format: 48 49 2110 - changing second independent variable length at each first independent variable value. 50 2160 - Character independent and auxiliary variables - would need a map to implement in CDMS so not intended. 51 2310 - changing second independent variable length at each first independent variable value. 52 53 The following are unlikely, but can be done: 54 55 1020 - with NVPM (implied independent variable values) - we can allow it but low priority to implement. 56 57 FFIs that need to be converted: 58 59 1001, 1010, 2010, 3010, 4010. 60 61 The following have already been done: 62 63 1001, 2010, 3010, 4010. 64 65 Current Status of the software 66 ============================== 67 68 All read classes should now work. 69 70 Use the test/testReadAllFFIs.py scripts to try and read them. 9 71 10 72 Note that the data sections may not be reading properly for some FFIs. 11 73 12 The readData() methods are DEFINITELY not yet working for FFIs: 13 2110, 2160, 2310. 74 The FFI classes for 2010, 3010 and 4010 all follow the same code exactly. 14 75 15 The FFI classes for 2010, 3010 and 4010 all follow the same code exactly. 76 Write classes should be working for: 1001, 2010, 3010 and 4010. 77 78 You can test these using: 79 80 test/testWrites.py 81 82 You can write cdat output files to the following formats (i.e. any that you can write to from nappy): 83 84 1001, 2010, 3010, 4010. 85 86 Test with: 87 88 test/testCmdsWrite.py 89 16 90 17 91 Reversing the independent variable marks … … 51 125 52 126 53 Things to do54 ============55 127 56 1. Complete the read data methods and check correct. 128 Plans for improving nappy 129 ========================= 57 130 58 2. Create simple write methods to match the read stuff.59 131 60 3. Create the following bridge to CDMS: 132 Split the code into individual FFI files (naFile1001, naFile1010 etc). - Ag 133 ALL SPLIT AND READS APPEAR TO BE WORKING. 134 Document code Ag - MAINLY DONE 135 Write a NASA Ames compliance document by working through the Gaines and Hipkind guide and listing all the requirements of a file conforming to the NASA Ames standard Wendy. 136 Test all the input/output routines Sue. 137 Write additional output routines for FFI 1010, 1020, 2310, 2160, 2110. Sue. 138 Write a manual for the package - Ag 139 Create a standard mapping file between cdat and nappy so that global attributes convert appropriately. This should be xml and should be a local table for various centres Sue and Ag. 140 Put the cdms stuff in the a class called NACdms and put that in cdmsTools/cdmsOut.py -> CdmsOut(). 141 NOT DONE DUE TO ANNOYING MULTIPLE RECURSIVE IMPORT DEPENDENCIES!!! 142 Make the /bin directory and put the scripts in there called cdms2na.py, na2nc.py, also make nc2na.py that is just a pointer to cdms2na.py (just there to simplify things for dummies). 61 143 62 self.toCdmsFile(filename, attribute_dictionary=None) - attribute 63 dictionary can be extras if you want 64 self.varToCdmsVariable(variable) - you can send it a variable number 65 or a variable name. 66 self.varToCdmsAxis(independentVariable) - you can send it an independent 67 variable name or number. 68 self.auxVarToCdmsVariable(variable) - you can send it a name or number. 144 - routines should not automatically read or write the DATA section. 145 DONE FOR READING, IS IT NEEDED FOR WRITING - you either write or you don't. 146 - strip out _recursiveList operators so that they can be used elsewhere (and any other generic funcs) - maybe put in listManipulators.py 147 DONE TELL SUE. 148 - Organise the underscores leading func names to be coherent. 149 DONE 150 - Start including exceptions everywhere for checking. 151 - history doesn't map properly from netcdf. 152 - delimiters - let the user decide how to space items. 153 - output formatting - let user decide eg %s, %4.3f etc 69 154 70 4. Create the cdms2na.py script containing a functions called:71 cdmsToNASAAmesFile(cdmsFile, naFile, nasaAmesAttributes={})72 cdmsVariableToNASAAmesFile(cdmsVariable, naFile, nasaAmesAttributes={})73 155 74 Ag Stephens, 20 April 2004. 156 157 -
nappy/trunk/test/testCdmsWrite.py
r339 r344 1 import sys ; sys.path.append("..") 2 import naCore, textParser, naFile, general 3 reload(naCore) ; reload(textParser) ; reload(naFile) ; reload(general) 1 import sys 2 import os 3 sys.path.append(os.path.join("..", "..")) 4 import nappy ; reload(nappy) 4 5 5 6 for ffi in [1001, 2010, 3010, 4010]: 6 7 print "Reading in NASA Ames 1001:" 7 x=general.openNAFile(r'../data_files/%s.na' % ffi) 8 infile=os.path.join("..", "data_files", "%s.na" % ffi) 9 x=nappy.openNAFile(infile) 10 x.readData() 8 11 print "Read file OK." 9 12 10 outfile= "../output/out%s.nc" % ffi13 outfile=os.path.join("..", "output", "out%s.nc" % ffi) 11 14 print "Writing output NetCDF file %s" % outfile 12 15 x.toCdmsFile(outfile) -
nappy/trunk/test/testReadAllFFIs.py
r339 r344 9 9 """ 10 10 11 import os 12 import sys 13 sys.path.append(os.path.join("..", "..")) 14 import nappy ; reload(nappy) 15 16 11 17 FFIs=(1001, 1010, 1020, 2010, 2110, 2160, 2310, 3010, 4010) 12 18 13 for FFI in FFIs: 14 print "Testing FFI: ", FFI 15 __import__("testRead%s" % FFI) 19 for ffi in FFIs: 20 print "\n\nTesting FFI: ", ffi 21 file=os.path.join("..", "data_files", "%s.na" % ffi) 22 if not os.path.exists(file): file=os.path.join("..", "data_files", "%sa.na" % ffi) 23 f=nappy.openNAFile(file) 24 f.readData() 25 print "DX:",f.DX 26 print "VNAME", f.VNAME 27 print "V:",f.V[0] 28 29 if f.NAUXV>1: 30 print "AUX:" 31 print f.ANAME[0], f.ASCAL[0] 32 print f.A[0] -
nappy/trunk/test/testWrites.py
r339 r344 1 import sys ; sys.path.append("..") 2 import naCore, textParser, naFile, general 3 reload(naCore) ; reload(textParser) ; reload(naFile) ; reload(general) 1 #!/usr/bin/env python 2 3 """ 4 testWrites.py 5 ============== 6 7 Tests all working write routines for nappy package. 8 9 """ 10 11 import os 12 import sys ; sys.path.append(os.path.join("..","..")) 13 import nappy ; reload(nappy) 4 14 5 15 for ffi in [1001, 2010, 3010, 4010]: 6 x=general.openNAFile(r'../data_files/%s.na' % ffi) 16 infile=os.path.join("..", "data_files", "%s.na" % ffi) 17 print "Reading in ", infile 18 x=nappy.openNAFile(infile) 19 x.readData() 7 20 d=x.getNADict() 8 21 del d["FFI"] 9 22 10 print "Writing output file output/out%s.na..." % ffi 11 y=general.openNAFile(r'..\output\out%s.na' % ffi, 'w', d) 23 outfile=os.path.join("..", "output", "out%s.na" % ffi) 24 print "Writing output ", outfile 25 y=nappy.openNAFile(outfile, 'w', d) 12 26 print "\nFile written successfully, so let's open it." 13 27 14 x= general.openNAFile(r'..\output\out%s.na' % ffi)28 x=nappy.openNAFile(outfile) 15 29 print "variables are:\n" 16 30 print x.getVariables()
Note: See TracChangeset
for help on using the changeset viewer.