- Timestamp:
- 03/11/04 16:25:28 (16 years ago)
- Location:
- nappy/trunk
- Files:
-
- 5 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
nappy/trunk/__init__.py
r343 r345 25 25 from naFile4010 import * 26 26 from naToCdms import * 27 from cdms2na import * 27 try: 28 from cdms2na import * 29 except: 30 print "Warning : cannot import cdms2na (cdms) package, CDAT-dependent features will not work." -
nappy/trunk/data_files/1010.na
r339 r345 1 46 1010 2 De Rudder, Anne 3 Rutherford Appleton Laboratory, Chilton OX11 0QX, UK - Tel.: +44 (0) 1235 445837 4 BISA 1-D atmospheric model 5 NERC Data Grid (NDG) project 6 3 13 7 1976 01 01 2002 10 30 8 5 9 Altitude (km) 10 4 11 1.E+12 1.E+06 1.E+04 1 12 1.E+08 1.E+08 1.E+08 10000 13 Molecular oxygen concentration (cm-3) 14 Ozone concentration (cm-3) 15 O(3P) concentration (cm-3) 16 O(1D) concentration (cm-3) 17 2 18 1 1.E+12 19 10000 1.E+08 20 Pressure (hPa) 21 Air concentration (cm-3) 1 41 1010 2 Mertz, Fred 3 Pacific University 4 DC-8 Mark IV Interferometer 5 TAHITI OZONE PROJECT 6 1 1 7 1991 1 16 1991 2 15 8 0 9 UT fractional day number of year given in DATE 10 8 11 1.0E+17 1.0E+14 1.0E+13 1.0E+14 1.0E+14 1.0E+13 1.0E+13 1.0E+18 12 999 999 9999 9999 999 9999 9999 9999 13 O3 column density (molecules/cm**2) 14 NO column density (molecules/cm**2) 15 NO2 column density (molecules/cm**2) 16 HNO3 column density (molecules/cm**2) 17 ClNO3 column density (molecules/cm**2) 18 HCl column density (molecules/cm**2) 19 HF column density (molecules/cm**2) 20 H2O column density (molecules/cm**2) 22 21 10 23 Example of FFI 1010. 24 This example illustrating NASA Ames file format index 1010 combines the US Standard 25 Atmosphere 1976 (for the auxiliary variables Pressure and Air Concentration) and some 26 results of a 1-D model (for the dependent variables - oxygen compounds concentrations), 27 as quoted in G. Brasseur and S. Solomon, Aeronomy of the Middle Atmosphere, 28 Reidel, 1984 (pp. 46 & 211). The first date on line 7 (1st of January 1976) is fictitious 29 since the parameters are yearly averages. We have signalled the absence of calculated 30 value at 30 km by using the "missing value" flags (see line 12). The missing value flag 31 is also used to give account for the fact that there is virtually no O(1D) present below 32 the altitude of 20 km. 33 12 34 12 35 The files included in this data set illustrate each of the 9 NASA Ames file format indices 36 (FFI). A detailed description of the NASA Ames format can be found on the Web site of the 37 British Atmospheric Data Centre (BADC) at http://www.badc.rl.ac.uk/help/formats/NASA-Ames/ 38 E-mail contact: badc@rl.ac.uk 39 Reference: S. E. Gaines and R. S. Hipskind, Format Specification for Data Exchange, 40 Version 1.3, 1998. The work referenced above can be found at 41 http://cloud1.arc.nasa.gov/solve/archiv/archive.tutorial.html and a copy of it at 42 http://www.badc.rl.ac.uk/help/formats/NASA-Ames/G-and-H-June-1998.html 22 1.0 1.0 1.0 1.0 0.1 0.1 0.1 1.0 1.0 1.0 23 99 99 99 99 9999 99999 9999 999 999 999 24 UT Month 25 UT Day 26 UT Hour 27 UT Minutes 28 Latitude of DC-8 (degrees) 29 Longitude of DC-8 (degrees) 30 Solar zenith angle (degrees) reckoned from DC-8 31 Air temperature (Celsius) 32 Static pressure (millibars) 33 Potential temperature (Kelvin) 34 0 35 6 36 NOTE 1: This is a single file for the entire mission, which will 37 be updated after each flight during the mission. See line 7 of 38 header for date of last update. 39 NOTE 2: All these column values will change when analyses are 40 repeated. 43 41 44 Altitude (km) Pressure (mb) [M] (cm-3) < 2 auxiliary dependent variables > 45 O2 (cm-3) O3 (cm-3) O(3P) (cm-3) O(1D) (cm-3) < 4 primary dependent variables > 46 47 10 265.0 8.61E+06 48 1.7E+06 1.0E+06 1.3 10000 49 15 121.1 4.04E+06 50 8.1E+05 1.1E+06 5.5 10000 51 20 55.3 1.85E+06 52 3.6E+05 2.9E+06 94 0.9 53 25 25.5 8.33E+05 54 1.6E+05 3.2E+06 670 5 55 30 12.0 3.83E+05 56 1.0E+08 1.0E+08 1.E+08 10000 57 35 5.7 1.74E+05 58 3.5E+04 2.0E+06 2.4E+04 100 59 40 2.3 6.67E+04 60 1.7E+04 1.0E+06 1.2E+05 330 61 45 1.5 4.12E+04 62 8900 3.2E+05 3.7E+05 600 63 50 0.8 2.14E+04 64 4800 1.0E+05 6.5E+05 610 65 55 0.43 1.19E+04 66 2600 3.2E+04 8.4E+05 440 67 60 0.22 6450 68 1500 1000 6.5E+05 260 69 65 0.11 3420 70 820 3200 5.0E+05 150 71 70 0.052 1710 72 420 1000 4.0E+05 96 73 75 0.024 836 74 200 320 3.8E+05 67 75 80 0.011 403 76 90 140 1.4E+06 70 77 85 4.5E-03 172 78 37 100 3.0E+06 120 79 90 1.8E-03 69.8 80 12.5 110 3.0E+07 420 81 95 7.6E-04 29.3 82 4.7 13 3.3E+07 490 83 100 3.2E-04 11.9 84 1.9 1.7 3.2E+07 1200 85 42 16.521 1 16 12 30 -59 -1250 884 -56 237 328 43 80 24 75 142 12 240 72 47 44 16.538 1 16 12 55 -60 -1211 885 -57 237 328 45 70 19 82 121 12 243 72 56 46 16.558 1 16 13 24 -64 -1277 889 -57 237 327 47 71 16 78 118 10 237 56 49 48 19.530 1 19 12 43 -60 -1250 882 -56 315 330 49 105 24 85 241 26 390 106 61 50 19.633 1 19 15 11 -58 -1266 882 -50 329 304 51 105 24 85 241 26 390 106 61 -
nappy/trunk/general.py
r343 r345 15 15 16 16 """ 17 #$Log$ 18 #Revision 1.3 2004/11/03 16:23:41 selatham 19 #updated by selatham for bug fixes and new write methods 20 # 17 21 18 22 # Imports from local package -
nappy/trunk/naFile.py
r343 r345 7 7 8 8 """ 9 #$Log$ 10 #Revision 1.3 2004/11/03 16:23:41 selatham 11 #updated by selatham for bug fixes and new write methods 12 # 9 13 10 14 # Imports from python standard library … … 180 184 self.file.write(("%s "*self.NAUXV+"\n") % tuple(self.ASCAL)) 181 185 self.file.write(("%s "*self.NAUXV+"\n") % tuple(self.AMISS)) 182 self.file.write("%s\n"*self.N V % tuple(self.ANAME))186 self.file.write("%s\n"*self.NAUXV % tuple(self.ANAME)) 183 187 184 188 def _readCharAuxVariablesHeaderSection(self): -
nappy/trunk/naFile1010.py
r343 r345 6 6 7 7 """ 8 8 #$Log$ 9 #Revision 1.2 2004/11/03 16:23:41 selatham 10 #updated by selatham for bug fixes and new write methods 11 # 9 12 # Imports from python standard library 10 13 … … 18 21 File Format Index (FFI) 1010. 19 22 """ 23 #$Log$ 24 #Revision 1.2 2004/11/03 16:23:41 selatham 25 #updated by selatham for bug fixes and new write methods 26 # 27 # 20 28 21 29 def readHeader(self): 22 30 """ 23 31 Reads FFI-specifc header section. 24 """ 32 """ 25 33 self._readCommonHeader() 26 34 self.DX=readItemsFromLine(self.file.readline(), self.NIV, float) … … 29 37 self._readAuxVariablesHeaderSection() 30 38 self._readComments() 39 40 def writeHeader(self): 41 """ 42 Writes FFI-specifc header section. 43 """ 44 self._writeCommonHeader() 45 self.file.write(("%s "*self.NIV+"\n") % tuple(self.DX)) 46 self.file.write("%s\n"*self.NIV % tuple(self.XNAME)) 47 self._writeVariablesHeaderSection() 48 self._writeAuxVariablesHeaderSection() 49 self._writeComments() 31 50 32 51 def _setupArrays(self): … … 42 61 self.A.append([]) 43 62 44 def _readData1(self, datalines, ivar_count): 63 def _readData1(self, datalines, ivar_count): 45 64 """ 46 65 Reads first line/section of current block of data. 47 66 """ 48 67 # Start with independent and Auxilliary vars 68 #print "NAUXV = %s" %self.NAUXV testing 49 69 (x2_and_a, rtlines)=readItemsFromUnknownLines(datalines, 1+self.NAUXV, float) 70 #print "First line of block = %s" %x2_and_a testing 50 71 (x, aux)=(x2_and_a[0], x2_and_a[1:]) 51 72 self.X.append(x) … … 62 83 # Now get the dependent variables 63 84 (v, rtlines)=readItemsFromUnknownLines(datalines, self.NV, float) 64 # Set up mth list in self.V 65 self.V.append([])85 # Set up mth list in self.V removed by selatham 86 #self.V.append([]) removed by selatham 66 87 count=0 67 88 for n in range(self.NV): 68 self.V[n].append([]) 69 self.V[ivar_count].append(v[count]) 70 count=count+1 89 #self.V[n].append([]) removed by selatham 90 #self.V[ivar_count].append(v[count]) removed by selatham 91 self.V[n].append(v[count]) 92 count=count+1 71 93 return rtlines 94 95 def writeData(self): 96 """ 97 Writes the data section of the file. 98 This method can be called directly by the user. 99 """ 100 for m in range(len(self.X)): 101 # Write Independent variable mark and auxiliary variables 102 var_string="%s " % self.X[m] 103 for a in range(self.NAUXV): 104 var_string=var_string+("%s " % self.A[a][m]) 105 self.file.write("%s\n" % var_string.rstrip()) 106 # Write dependant variables 107 var_string="" 108 for n in range(self.NV): 109 var_string=var_string+("%s " %self.V[n][m]) 110 self.file.write("%s \n" %var_string) -
nappy/trunk/naFile1020.py
r343 r345 38 38 """ 39 39 Reads second line/section (if used) of current block of data. 40 """ 40 """ 41 41 # Now get the dependent variables 42 (v, rtlines)=readItemsFromUnknownLines(datalines, self.NV*self.NVPM, float) 42 (v, rtlines)=readItemsFromUnknownLines(datalines, self.NV*self.NVPM, float) 43 43 count=0 44 #print "chunk of ind vars",v testing 45 #print rtlines testing 44 46 for n in range(self.NV): 45 47 self.V[n].append([]) 46 48 for i in range(self.NVPM): # Number of steps where independent variable is implied 47 49 self.V[n][ivar_count].append(v[count]) 48 count=count+150 count=count+1 49 51 return rtlines 50 52 … … 60 62 self.X[0]=newX 61 63 self._normalizedX="yes" 64 65 def writeData(self): 66 """ 67 Writes the data section of the file. 68 This method can be called directly by the user. 69 """ 70 for m in range(len(self.X)): 71 # Write Independent variable mark and auxiliary variables 72 var_string="%s " % self.X[m] 73 for a in range(self.NAUXV): 74 var_string=var_string+("%s " % self.A[a][m]) 75 self.file.write("%s\n" % var_string.rstrip()) 76 # Write dependant variablesf. 77 var_string="" 78 for n in range(self.NV): 79 var_string=var_string+("%s " %self.V[n][m]) 80 self.file.write("%s \n" %var_string) -
nappy/trunk/naFile2010.py
r343 r345 6 6 7 7 """ 8 #$Log$ 9 #Revision 1.2 2004/11/03 16:23:41 selatham 10 #updated by selatham for bug fixes and new write methods 11 # 8 12 9 13 # Imports from python standard library -
nappy/trunk/output/out2010.na
r339 r345 9 9 9 10 10 1 11 0.011 0.000 12 12 Latitude (degrees North) 13 13 Altitude (km) … … 43 43 44 44 0.0 1013.3 45 -3.0 -2.6 -2.3 2.0 4.8 4.6 4.5 3.0 -0.9 45 -3.000 -2.600 -2.300 2.000 4.800 4.600 4.500 3.000 -0.900 46 46 20.0 55.3 47 -15.1 -4.2 6.9 12.8 14.7 20.0 21.5 18.0 8.2 47 -15.100 -4.200 6.900 12.800 14.700 20.000 21.500 18.000 8.200 48 48 40.0 2.3 49 -29.0 -15.2 3.4 28.2 41.0 39.1 17.9 8.0 0.1 49 -29.000 -15.200 3.400 28.200 41.000 39.100 17.900 8.000 0.100 50 50 60.0 0.22 51 -10.0 8.4 31.2 59.9 78.5 77.7 47.0 17.6 16.051 -10.000 8.400 31.200 59.900 78.500 77.700 47.000 17.600 16.000 52 52 80.0 0.01 53 200.0 200.0 200.0 200.0 200.0 200.0 200.0 200.0 200.053 200.000 200.000 200.000 200.000 200.000 200.000 200.000 200.000 200.000 -
nappy/trunk/output/out3010.na
r339 r345 9 9 7 4 10 10 1 1 11 -90.012 50.011 -90.000 12 50.000 13 13 Latitude (degrees) 14 14 Altitude (km) … … 41 41 42 42 172.0 43 193.0 211.0 224.0 229.0 235.0 245.0 270.044 221.0 230.0 254.0 272.0 281.0 289.0 300.045 220.0 229.0 244.0 253.0 260.0 263.0 278.046 195.0 208.0 217.0 219.0 223.0 230.0 240.043 193.000 211.000 224.000 229.000 235.000 245.000 270.000 44 221.000 230.000 254.000 272.000 281.000 289.000 300.000 45 220.000 229.000 244.000 253.000 260.000 263.000 278.000 46 195.000 208.000 217.000 219.000 223.000 230.000 240.000 47 47 355.0 48 270.0 245.0 235.0 229.0 224.0 211.0 193.049 300.0 289.0 281.0 272.0 254.0 230.0 221.050 278.0 263.0 260.0 253.0 244.0 229.0 220.051 240.0 230.0 223.0 219.0 217.0 208.0 195.048 270.000 245.000 235.000 229.000 224.000 211.000 193.000 49 300.000 289.000 281.000 272.000 254.000 230.000 221.000 50 278.000 263.000 260.000 253.000 244.000 229.000 220.000 51 240.000 230.000 223.000 219.000 217.000 208.000 195.000 -
nappy/trunk/output/out4010.na
r339 r345 9 9 13 7 2 10 10 1 1 1 11 -30.012 90.013 20.011 -30.000 12 90.000 13 20.000 14 14 Longitude (degrees) 15 15 Latitude (degrees) … … 53 53 54 54 6.0 55 230.0 230.0 230.0 230.0 230.0 230.0 230.0 230.0 230.0 230.0 230.0 230.0 230.056 216.0 216.5 217.0 218.0 218.5 219.0 220.0 220.4 220.4 220.9 221.3 221.0 220.7 57 210.6 211.0 211.4 211.8 212.2 212.6 213.0 213.0 213.1 213.0 213.5 213.0 213.1 58 205.4 206.0 206.6 207.2 207.8 208.4 209.0 209.2 209.8 210.3 210.0 209.8 209.7 59 204.0 204.6 205.0 205.7 206.2 206.8 207.0 207.4 207.8 208.2 208.6 208.3 208.060 194.7 195.2 196.0 196.6 197.2 197.5 198.0 198.4 198.7 198.9 199.3 199.5 199.1 61 185.0 185.0 185.0 185.0 185.0 185.0 185.0 185.0 185.0 185.0 185.0 185.0 185.062 260.0 260.0 260.0 260.0 260.0 260.0 260.0 260.0 260.0 260.0 260.0 260.0 260.063 230.0 230.5 231.0 233.0 233.7 234.2 235.0 235.5 236.0 236.5 237.0 237.5 238.064 217.6 218.3 219.0 219.3 219.7 220.0 225.0 225.8 226.4 227.0 227.8 228.5 229.1 65 216.2 216.7 217.0 217.4 218.1 218.5 219.0 219.8 221.0 221.6 222.0 223.0 224.066 212.1 212.7 213.0 213.5 213.7 214.0 214.0 214.5 215.1 216.0 217.0 218.0 219.067 198.4 199.0 199.4 200.0 200.6 201.1 201.0 201.5 202.0 202.8 203.4 204.0 205.068 183.0 183.0 183.0 183.0 183.0 183.0 183.0 183.0 183.0 183.0 183.0 183.0 183.055 230.000 230.000 230.000 230.000 230.000 230.000 230.000 230.000 230.000 230.000 230.000 230.000 230.000 56 216.000 216.500 217.000 218.000 218.500 219.000 220.000 220.400 220.400 220.900 221.300 221.000 220.700 57 210.600 211.000 211.400 211.800 212.200 212.600 213.000 213.000 213.100 213.000 213.500 213.000 213.100 58 205.400 206.000 206.600 207.200 207.800 208.400 209.000 209.200 209.800 210.300 210.000 209.800 209.700 59 204.000 204.600 205.000 205.700 206.200 206.800 207.000 207.400 207.800 208.200 208.600 208.300 208.000 60 194.700 195.200 196.000 196.600 197.200 197.500 198.000 198.400 198.700 198.900 199.300 199.500 199.100 61 185.000 185.000 185.000 185.000 185.000 185.000 185.000 185.000 185.000 185.000 185.000 185.000 185.000 62 260.000 260.000 260.000 260.000 260.000 260.000 260.000 260.000 260.000 260.000 260.000 260.000 260.000 63 230.000 230.500 231.000 233.000 233.700 234.200 235.000 235.500 236.000 236.500 237.000 237.500 238.000 64 217.600 218.300 219.000 219.300 219.700 220.000 225.000 225.800 226.400 227.000 227.800 228.500 229.100 65 216.200 216.700 217.000 217.400 218.100 218.500 219.000 219.800 221.000 221.600 222.000 223.000 224.000 66 212.100 212.700 213.000 213.500 213.700 214.000 214.000 214.500 215.100 216.000 217.000 218.000 219.000 67 198.400 199.000 199.400 200.000 200.600 201.100 201.000 201.500 202.000 202.800 203.400 204.000 205.000 68 183.000 183.000 183.000 183.000 183.000 183.000 183.000 183.000 183.000 183.000 183.000 183.000 183.000 69 69 12.0 70 240.0 240.0 240.0 240.0 240.0 240.0 240.0 240.0 240.0 240.0 240.0 240.0 240.071 228.6 228.7 228.8 229.0 229.3 229.8 230.0 230.5 231.0 231.5 232.0 231.5 231.072 221.3 221.7 222.0 222.4 222.6 223.0 223.0 223.6 224.0 224.4 225.0 224.5 224.073 216.8 217.0 217.3 217.8 218.0 218.4 219.0 219.3 219.6 220.3 220.8 219.9 219.074 215.1 215.4 215.7 216.0 216.3 216.6 217.0 217.5 218.0 218.6 219.0 218.9 218.4 75 207.4 207.5 207.6 207.7 207.8 207.9 208.0 208.2 208.4 208.6 208.3 208.0 208.3 76 195.0 195.0 195.0 195.0 195.0 195.0 195.0 195.0 195.0 195.0 195.0 195.0 195.077 270.0 270.0 270.0 270.0 270.0 270.0 270.0 270.0 270.0 270.0 270.0 270.0 270.078 243.0 243.5 244.0 244.3 244.7 245.0 245.0 245.2 245.5 250.0 250.8 251.0 251.079 232.1 232.7 233.0 234.0 234.3 234.7 235.0 235.3 235.7 236.2 236.8 236.6 236.1 80 226.4 226.8 227.0 227.4 228.0 228.8 229.0 229.8 229.7 230.3 230.4 230.3 230.081 222.7 222.8 222.9 223.2 223.5 224.0 224.0 224.5 225.0 225.2 225.3 225.0 224.9 82 209.8 210.0 210.2 210.4 210.6 210.8 211.0 211.0 211.2 211.3 212.0 212.1 211.8 83 193.0 193.0 193.0 193.0 193.0 193.0 193.0 193.0 193.0 193.0 193.0 193.0 193.070 240.000 240.000 240.000 240.000 240.000 240.000 240.000 240.000 240.000 240.000 240.000 240.000 240.000 71 228.600 228.700 228.800 229.000 229.300 229.800 230.000 230.500 231.000 231.500 232.000 231.500 231.000 72 221.300 221.700 222.000 222.400 222.600 223.000 223.000 223.600 224.000 224.400 225.000 224.500 224.000 73 216.800 217.000 217.300 217.800 218.000 218.400 219.000 219.300 219.600 220.300 220.800 219.900 219.000 74 215.100 215.400 215.700 216.000 216.300 216.600 217.000 217.500 218.000 218.600 219.000 218.900 218.400 75 207.400 207.500 207.600 207.700 207.800 207.900 208.000 208.200 208.400 208.600 208.300 208.000 208.300 76 195.000 195.000 195.000 195.000 195.000 195.000 195.000 195.000 195.000 195.000 195.000 195.000 195.000 77 270.000 270.000 270.000 270.000 270.000 270.000 270.000 270.000 270.000 270.000 270.000 270.000 270.000 78 243.000 243.500 244.000 244.300 244.700 245.000 245.000 245.200 245.500 250.000 250.800 251.000 251.000 79 232.100 232.700 233.000 234.000 234.300 234.700 235.000 235.300 235.700 236.200 236.800 236.600 236.100 80 226.400 226.800 227.000 227.400 228.000 228.800 229.000 229.800 229.700 230.300 230.400 230.300 230.000 81 222.700 222.800 222.900 223.200 223.500 224.000 224.000 224.500 225.000 225.200 225.300 225.000 224.900 82 209.800 210.000 210.200 210.400 210.600 210.800 211.000 211.000 211.200 211.300 212.000 212.100 211.800 83 193.000 193.000 193.000 193.000 193.000 193.000 193.000 193.000 193.000 193.000 193.000 193.000 193.000 -
nappy/trunk/test/testReadAllFFIs.py
r344 r345 20 20 print "\n\nTesting FFI: ", ffi 21 21 file=os.path.join("..", "data_files", "%s.na" % ffi) 22 # if file named after ffi doesn't exist, use an 'a' version. 22 23 if not os.path.exists(file): file=os.path.join("..", "data_files", "%sa.na" % ffi) 23 24 f=nappy.openNAFile(file) 24 25 f.readData() 26 27 print "NVPM:", f.NVPM 25 28 print "DX:",f.DX 26 29 print "VNAME", f.VNAME -
nappy/trunk/test/testWrites.py
r344 r345 8 8 9 9 """ 10 #$Log$ 11 #Revision 1.3 2004/11/03 16:25:28 selatham 12 #updated by selatham for bug fixes and new write methods 13 # 14 # 10 15 11 16 import os … … 13 18 import nappy ; reload(nappy) 14 19 15 for ffi in [1001, 2010, 3010, 4010]:20 for ffi in [1001, 1010, 2010, 3010, 4010]: 16 21 infile=os.path.join("..", "data_files", "%s.na" % ffi) 17 22 print "Reading in ", infile
Note: See TracChangeset
for help on using the changeset viewer.