Ignore:
Timestamp:
Dec 18, 2011, 11:50:16 PM (13 years ago)
Author:
aslmd
Message:

UTIL:PYTHON: allowed to use regex in file input: e.g. pp.py -f wrfout_d03* --operation cat -v USTM --lon -65 --lat 81 --axtime ls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/pp.py

    r475 r478  
    1616    from planetoplot import planetoplot
    1717    from myscript import getparseroptions
     18    import glob
    1819    import numpy as np
     20
    1921
    2022    #############################
     
    3638    reffile = opt.fref
    3739    zexaxis = [opt.xmin,opt.xmax] ; zeyaxis=[opt.ymin,opt.ymax]
     40
     41    #############################
     42    ### Catch multiple files
     43    if "*" in opt.file[0] or "?" in opt.file[0]: yeah = glob.glob(opt.file[0]) ; yeah.sort()
     44    opt.file[0] = yeah[0]
     45    for file in yeah: opt.file[0] = opt.file[0] + "," + file
    3846
    3947    #############################
Note: See TracChangeset for help on using the changeset viewer.