示例#1
0
             continue
         # Sort in decending alphabetical, so 'E' is [0] 'N' is [1] and 'Z' is [2]
         # Pull outn sacfiles from zipped sorted list.
        comps.sort()
        _ , sacfiles = zip(*comps)

        cmd = ppicker(event,sacfiles[0],sacfiles[1], False)

    ###########################################################################
    # This is the control switch board. If function returns n, rename folder.
    # If it return a p, go to previous index. If it is an r, redo. Else move
    # forward
    ###########################################################################

        if cmd == 'n':
            events[index] = os.path.basename( renameEvent(event,"poorData") )
            index += 1
        elif cmd == 'p':
            index -= 1
            continue
        elif cmd == 'r':
            continue
        elif cmd == 's':
            index += 1
            continue
        else:
            # If yes, check if dir previously renamed as poorData, if so rename to healthy event dir
            if "poorData" in event:
                events[index] = os.path.basename(renameEvent( event, [], True))
            index += 1
            continue
示例#2
0
    parser.add_argument('-r','--reset', action = 'store_true',
                        help = "unpicks all folders by renaming them back to numeric event folder names")

    parser.add_argument('-s','--sort', action = 'store_true',
                        help = "quickly run through all picked folders and use yes or no to keep or discard")

    args = parser.parse_args()

    # Suck out command line argument for station directory and return list of event folders
    stdir = args.stndir[0]
    events = os.listdir(stdir)

    if args.reset:
         for event in events:
            if "poorData" in event:
                renameEvent( os.path.join(stdir,event), [], True)
         exit()

    if args.all:
        events = filter(isEitherPoororNumber, events)

    if args.poor:
        events = filter(isPoor, events)

    if not args.poor and not args.all:
        events = filter( is_number, events)

    index = 0
    while index < len(events):
        event = events[index]
        print "{}/{} Pick P-coda limits".format(index + 1, len(events) )
示例#3
0
        '--sort',
        action='store_true',
        help=
        "quickly run through all picked folders and use yes or no to keep or discard"
    )

    args = parser.parse_args()

    # Suck out command line argument for station directory and return list of event folders
    stdir = args.stndir[0]
    events = os.listdir(stdir)

    if args.reset:
        for event in events:
            if "poorData" in event:
                renameEvent(os.path.join(stdir, event), [], True)
        exit()

    if args.all:
        events = filter(isEitherPoororNumber, events)

    if args.poor:
        events = filter(isPoor, events)

    if not args.poor and not args.all:
        events = filter(is_number, events)

    index = 0
    while index < len(events):
        event = events[index]
        print "{}/{} Pick P-coda limits".format(index + 1, len(events))
            continue
        # Sort in decending alphabetical, so 'E' is [0] 'N' is [1] and 'Z' is [2]
        # Pull outn sacfiles from zipped sorted list.
        comps.sort()
        _, sacfiles = zip(*comps)

        cmd = ppicker(event, sacfiles[0], sacfiles[1], False)

        ###########################################################################
        # This is the control switch board. If function returns n, rename folder.
        # If it return a p, go to previous index. If it is an r, redo. Else move
        # forward
        ###########################################################################

        if cmd == 'n':
            events[index] = os.path.basename(renameEvent(event, "poorData"))
            index += 1
        elif cmd == 'p':
            index -= 1
            continue
        elif cmd == 'r':
            continue
        elif cmd == 's':
            index += 1
            continue
        else:
            # If yes, check if dir previously renamed as poorData, if so rename to healthy event dir
            if "poorData" in event:
                events[index] = os.path.basename(renameEvent(event, [], True))
            index += 1
            continue