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