Changeset 2029 in lmdz_wrf
- Timestamp:
- Aug 6, 2018, 4:39:09 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r2028 r2029 13620 13620 char= character to provide different values 13621 13621 oper= available operations 13622 'getvalue': get the value at a given index 13622 13623 'maxloc': index of the maximum value 13623 13624 'minloc': index of the minimum value … … 13635 13636 """ 13636 13637 fname = 'inf_operSlist' 13637 availoper = [' maxloc', 'minloc', 'sort', 'threshold']13638 availoper = ['getvalue', 'getvalue''maxloc', 'minloc', 'sort', 'threshold'] 13638 13639 13639 13640 haschar = listS.find(char) … … 13646 13647 listv = str_list_k(listS, char, 'F') 13647 13648 13648 if oper == 'maxloc': 13649 if oper == 'getvalue': 13650 return listv[int(values)] 13651 elif oper == 'maxloc': 13649 13652 xl = np.max(listv) 13650 13653 return index_vec(listv, xl) … … 13698 13701 elif sign < 0.: 13699 13702 for iloc in range(Nval-1): 13700 if listv[iloc ] >= val and listv[iloc-1] < val: return iloc13703 if listv[iloc+1] >= val and listv[iloc] < val: return iloc 13701 13704 return Nval 13702 13705
Note: See TracChangeset
for help on using the changeset viewer.