Changeset 976 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jun 30, 2016, 7:46:26 PM (8 years ago)
Author:
lfita
Message:

Adding error message on negative interval on `pretty_int'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing_tools.py

    r960 r976  
    18991899    >>> pretty_int(-23.50,67.21,15)
    19001900    [  0.  20.  40.  60.]
    1901     pretty_int(14.75,25.25,5)
     1901    >>> pretty_int(14.75,25.25,5)
    19021902    [ 16.  18.  20.  22.  24.]
     1903    >>> pretty_int(-20.,20.,10)
     1904    [-20. -15. -10.  -5.   0.   5.  10.  15.]
    19031905    """
    19041906    fname = 'pretty_int'
    19051907    nice_int = [1,2,5]
    19061908
    1907 #    print 'minv: ',minv,'maxv:',maxv,'Nint:',Nint
    1908 
    19091909    interval = np.abs(maxv - minv)
     1910
     1911    if interval < 0.:
     1912        print errormsg
     1913        print '  ' + fname + ': wrong interval',interval,'!!'
     1914        print '    it can not be negative'
     1915        quit(-1)
    19101916
    19111917    potinterval = np.log10(interval)
Note: See TracChangeset for help on using the changeset viewer.