1 | |
---|
2 | ### A. Spiga -- LMD -- 03/07/2011 |
---|
3 | |
---|
4 | def api_onelevel ( path_to_input = './', \ |
---|
5 | input_name = 'wrfout_d0?_????-??-??_??:00:00', \ |
---|
6 | path_to_output = None, \ |
---|
7 | output_name = None, \ |
---|
8 | process = 'list', \ |
---|
9 | fields = 'tk,W,uvmet,HGT', \ |
---|
10 | debug = False, \ |
---|
11 | bit64 = False, \ |
---|
12 | oldvar = True, \ |
---|
13 | interp_method = 4, \ |
---|
14 | extrapolate = 0, \ |
---|
15 | unstagger_grid = False, \ |
---|
16 | interp_level = [-9999.], \ |
---|
17 | onelevel = 0.020, \ |
---|
18 | nocall = False ): |
---|
19 | import api |
---|
20 | import numpy as np |
---|
21 | |
---|
22 | if not path_to_output: path_to_output = path_to_input |
---|
23 | |
---|
24 | if not output_name: |
---|
25 | if interp_method <= 2: output_name = input_name+'_p' |
---|
26 | if interp_method == 3: output_name = input_name+'_z' |
---|
27 | if interp_method == 4: output_name = input_name+'_zabg' |
---|
28 | |
---|
29 | if interp_level[0] == -9999.: |
---|
30 | interp_level = np.arange(299) |
---|
31 | else: |
---|
32 | zelen = len(interp_level) |
---|
33 | zetemp = np.zeros(299) |
---|
34 | zetemp[0:zelen] = interp_level[0:zelen] |
---|
35 | zetemp[zelen] = -99999. |
---|
36 | interp_level = zetemp |
---|
37 | onelevel = -99999. |
---|
38 | |
---|
39 | print input_name, output_name |
---|
40 | |
---|
41 | if nocall: pass |
---|
42 | else: api.api_main ( path_to_input, input_name, path_to_output, output_name, \ |
---|
43 | process, fields, debug, bit64, oldvar, interp_level, \ |
---|
44 | interp_method, extrapolate, unstagger_grid, onelevel ) |
---|
45 | |
---|
46 | return output_name |
---|