source: TI03-DataExtractor/trunk/dxs/dxvv/VVDoubler.py @ 1244

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/trunk/dxs/dxvv/VVDoubler.py@1244
Revision 1244, 961 bytes checked in by astephen, 13 years ago (diff)

Close to alpha version.

Line 
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
4
5"""
6
7VVDoubler.py
8============
9
10Holds the VVDoubler class that calculates a virtual variable that is 2 times
11another variable.
12
13"""
14
15# Import standard library modules
16import os
17
18
19# Import package modules
20import cdms
21
22class VVDoubler:
23    """
24    Class to virtual variables that are double another variable.
25    """
26   
27    def __init__(self, variableID, datasetURI):
28        """
29        Hmmm
30        """
31        varDict={("twotimespqn", "file:/usr/local/test/dxs/testdata/testdata1.xml"):
32                ["pqn", "file:/usr/local/test/dxs/testdata/testdata1.xml"]}
33        (inputVar, fileURI)=varDict[(variableID, datasetURI)]
34       
35        # open file
36        infile=cdms.open(fileURI)
37        invar=infile(inputVar)
38       
39        outvar=2*invar
40        # What about all the output metadata???
41        self.var=outvar
Note: See TracBrowser for help on using the repository browser.