source: TI03-DataExtractor/branches/old_stuff/dx/PUT_THIS_LOT_IN_LOCAL.txt @ 793

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/branches/old_stuff/dx/PUT_THIS_LOT_IN_LOCAL.txt@793
Revision 793, 1.4 KB checked in by astephen, 13 years ago (diff)

Put all the old code in the old_stuff branch.

  • Property svn:executable set to *
Line 
1A list of modifications to make local rules into dx and geosplat
2================================================================
3
4All local rules should have a line ending in # LOCAL RULE
5
6dx:
7
8            # Define horizontal spatial bounds
9            try:  # Assume all are defined
10                horizLimits=(float(self.request["north"]),
11float(self.request["west"]),
12                                        float(self.request["south"]),
13float(self.request["east"]))
14            except:
15                try: # OK, assume only west and east are defined
16                    horizLimits=(self.request["north"],
17float(self.request["west"]),
18                                 self.request["south"],
19float(self.request["east"]))
20                except:
21                    try: # OK, assume only north and south are defined
22                        horizLimits=(float(self.request["north"]),
23self.request["west"],
24                                     float(self.request["south"]),
25self.request["east"])
26                    except: # Hmmm, none are defined
27                        horizLimits=(None, None, None, None)
28
29            (north, west, south, east)=horizLimits
30
31
32
33
34geosplat:
35
36
37
38            if var=="amos": # If it's a known oceanographic variable then plot in right order
39                levaxis=list(f[varname].getLevel()[:])
40                levaxis.reverse()
41                data=f(varname, level=(levaxis[0], levaxis[-1]))
42            else:
43                data=f(varname)
44
45
Note: See TracBrowser for help on using the repository browser.