Changeset 3463


Ignore:
Timestamp:
19/02/08 18:24:10 (12 years ago)
Author:
ckilburn
Message:

Adding annotation column

Location:
nappy/trunk/nappy
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nappy/trunk/nappy/na_file/na_file.py

    r3461 r3463  
    2323import nappy.na_file.na_core 
    2424import nappy.utils.text_parser 
     25import nappy.utils.common_utils 
    2526import nappy.na_error 
    2627 
     
    172173        """ 
    173174        self.header.write("%s%s%s\n" % (self.NLHEAD, self.delimiter, self.FFI)) 
    174         self.header.write("%s\n" % self.ONAME) 
     175        self.header.write(nappy.utils.common_utils.getAnnotation("ONAME", delimiter = self.delimiter) + self.ONAME + "\n") 
    175176        self.header.write("%s\n" % self.ORG) 
    176177        self.header.write("%s\n" % self.SNAME) 
  • nappy/trunk/nappy/na_file/na_file_1001.py

    r3461 r3463  
    1 ;#   Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ). 
     1#   Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ). 
    22#   This software may be distributed under the terms of the 
    33#   Q Public License, version 1.0 or later. http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 
  • nappy/trunk/nappy/utils/common_utils.py

    r3406 r3463  
    126126        items = items[2:]  
    127127    return d 
     128 
     129def getAnnotation(item, delimiter = ',   '): 
     130    """ 
     131    Returns the annotation string for a given NASA Ames item. 
     132    """ 
     133    #Pick up annotation config here 
     134    annotation = True 
     135     
     136    dict = {"NLHEAD_FFI" : "Number of header lines; sub-format (NASA ames FFI)", 
     137            "ONAME" : "Name of data creator", 
     138            "ORG" : "Institute of data creator", 
     139            "SNAME" : "Instrument or model", 
     140            "MNAME" : "Project name", 
     141            "IVOL_NVOL" : "Volume number: Total number of files", 
     142            "DATE_RDATE" : "Starting data of data; File creation date", 
     143            "DX" : "Interval between coordinate variable values (zero if not used)", 
     144            "XNAME(1)" : "Name of first coordinate variable [i.e. axis] (with units)", 
     145            "XNAME(2)" : "Name of second coordinate variable [i.e. axis] (with units)", 
     146            "NV" : "Number of variables at each point (i.e. defined against both axes)", 
     147            "VSCAL" : "Scaling factors for each variable", 
     148            "VMISS" : "Missing values for each variable", 
     149            "VNAME(1)" : "Name of variable 1 (with units)", 
     150            "VNAME(2)" : "Name of variable 1 (with units)", 
     151            "NAUXV" : "Number of auxiliary variables (variables defined with one value)", 
     152            "ASCAL" : "Scale factors for each auxiliary variable", 
     153            "AMISS" : "Missing values for each auxiliary variable", 
     154            "ANAME(1)" : "Name of auxiliary variable 1 [long name in square brackets] (with units)", 
     155            "ANAME(2)" : "Name of auxiliary variable 2 [long name in square brackets] (with units)", 
     156            "NSCOML" : "Number of lines of special comments", 
     157            "SCOM(1)" : "Special comments line 1", 
     158            "SCOM(2)" : "Special comments line 2", 
     159            "NNCOML" : "Number of lines of normal comments", 
     160            "NCOM(1)" : "Normal comments line 1", 
     161            "NCOM(2)" : "Normal comments line 2" 
     162            } 
     163 
     164    if annotation: return dict[item] + delimiter 
     165    else: return '' 
Note: See TracChangeset for help on using the changeset viewer.