Changeset 711 in lmdz_wrf for trunk


Ignore:
Timestamp:
Apr 20, 2016, 6:03:56 PM (9 years ago)
Author:
lfita
Message:

Adding `read_ASCIIlist': Function to build a list from an ASCII lines file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r710 r711  
    1576015760    return posmean
    1576115761
     15762def read_ASCIIlist(filen):
     15763    """ Function to build a list from an ASCII lines file
     15764      filen= name of the ASCII file
     15765    """
     15766    import os
     15767    fname = 'read_ASCIIlist'
     15768
     15769    if not os.path.isfile(filen):
     15770        print errormsg
     15771        print '  ' + fname + ":  ASCII types file '" + filen + "' does not exist !!"
     15772        quit(-1)
     15773
     15774    of = open(filen, 'r')
     15775    filevals = []
     15776    for linef in of:
     15777        filevals.append(linef.replace('\n',''))
     15778    of.close()
     15779
     15780    return filevals
     15781
    1576215782def radial_points(angle,dist):
    1576315783    """ Function to provide a number of grid point positions for a given angle
Note: See TracChangeset for help on using the changeset viewer.