Changeset 3321


Ignore:
Timestamp:
07/02/08 20:37:47 (12 years ago)
Author:
astephen
Message:

First major re-factor.

Location:
nappy/trunk/nappy
Files:
37 added
12 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • nappy/trunk/nappy/Plans for re-factoring 2008.txt

    r3320 r3321  
    1414     * nappy/cdms_utils/ 
    1515     * nappy/utils 
    16      * nappy/ffi_classes 
     16     * nappy/na_file 
    1717     * nappy/contrib/aircraft 
    1818     
     
    2020 * GET REST FROM WIKI! 
    2121 
     22 
     23=============== 
     24localRules.py --> REMOVE COMPLETELY 
     25localRules/blah - remove this and put stuff in a top-level config file, or even remove altogether. 
     26 
     27localRules/aircraft.py - Need to consider how this can be a sub-class of Cdms2NA so that we push all the odd code into separate modules. Need to encapstulate the differences into one or two methods that are small and can be overridden. 
     28 
     29====== 
     30bin/scanFAAM.py - put in contrib 
     31 
     32====== 
     33 
     34version.py - put in config file. 
     35 
     36====== 
     37 
     38general.py --> call it utils/xxxxx.py 
     39 
     40textParser --> utils/text_parser.py 
     41 
     42naError.py --> na_error/na_error.py 
     43 
     44naCore.py --> na_file/na_core.py 
     45 
     46listManipulator -_> utils/list_manipulator.py 
     47 
     48cdmsMap.py --> put in config file given simplicity 
     49 
     50Need utils/parse_config.py 
     51 
     52====== 
    2253 
    2354CDMS stuff is most of the mess 
     
    6091 * writeToOutputFiles() 
    6192 
    62 CdmsToNABuilder CLASS 
    63 __init__ 
     93class CdmsToNABuilder --> NAContentCollector: (naDict, varIDs, varBin) 
     94__init__ --> sets everything up and runs it move some to --> analyse() 
    6495analyseVariables 
    6596defineNAVars 
     
    69100defineNAComments 
    70101defineGeneralHeader 
    71 _useLocalRule 
     102_useLocalRule --> Remove this and put it all in aircraft contrib bit 
    72103 
    73104================= 
    74105 
     106naToCdms.py 
     107=========== 
    75108 
     109This is a sub-class of all NAFile objects. Bad idea. What we need is to: 
    76110 
     111import convertor 
     112convertor.writeToNC(blah) 
     113convertor.convertToCdms(blah): (vars, global_atts) 
    77114 
    78   
     115class NAToCdms 
     116 
     117toCdmsFile 
     118createCdmsVariables - does all 
     119toCdmsVariable - does each in turn 
     120CreateCdmsAuxVariables - does all 
     121auxToCdmsVariables - does each in turn 
     122createCdmsAxes - does all 
     123toCdmsAxes - does each in turn 
     124 
     125================ 
     126 
     127Have I broken textParser.py's main function - is it same in old and new. 
     128 
     129===== 
     130 
     131NAFile2010: 
     132_readData[12] are crying out for useful names 
     133 
     134GREP 
     135==== 
     136 
     137Need to do a lot of grepping for inconsistencies. 
     138 
     139 * _normalizedX should be True|False not "yes","no" 
     140 
     141Global find and replace: 
     142 
     143floatFormat 
     144naDict 
  • nappy/trunk/nappy/__init__.py

    r3314 r3321  
    1 #   Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ). 
    2 #   This software may be distributed under the terms of the 
    3 #   Q Public License, version 1.0 or later. http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 
    41 
    5 """ 
    6 __init__.py 
    7 =========== 
    8  
    9 Initialises nappy package. 
    10  
    11 """ 
    12  
    13 from textParser import * 
    14 from general import * 
    15 from naError import * 
    16 from listManipulator import * 
    17 from localRules import * 
    18 from version import * 
    19 from naCore import * 
    20 from naFile import * 
    21 from naFile1001 import * 
    22 from naFile1010 import * 
    23 from naFile1020 import * 
    24 from naFile2010 import * 
    25 from naFile2110 import * 
    26 from naFile2160 import * 
    27 from naFile2310 import * 
    28 from naFile3010 import * 
    29 from naFile4010 import * 
    30 try: 
    31     from naToCdms import * 
    32     from cdms2na import * 
    33 except: 
    34     print "Could not locate CDAT for NASA Ames to Cdms conversions." 
  • nappy/trunk/nappy/bin/na2nc

    r3314 r3321  
    55 
    66""" 
    7 na2cdms.py 
    8 ========== 
    9  
    10 Module holds the na2cdms function to convert a NASA Ames file to a CDMS 
    11 file (NetCDF). 
    12  
    13 """ 
    14  
    15 helpMessage=""" 
    16  
    177na2nc 
    188===== 
     
    5040    file=general.openNAFile(nafile) 
    5141    if file.FFI in (2110, 2160, 2310):  
    52         print """\nERROR: Cannot convert NASA Ames File Format Index (FFI) %s to NetCDF.  
     42        print """\nERROR: Cannot convert NASA Ames File Format Index (FFI) %s to NetCDF.  
    5343No mapping implemented yet.""" % file.FFI 
    5444        return 0 
Note: See TracChangeset for help on using the changeset viewer.