Changeset 1934 in lmdz_wrf for trunk


Ignore:
Timestamp:
Jul 16, 2018, 3:14:46 PM (6 years ago)
Author:
lfita
Message:

Adding debugging in getting_fixedline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r1919 r1934  
    1271012710    return narray
    1271112711
    12712 def getting_fixedline(line, cuts, types):
     12712def getting_fixedline(line, cuts, types, dbg=False):
    1271312713    """ Function to get the values from a line of text with fixed lenght of different values
    1271412714      line: line with values
     
    1272012720        'S': string
    1272112721        'B': boolean
     12722      dbg: debug mode (default False)
    1272212723    >>> Sline='   87007 03012015  25.6   6.4             9.4    5   15'
    1272312724    >>> getting_fixedline(Sline, [8, 17, 23, 29, 36, 40, 45, 50], ['I', 'R', 'R', 'R', 'I', 'R', 'R', 'R'])
     
    1274612747    for ic in range(1,Ncuts):
    1274712748        val = line[cuts[ic-1]:cuts[ic]]
     12749        if dbg: print ic, ':', val, '-->', types[ic]
    1274812750        if len(val.replace(' ','')) >= 1:
    1274912751            values.append(typemod(val, types[ic]))
Note: See TracChangeset for help on using the changeset viewer.