Changeset 470 in lmdz_wrf for trunk/tools/drawing.py
- Timestamp:
- Jun 10, 2015, 11:37:09 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r446 r470 1515 1515 ncfilens= [filen] ',' separated list of netCDF files 1516 1516 values= [dimvname]:[valuesaxis]:[dimtit]:[leglabels]:[vtit]:[title]:[locleg]:[graphk] 1517 [dimvname]: nameof the variable with he values of the common dimension1517 [dimvname]: ',' list of names of the variable with he values of the common dimension 1518 1518 [valuesaxis]: which axis will be used for the values ('x', or 'y') 1519 1519 [dimtit]: title for the common dimension … … 1541 1541 1542 1542 ncfiles = ncfilens.split(',') 1543 dimvname = values.split(':')[0]1543 dimvnames = values.split(':')[0] 1544 1544 valuesaxis = values.split(':')[1] 1545 1545 dimtit = values.split(':')[2] … … 1571 1571 objfile = NetCDFFile(filen, 'r') 1572 1572 1573 if not objfile.variables.has_key(dimvname): 1573 if dimvnames.find(',') != -1: 1574 dimvname = dimvnames.split(',') 1575 else: 1576 dimvname = [dimvnames] 1577 1578 found = False 1579 for dvn in dimvname: 1580 if objfile.variables.has_key(dvn): 1581 found = True 1582 break 1583 1584 if not found: 1574 1585 print errormsg 1575 1586 print ' ' + fname + ": netCDF file '" + filen + \ 1576 "' does not have variable '" + dimvname + "' !!"1587 "' does not have variables '" + dimvname + "' !!" 1577 1588 quit(-1) 1578 1589 … … 1590 1601 quit(-1) 1591 1602 1592 vdobj = objfile.variables[dimvname] 1593 if len(vdobj.shape) != 1: 1594 print errormsg 1595 print ' ' + fname + ': wrong shape:',vdobj.shape," of variable '" + \ 1596 dimvname + "' !!" 1597 quit(-1) 1603 for dimvn in dimvname: 1604 if searchInlist(objfile.variables, dimvn): 1605 vdobj = objfile.variables[dimvname] 1606 if len(vdobj.shape) != 1: 1607 print errormsg 1608 print ' ' + fname + ': wrong shape:',vdobj.shape, \ 1609 " of variable '" + dimvn + "' !!" 1610 quit(-1) 1611 break 1598 1612 1599 1613 varvalues.append(vvobj[:])
Note: See TracChangeset
for help on using the changeset viewer.