Changeset 1222 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Oct 20, 2016, 1:34:29 PM (8 years ago)
Author:
lfita
Message:

Fixing `significant_decomposition' by introducing an error message when minimal potence is higher than the potence of the value

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic.py

    r1221 r1222  
    7474## e.g. # generic.py -o radius_dist -S 3,5,2,2
    7575## e.g. # generic.py -o rmNOnum -S LMD123IPSL
    76 ## e.g. # generic.py -o significant_decomposition -S 3.576,-2,0@1@2@3@4@5@6@7@8@9@10@11@12@13@14,a@b@c@d@e,i@ii@iii,table.tex
     76## e.g. # generic.py -o significant_decomposition -S 3.576,-2
    7777## e.g. # generic.py -o table_tex_file -S '5,3,0@5@10@1@6@11@2@7@12@3@8@13@4@9@14,!@a@b@c@d@e,i@ii@iii,table.tex'
    7878## e.g. # generic.py -o unitsDate -S '19490101000000,19760217082932,second'
  • trunk/tools/generic_tools.py

    r1219 r1222  
    72827282      num= number to decompose
    72837283      minpot= minumum potence to decompose
    7284     >>> significant_decomposition(np.pi,5)
     7284    >>> significant_decomposition(np.pi,-6)
    72857285    7, [0.0, -1.0, -2.0, -3.0, -4.0, -5.0, -6.0], [3, 1, 4, 1, 5, 9, 2]
    72867286    """
     
    72947294    iipot = 1
    72957295    pot = np.floor(np.log10(anum))
     7296    if pot < minpot:
     7297        print errormsg
     7298        print '  ' + fname + ': required minimum potency:', minpot, 'is smaller ' + \
     7299          'than the potency of the value:', pot, '!!'
     7300        print '    minimum value 10**minpot:', 10**(minpot), '>', anum
     7301        print "    reduce 'minpot'"
     7302        quit(-1)
     7303
    72967304    while pot > minpot:
    72977305        if diff >= 10.**(pot-1):
Note: See TracChangeset for help on using the changeset viewer.