Esempio n. 1
0
def configure():
    # center=[-124, 40.5]; expname='Humboldt'; radius = 100; #
    # center=[-122.5, 40.5]; expname='Chico'; radius = 75; #
    # center=[-119.0, 37.7];     expname='LVC';  radius = 30; # km
    center = [-115.5, 33]
    expname = 'SSGF'
    radius = 80

    proc_center = 'unr'
    # WHICH DATASTREAM DO YOU WANT?
    refframe = 'NA'
    # WHICH REFERENCE FRAME?

    stations, lons, lats, distances = stations_within_radius.get_stations_within_radius(
        center, radius, network=proc_center)
    blacklist = [
        "P340", "P316", "P170", "P158", "TRND", "P203", "BBDM", "KBRC", "RYAN",
        "BEAT", "CAEC", "MEXI"
    ]
    # This is global, just keeps growing
    outdir = expname + "_" + proc_center
    subprocess.call(["mkdir", "-p", outdir], shell=False)
    outname = expname + "_" + str(center[0]) + "_" + str(
        center[1]) + "_" + str(radius)
    myparams = Parameters(expname=expname,
                          proc_center=proc_center,
                          refframe=refframe,
                          center=center,
                          radius=radius,
                          stations=stations,
                          distances=distances,
                          blacklist=blacklist,
                          outdir=outdir,
                          outname=outname)
    return myparams
def configure(data_config_file, expname, center, radius, proc_center, refframe,
              outdir):
    # Set up the stacking process
    stations, lons, lats, distances = stations_within_radius.get_stations_within_radius(
        data_config_file, center, radius, network=proc_center)
    data_config = gps_io_functions.read_config_file(data_config_file)
    blacklist = np.loadtxt(data_config.blacklist,
                           unpack=False,
                           usecols=(0),
                           dtype={
                               'names': ('name', ),
                               'formats': ('U4', )
                           })
    blacklist = [i[0] for i in blacklist]
    subprocess.call(["mkdir", "-p", outdir], shell=False)
    outname = expname + "_" + str(center[0]) + "_" + str(
        center[1]) + "_" + str(radius)
    myparams = Parameters(expname=expname,
                          proc_center=proc_center,
                          refframe=refframe,
                          center=center,
                          radius=radius,
                          stations=stations,
                          distances=distances,
                          blacklist=blacklist,
                          outdir=outdir,
                          outname=outname)
    return myparams
Esempio n. 3
0
def configure():
    EQcoords = [-125.134, 40.829]
    # The March 10, 2014 M6.8 earthquake
    EQtime = dt.datetime.strptime("20140310", "%Y%m%d")
    radius = 125
    # km.
    stations, distances = stations_within_radius.get_stations_within_radius(
        EQcoords, radius)
    blacklist = ["P316", "P170", "P158", "TRND"]
    stations_new = []
    distances_new = []
    for i in range(len(stations)):
        if stations[i] not in blacklist:
            stations_new.append(stations[i])
            distances_new.append(distances[i])
    return [stations_new, distances_new, EQtime]
def configure():
    # center=[-125.134, 40.829]; expname='Mend'; radius = 120; # Keeper for the 2014 earthquake
    # center=[-125.134, 40.829]; expname='Mend'; radius = 90; #
    # center=[-124, 40.5]; expname='Humboldt'; radius = 60; #
    # center=[-122.5, 40.5]; expname='Chico'; radius = 75; #
    # center=[-124.0, 38.0];     expname='Nbay'; radius = 125;
    # center=[-119.0, 34.5];     expname='SoCal';  radius = 25; # km
    # center=[-116.0, 34.5];     expname='Mojave';  radius = 35; # km
    # center=[-117.5, 35.5];     expname='ECSZ';  radius = 50; # km
    # center=[-119.0, 37.7];     expname='LVC';  radius = 30; # km
    center = [-115.5, 32.85]
    expname = 'SSGF'
    radius = 30
    # center=[-115.5, 33]; expname='SSGF'; radius = 40;

    proc_center = 'cwu'
    # WHICH DATASTREAM DO YOU WANT?
    refframe = 'NA'
    # WHICH REFERENCE FRAME?

    stations, lons, lats, distances = stations_within_radius.get_stations_within_radius(
        center, radius, network=proc_center)
    blacklist = [
        "P316", "P170", "P158", "TRND", "P203", "BBDM", "KBRC", "RYAN", "BEAT",
        "CAEC", "MEXI", "BOMG", "FSHB"
    ]
    # This is global, just keeps growing
    outdir = expname + "_" + proc_center
    subprocess.call(["mkdir", "-p", outdir], shell=False)
    outname = expname + "_" + str(center[0]) + "_" + str(
        center[1]) + "_" + str(radius)
    myparams = Parameters(expname=expname,
                          proc_center=proc_center,
                          refframe=refframe,
                          center=center,
                          radius=radius,
                          stations=stations,
                          distances=distances,
                          blacklist=blacklist,
                          outdir=outdir,
                          outname=outname)
    return myparams
Esempio n. 5
0
def configure(EQcoords,
              fit_type,
              overall_size,
              network,
              refframe,
              station_list=()):
    outdir = network + "_" + fit_type + "_" + refframe
    subprocess.call('mkdir -p ' + outdir, shell=True)
    if network == 'nldas' or network == 'gldas' or network == 'noah025' or network == 'lsdm':
        network = 'pbo'
        # This is just for finding which stations we will search for.

    time_after_start_date = 7
    # optionally, wait a while after the start day.
    critical_variance = 5
    # mm/yr. If the time series have a larger variance, we don't consider them

    map_coords = []
    if overall_size == 'medium':
        radius = 350
        # km.
    elif overall_size == 'huge':
        radius = -1
        # this is a special key for using a coordinate box instead of a radius
        map_coords = [-125.6, -110.0, 32.5, 48.5]
    else:
        radius = 150

    if len(station_list) > 0:
        stations = station_list
    else:
        # Getting the stations of interest ('huge' means we just want within the box.)
        if radius == -1:
            stations, _, _ = stations_within_radius.get_stations_within_box(
                map_coords, network)
        else:
            stations, _, _, _ = stations_within_radius.get_stations_within_radius(
                EQcoords, radius, map_coords, network)
        stations = gps_input_pipeline.remove_blacklist(stations)

    return [stations, outdir, time_after_start_date, critical_variance]
def configure(EQcoords, outfile_name, deltat1, deltat2, fit_type, overall_size,
              network):
    basename = outfile_name + "_" + fit_type
    dt1_start = dt.datetime.strptime(deltat1[0], "%Y%m%d")
    dt1_end = dt.datetime.strptime(deltat1[1], "%Y%m%d")
    dt2_start = dt.datetime.strptime(deltat2[0], "%Y%m%d")
    dt2_end = dt.datetime.strptime(deltat2[1], "%Y%m%d")

    if overall_size == 'medium':
        radius = 550
        # km.
        map_coords = [
            EQcoords[0] - 0.6, EQcoords[0] + 6, EQcoords[1] - 3.0,
            EQcoords[1] + 3.0
        ]
    elif overall_size == 'huge':
        radius = -1
        # this is a special key for using a coordinate box instead of a radius
        map_coords = [-125.6, -110.0, 32.5, 48.5]
    else:
        map_coords = [
            EQcoords[0] - 0.6, EQcoords[0] + 4, EQcoords[1] - 2.0,
            EQcoords[1] + 2.0
        ]
        radius = 330

    # Getting the stations of interest ('huge' means we just want within the box.)
    if radius == -1:
        stations = stations_within_radius.get_stations_within_box(
            map_coords, network)
    else:
        stations, _ = stations_within_radius.get_stations_within_radius(
            EQcoords, radius, map_coords, network)
    stations = gps_input_pipeline.remove_blacklist(stations)
    stations.append("CME6")
    ## A special thing for CME6, not within PBO fields and duplicated in UNR fields.
    return [
        stations, map_coords, dt1_start, dt1_end, dt2_start, dt2_end, basename
    ]
Esempio n. 7
0
#!/usr/bin/env python
"""
Example driver for the 'find within radius' functions
"""

import stations_within_radius

data_config_file = "/Users/kmaterna/Documents/B_Research/GEOPHYS_DATA/GPS_POS_DATA/config.txt"
center = [-122.0, 40.0]  # lon, lat
radius = 100
# km

stations, lon, lat, distances = stations_within_radius.get_stations_within_radius(
    data_config_file, center, radius, network='pbo')
print(stations)