root/AutoMOD/trunk/Python/example.xml

Revision 5613, 6.4 kB (checked in by doutriaux1, 2 years ago)

First commit of AutoMOD svn project

Line 
1 <diagnostic>
2         <output name="images" type="None">
3                 List of image files generated
4
5         </output>
6         <option name="longitude_1" value="0">
7                 <doc>
8                          First longitude
9
10                 </doc>
11         </option>
12         <option name="longitude_2" value="360">
13                 <doc>
14                          Second longitude
15
16                 </doc>
17         </option>
18         <option name="colors" value="None">
19                 <doc>
20                          Colorscale colors  (nlevels -1)
21
22                 </doc>
23         </option>
24         <option name="levels" value="[[1.0000000200408773e+20, 1.0000000200408773e+20],]">
25                 <doc>
26                          Meshfill levels
27
28                 </doc>
29         </option>
30         <option name="depth" value="0">
31                 <doc>
32                          Depth to be plotted
33
34                 </doc>
35         </option>
36         <option name="mesh" value="'n'">
37                 <doc>
38                          Turns mesh on/off
39
40                 </doc>
41         </option>
42         <option name="latitude_2" value="90">
43                 <doc>
44                          Second Latitude
45
46                 </doc>
47         </option>
48         <option name="latitude_1" value="-90">
49                 <doc>
50                          First latitude
51
52                 </doc>
53         </option>
54         <action name="apply_grid" type="function">
55                 <doc>
56                          Applies grid to an OCMIP-like file
57        
58                 </doc>
59                 <output name="images" type="None">
60                         List of image files generated
61
62                 </output>
63         </action>
64         <action name="fromXml" type="function">
65                 <doc>
66                        
67         Load an xml info file. Overwrite doc string appropriately
68        
69                 </doc>
70                 <output name="images" type="None">
71                         List of image files generated
72
73                 </output>
74         </action>
75         <action name="generate_plots" type="function">
76                 <doc>
77                        
78         Options:::
79             mesh ::  ('n') Turns mesh on/off
80             latitude_1 :: (-90) First latitude
81             latitude_2 :: (90) Second Latitude
82             longitude_1 :: (0) First longitude
83             longitude_2 :: (360) Second longitude
84             levels :: ( [[1.0000000200408773e+20, 1.0000000200408773e+20],] ) Meshfill levels
85             colors :: (None) Colorscale colors  (nlevels -1)
86             depth :: (0) Depth to be plotted
87             :::
88         Output:::
89             images :: List of image files generated
90             :::
91         crap:::
92            blabla :: toto
93            :::
94         Validation:::
95             images :: type:list
96             latitude_1 :: type:float, valid_range:(-90,90)
97             latitude_2 :: type:float, valid_range:(-90,90)
98             longitude_1 :: type:float
99             longitude_2 :: type:float
100        
101                 </doc>
102                 <output name="images" type="None">
103                         List of image files generated
104
105                 </output>
106         </action>
107         <action name="getobs" type="function"/>
108         <action name="go" type="function">
109                 <doc>
110                        
111         Parse the command line arguments, sets the option and execute default function
112         pass --help option to see available options
113         Simply add the following lines at the end of the script:
114         and run the script with --help option to see availaible option (with doc if classe is correctly documented. The result from parsing is stored in self.input.[keyword] if not default, the parser is stored in self.info.input._parser in case you need it again
115 if __name__=='__main__':
116     D=Diagnosis() # Or whatever your inherited class name is
117     D.go()       
118        
119                 </doc>
120                 <output name="images" type="None">
121                         List of image files generated
122
123                 </output>
124         </action>
125         <info>
126                 <AutoMOD>
127                         1.0
128                 </AutoMOD>
129                 <author>
130                         unknown
131                 </author>
132                 <doc>
133                        
134         Generates Surface Maps Plots (maximum 9 per page)
135
136         The color scale is based on median values of the minimum and maximum for the group of model selected.
137
138        
139                 </doc>
140                 <image>
141                         surface_maps.gif
142                 </image>
143                 <name>
144                         Surface Maps
145                 </name>
146                 <programminglanguage>
147                         Python
148                 </programminglanguage>
149                 <type>
150                         class
151                 </type>
152                 <url>
153                         http://cdat.sf.net
154                 </url>
155                 <version>
156                         0.0
157                 </version>
158         </info>
159         <input>
160                 <doc>
161                         Input informations
162                 </doc>
163                 <requirements>
164                         <doc>
165                                 Requirements informations
166                         </doc>
167                         <units>
168                                 xy
169                         </units>
170                 </requirements>
171         </input>
172         <action name="printXml" type="function">
173                 <doc>
174                        
175         Simply print to the screen the result of toXml() function
176        
177                 </doc>
178                 <output name="images" type="None">
179                         List of image files generated
180
181                 </output>
182         </action>
183         <action name="remap" type="function">
184                 <doc>
185                        
186         Function remap
187         --------------
188
189         Regrid a model output field from the model grid to different grid
190         using SCRIP grid mapping.
191         Field is supposed to have 2 or more dimensions: lat and long and others
192         lat and long are assumed to be the last dimensions.
193
194         SCRIP program must have been run before in order to produce
195         'map_filename', a grid mapping file.
196
197         Return the regridded field as a transient variable.
198
199         Call:
200             regridded_field = remap (field, map_filename, fracarea_min)
201
202         Input:
203             field:                 field as a transient variable
204             map_filename:          SCRIP mapping file name
205             fracarea_min:          minimum area fraction necessary for setting
206                                    a destination cell as valid (not missing)
207
208         Output:
209             regridded_field:       regridded field as a transient variable
210        
211                 </doc>
212                 <output name="images" type="None">
213                         List of image files generated
214
215                 </output>
216         </action>
217         <results>
218                 <doc>
219                         Results from Diagnostics are stored here
220                 </doc>
221         </results>
222         <action name="scanDocString" type="function">
223                 <doc>
224                        
225         Scan a doc string for a section (followed by 3 &quot;:&quot;)
226         The section defining the keyword is suposed to end at the next :::
227         This function returns a dictionary with keyword, the keyword are taken within the
228         delimited section. A keyword is followed by &quot;::&quot; its default value then come between
229         paranthesis: '(default)', then some documentation
230         Options:::
231           section:: ('options') Section of the doc string to scan/parse
232         :::
233         Output:::
234           dictionary :: ({}) A dictionary containing the keywords as keys and a tuple (default_value, documentation)
235         :::
236        
237                 </doc>
238                 <output name="images" type="None">
239                         List of image files generated
240
241                 </output>
242         </action>
243         <action name="toDOM" type="function">
244                 <doc>
245                        
246         Parse the class for option and functions and returns a DOM object describing the class
247        
248                 </doc>
249                 <output name="images" type="None">
250                         List of image files generated
251
252                 </output>
253         </action>
254         <action name="toXml" type="function">
255                 <doc>
256                        
257         Parse the class for option and functions and returns a XML string describing the class
258        
259                 </doc>
260                 <output name="images" type="None">
261                         List of image files generated
262
263                 </output>
264         </action>
265 </diagnostic>
266
Note: See TracBrowser for help on using the browser.