Changeset 561 in lmdz_wrf for trunk/tools
- Timestamp:
- Jul 3, 2015, 6:08:18 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r558 r561 1799 1799 ncfilens= [filen] ',' separated list of netCDF files 1800 1800 values= [dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];[timevals];[locleg]; 1801 [graphk];[collines] 1801 [graphk];[collines];[period] 1802 1802 [dimvname]: ',' list of names of the variables with he values of the common dimension 1803 1803 [valuesaxis]: which axis will be used for the values ('x', or 'y') 1804 [dimtit]: title for the common dimension 1804 [dimtit]: title for the common dimension ('|' for spaces) 1805 1805 [leglabels]: ',' separated list of names for the legend 1806 1806 [vartit]: name of the variable in the graph … … 1823 1823 [graphk]: kind of the graphic 1824 1824 [collines]: ',' list of colors for the lines or None for automatic 1825 [period]: which period to plot 1826 '-1': all period 1827 [beg],[end]: beginning and end of the period in reference time-units of first file 1825 1828 varname0= ',' list of variable names to plot (assuming only 1 variable per file) 1826 1829 values= 'time;y;time ([DD]${[HH]}$);32x32;$wss^{*}$;wss Taylor's turbulence term;time|hours!since!1949-12-01_00:00:00;exct,12,h|%d$^{%H}$;2;pdf' … … 1835 1838 1836 1839 expectargs = '[dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];' 1837 expectargs = expectargs + '[timevals];[locleg];[graphk];[collines] '1840 expectargs = expectargs + '[timevals];[locleg];[graphk];[collines];[period]' 1838 1841 drw.check_arguments(fname,len(expectargs.split(';')),values,';',expectargs) 1839 1842 … … 1841 1844 dimvname0 = values.split(';')[0] 1842 1845 valuesaxis = values.split(';')[1] 1843 dimtit = values.split(';')[2] 1846 dimtit = values.split(';')[2].replace('|',' ') 1844 1847 leglabels = values.split(';')[3].replace('_','\_') 1845 1848 vartit = values.split(';')[4] … … 1849 1852 graphk = values.split(';')[8] 1850 1853 collines0 = values.split(';')[9] 1854 period = values.split(';')[10] 1851 1855 1852 1856 Nfiles = len(ncfiles) … … 1929 1933 quit(-1) 1930 1934 1931 varvalues.append(vvobj[:]) 1932 dimvalues.append(vdobj[:]) 1933 1934 mindvals = np.min(vdobj[:]) 1935 maxdvals = np.max(vdobj[:]) 1936 dimt = len(vvobj[:]) 1935 1936 # Getting period 1937 dimt = len(vdobj[:]) 1938 1939 if period == 'all': 1940 varvalues.append(vvobj[:]) 1941 dimvalues.append(vdobj[:]) 1942 mindvals = np.min(vdobj[:]) 1943 maxdvals = np.max(vdobj[:]) 1944 else: 1945 ibeg=-1 1946 iend=-1 1947 tbeg = np.float(period.split(',')[0]) 1948 tend = np.float(period.split(',')[1]) 1949 1950 for it in range(dimt-1): 1951 if vdobj[it] <= tbeg and vdobj[it+1] > tbeg : ibeg = it 1952 if vdobj[it] <= tend and vdobj[it+1] > tend: iend = it + 1 1953 if ibeg != -1 and iend != -1: break 1954 1955 if ibeg == -1 and iend == -1: 1956 print errormsg 1957 print ' ' + fname + ': Period:',tbeg,',',tend,'not found!!' 1958 print ' ibeg:',ibeg,'iend:',iend 1959 print ' period in file:',np.min(vdobj[:]), np.max(vdobj[:]) 1960 quit(-1) 1961 elif iend == -1: 1962 iend = dimt 1963 print warnmsg 1964 print ' ' + fname + ': end of Period:',tbeg,',',tend,'not found!!' 1965 print ' getting last available time instead' 1966 print ' ibeg:',ibeg,'iend:',iend 1967 print ' period in file:',np.min(vdobj[:]), np.max(vdobj[:]) 1968 elif ibeg == -1: 1969 ibeg = 0 1970 print warnmsg 1971 print ' ' + fname + ': beginning of Period:',tbeg,',',tend, \ 1972 'not found!!' 1973 print ' getting first available time instead' 1974 print ' ibeg:',ibeg,'iend:',iend 1975 print ' period in file:',np.min(vdobj[:]), np.max(vdobj[:]) 1976 1977 varvalues.append(vvobj[ibeg:iend]) 1978 dimvalues.append(vdobj[ibeg:iend]) 1979 mindvals = np.min(vdobj[ibeg:iend]) 1980 maxdvals = np.max(vdobj[ibeg:iend]) 1981 1982 dimt = iend - ibeg 1937 1983 1938 1984 if mindvals < mintval: mintval = mindvals
Note: See TracChangeset
for help on using the changeset viewer.