Esempio n. 1
0
def main():
    stations = 'PB03 PB04'

    component = 'Z'
    t1 = UTC('2006-01-01')
    t2 = UTC()
#    t1 = UTC('2007-01-01')
#    t2 = UTC('2007-01-03')

    method1 = 'filter0.01-1_water_env2_whitening_1bit'
    method2 = 'filter0.01-1_water_env2_whitening_1bit_fft'

    data1 = IPOC(xcorr_append='/Tocopilla/' + method1, use_local_LVC=True)
    data2 = IPOC(xcorr_append='/Tocopilla/' + method2, use_local_LVC=True)

    for station in stations.split():
        for day in daygen(t1, t2):
            try:
                stream = data1.getStream(day, station, component)
            except:
                log.warning('Could not read stream for day %s station %s' % (day, station))
            else:
                if len(stream) != 1:
                    log.warning('Stream for day %s station %s has wrong length %d' % (day, station, len(stream)))
                elif stream[0].stats.npts / stream[0].stats.sampling_rate < 24 * 3600 * 0.5:
                    log.warning('Stream for day %s station %s has only a coverage of %f  -> discard' % (day, station, 1. * stream[0].stats.npts / stream[0].stats.sampling_rate / 24 / 3600))
                else:
                    stream.fft()
                    stream.write(data2.getDay(station, day), 'Q')
Esempio n. 2
0
def main2():
    data = IPOC(xcorr_append='/1bit', use_local_LVC=True)
    t1 = UTC('2010-01-01')
    stream0_1 = data.getRawStream(t1, 'PB01', component='Z')
    stream0_2 = data.getRawStream(t1, 'PB02', component='Z')

    stream2_1 = data.getStream(t1, 'PB01', component='Z')
    stream2_2 = data.getStream(t1, 'PB02', component='Z')

    plot_streams([stream0_1, stream0_2, stream2_1, stream2_2], [None, None, 0.1, 0.1])
    plotPSD([stream0_1, stream0_2, stream2_1, stream2_2], 4096)

    ipshell()
Esempio n. 3
0
def main():
    stations = 'PB03 PB04'

    component = 'Z'
    t1 = UTC('2006-01-01')
    t2 = UTC()
    #    t1 = UTC('2007-01-01')
    #    t2 = UTC('2007-01-03')

    method1 = 'filter0.01-1_water_env2_whitening_1bit'
    method2 = 'filter0.01-1_water_env2_whitening_1bit_fft'

    data1 = IPOC(xcorr_append='/Tocopilla/' + method1, use_local_LVC=True)
    data2 = IPOC(xcorr_append='/Tocopilla/' + method2, use_local_LVC=True)

    for station in stations.split():
        for day in daygen(t1, t2):
            try:
                stream = data1.getStream(day, station, component)
            except:
                log.warning('Could not read stream for day %s station %s' %
                            (day, station))
            else:
                if len(stream) != 1:
                    log.warning(
                        'Stream for day %s station %s has wrong length %d' %
                        (day, station, len(stream)))
                elif stream[0].stats.npts / stream[
                        0].stats.sampling_rate < 24 * 3600 * 0.5:
                    log.warning(
                        'Stream for day %s station %s has only a coverage of %f  -> discard'
                        % (day, station, 1. * stream[0].stats.npts /
                           stream[0].stats.sampling_rate / 24 / 3600))
                else:
                    stream.fft()
                    stream.write(data2.getDay(station, day), 'Q')
Esempio n. 4
0
    from sito import read
    from sito.imaging import plotTrace
    stream = read(args.file_station)
    plotTrace(stream, **kwargs)

else:
    from sito.imaging import plotTrace2
    station = args.file_station
    if station.startswith('PB') or station == 'LVC':
        from sito.data import IPOC
        data = IPOC(xcorr_append=args.xcorr_append)
    elif station == 'PKD':
        from sito.data import Parkfield
        data = Parkfield(xcorr_append=args.xcorr_append)
    else:
        raise argparse.ArgumentError('Not a valid station name')

    day = UTCDateTime(args.date)
    if args.xcorr_append is None:
        stream = data.getRawStream(day, station, component=args.component)
    else:
        stream = data.getStream(day, station, component=args.component)
    if stream[0].stats.is_fft:
        stream.ifft()
    plotTrace(stream, component=args.component, **kwargs)

if args.save is None:
    from matplotlib.pyplot import show
    show()

Esempio n. 5
0
if args.date is None:
    from sito import read
    from sito.imaging import plotTrace
    stream = read(args.file_station)
    plotTrace(stream, **kwargs)

else:
    from sito.imaging import plotTrace2
    station = args.file_station
    if station.startswith('PB') or station == 'LVC':
        from sito.data import IPOC
        data = IPOC(xcorr_append=args.xcorr_append)
    elif station == 'PKD':
        from sito.data import Parkfield
        data = Parkfield(xcorr_append=args.xcorr_append)
    else:
        raise argparse.ArgumentError('Not a valid station name')

    day = UTCDateTime(args.date)
    if args.xcorr_append is None:
        stream = data.getRawStream(day, station, component=args.component)
    else:
        stream = data.getStream(day, station, component=args.component)
    if stream[0].stats.is_fft:
        stream.ifft()
    plotTrace(stream, component=args.component, **kwargs)

if args.save is None:
    from matplotlib.pyplot import show
    show()