source: TI02-CSML/trunk/Scanner/csmllibs/csmlextra.py @ 855

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI02-CSML/trunk/Scanner/csmllibs/csmlextra.py@855
Revision 855, 1.2 KB checked in by domlowe, 14 years ago (diff)

fixed problem with arraySize list/tuple/string confusion

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#Stuff with nowhere better to go
2
3
4def getSeqRule(nDims):
5        #returns a sequenceRule
6        #*****************very simplified version*****************
7        #This really needs more work to see if the +s and -s are correct. and the x/y/z s in right order
8        #nDims = spatial dimensions + time dimension
9        if nDims == 2:
10                seq = "Linear"
11        elif nDims ==3:
12                seq = "+x+y"
13        elif nDims ==4:
14                seq = "+x+y+z"
15        else:
16                seq="not sure"
17        return seq
18       
19       
20def getMappingRule(nDims):
21        #again, this needs a lot of work.
22        if nDims == 2:
23                mr = "+ gridI + series"
24        elif nDims ==3:
25                mr = "+ gridI + gridJ +series"
26        elif nDims ==4:
27                mr = "+ gridI + gridJ +gridK +series"
28        else:
29                mr="not sure"
30        return mr
31       
32       
33# a couple of string cleaning functions:
34#   don't think these are used now
35# def cleanString1(messystring):
36#       #removes outer brackets and changes commas to spaces
37#       cleanstring = messystring[1:-1]
38#       cleanstring = cleanstring.replace(',',' ')
39#       #strip off first (time) dimension.
40#       #note, this might need rethinking for other datasets
41#       cleanstring = cleanstring[3:]
42#       return cleanstring
43#       
44# def cleanString2(messystring):
45#       #removes outer brackets and 's, but leaves commas.
46#       cleanstring = messystring[1:-1]
47#       cleanstring = cleanstring.replace("'",'')
48#       return cleanstring
49       
Note: See TracBrowser for help on using the repository browser.