- Timestamp:
- Jun 17, 2016, 2:52:02 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r854 r856 6658 6658 quit(-1) 6659 6659 6660 if searchInlist(varobj.ncattrs(), '_FillValue'):6660 if gen.searchInlist(varobj.ncattrs(), '_FillValue'): 6661 6661 NOvalue = varobj.getncattr('_FillValue') 6662 6662 print warnmsg … … 6664 6664 6665 6665 if opern == 'add': 6666 if searchInlist(varobj.ncattrs(), '_FillValue'):6666 if gen.searchInlist(varobj.ncattrs(), '_FillValue'): 6667 6667 prevals = varvals.filled(0.) 6668 6668 newvarv = newvarv + prevals … … 6670 6670 newvarv = newvarv + varvals 6671 6671 operation = operation + ' +' + varn 6672 newunits = variables_values(varname)[5]6672 newunits = gen.variables_values(varname)[5] 6673 6673 elif opern == 'sub': 6674 if searchInlist(varobj.ncattrs(), '_FillValue'):6674 if gen.searchInlist(varobj.ncattrs(), '_FillValue'): 6675 6675 prevals = varvals.filled(0.) 6676 6676 newvarv = newvarv - prevals … … 6678 6678 newvarv = newvarv - varvals 6679 6679 operation = operation + ' -' + varn 6680 newunits = variables_values(varname)[5]6680 newunits = gen.variables_values(varname)[5] 6681 6681 elif opern == 'mul': 6682 if searchInlist(varobj.ncattrs(), '_FillValue'):6682 if gen.searchInlist(varobj.ncattrs(), '_FillValue'): 6683 6683 prevals = varvals.filled(1.) 6684 6684 newvarv = newvarv * prevals … … 6686 6686 newvarv = newvarv * varvals 6687 6687 operation = operation + ' *' + varn 6688 newunits = variables_values(varname)[5]6688 newunits = gen.variables_values(varname)[5] 6689 6689 elif opern == 'div': 6690 if searchInlist(varobj.ncattrs(), '_FillValue'):6690 if gen.searchInlist(varobj.ncattrs(), '_FillValue'): 6691 6691 prevals = varvals.filled(1.) 6692 6692 newvarv = newvarv / prevals … … 6694 6694 newvarv = newvarv / varvals 6695 6695 operation = operation + ' /' + varn 6696 newunits = variables_values(varname)[5]6696 newunits = gen.variables_values(varname)[5] 6697 6697 elif opern == 'pot': 6698 if searchInlist(varobj.ncattrs(), '_FillValue'):6698 if gen.searchInlist(varobj.ncattrs(), '_FillValue'): 6699 6699 prevals = varvals.filled(1.) 6700 6700 newvarv = newvarv ** prevals … … 6702 6702 newvarv = newvarv ** varvals 6703 6703 operation = operation + ' **' + varn 6704 newunits = variables_values(varname)[5]6704 newunits = gen.variables_values(varname)[5] 6705 6705 6706 6706 # Creation of the new file
Note: See TracChangeset
for help on using the changeset viewer.