FV3 Bundle
plotDiffs.py
Go to the documentation of this file.
1 #!/usr/local/bin/python
2 # (C) Copyright 2009-2016 ECMWF.
3 #
4 # This software is licensed under the terms of the Apache Licence Version 2.0
5 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6 # In applying this licence, ECMWF does not waive the privileges and immunities
7 # granted to it by virtue of its status as an intergovernmental organisation nor
8 # does it submit to any jurisdiction.
9 
10 
11 import QgPlot
12 import QgRead
13 
14 #fdbdir="/home/rd/dai/Oops/Data/FDB"
15 fdbdir="/home/da/dasg/Data/FDB"
16 attributes = {}
17 attributes["expver"] = "example"
18 attributes["validitydate"] = "2010-01-01T00:00:00Z"
19 attributes["step"] = "P1D"
20 qgReader = QgRead.QgRead()
21 
22 # Read first fields
23 
24 #background
25 attributes["type"] = "fc"
26 attributes["referencedate"] = "2009-12-31T00:00:00Z"
27 
28 #truth
29 #attributes["referencedate"] = "2009-12-15T00:00:00Z"
30 #attributes["type"] = "truth"
31 
32 
33 print "reading first fields..."
34 pv1, psi1 = qgReader.readFields(fdbdir,attributes)
35 
36 # Read second fields
37 
38 #analysis
39 attributes["type"] = "an"
40 attributes["referencedate"] = "2010-01-02T00:00:00Z"
41 
42 #bg
43 #attributes["type"] = "fc"
44 #attributes["referencedate"] = "2009-12-31T00:00:00Z"
45 
46 print "reading second fields..."
47 pv2, psi2 = qgReader.readFields(fdbdir,attributes)
48 
49 # Plot difference
50 
51 qgplt = QgPlot.QgPlot()
52 
53 qgplt.plot(pv2-pv1,psi2-psi1)