# Logfile output
ASDF_log_out = join(ASDF_path_out, FDSNnetwork + '.log')


keys_list = []
info_list = []
station_name_counter = Counter()
station_name_paras = {}

# remove log file if it exists
if exists(ASDF_log_out):
    remove(ASDF_log_out)

# query the user to overwrite JSON database file or not
if exists(JSON_out):
    delete_queary = query_yes_no("Remove Existing JSON database file?")
    if delete_queary == 'yes':
        # removing existing SQLdb
        remove(JSON_out)
    elif delete_queary == 'no':
        sys.exit(0)

# query the user to overwrite the ASDF database or not
if exists(ASDF_out):
    delete_queary = query_yes_no("Remove Existing ASDF File?")
    if delete_queary == 'yes':
        # removing existing ASDF
        remove(ASDF_out)
    elif delete_queary == 'no':
        sys.exit(0)
示例#2
0
        # Now make the plot single station button active
        # add the stations and to menu dropdown
        plot_stns_menu = QtGui.QMenu()

        for _i, station in enumerate(stn_list):
            plot_stns_menu.addAction(
                station,
                functools.partial(self.plot_single_stn_selected,
                                  self.plot_single_stn_button, station))

        self.plot_single_stn_button.setMenu(plot_stns_menu)
        self.plot_single_stn_button.setEnabled(True)


if __name__ == '__main__':
    proxy_queary = query_yes_no("Input Proxy Settings?")

    if proxy_queary == 'yes':
        print('')
        proxy = raw_input("Proxy:")
        port = raw_input("Proxy Port:")
        try:
            networkProxy = QtNetwork.QNetworkProxy(
                QtNetwork.QNetworkProxy.HttpProxy, proxy, int(port))
            QtNetwork.QNetworkProxy.setApplicationProxy(networkProxy)
        except ValueError:
            print('No proxy settings supplied..')
            sys.exit()

    app = QtGui.QApplication([])
    w = MainWindow()
decode_str = 'java -jar {0} -x -so "Geoscience Australia AusArray" -o {1} {2}'.format(seed_xml_conv_path, xml_out, xseed_file)

# decode the dataless seed file
subprocess.call(decode_str, shell=True)

# open up the recently created xml file
station_inv = read_inventory(xml_out)

network_code = station_inv[0].code
station_code = station_inv[0][0].code


print "Network Code: ", network_code
print "Station Code: ", station_code

copy_query = query_yes_no("Copy Data for " + network_code+"."+station_code + "?")

if copy_query == 'no':
    sys.exit(0)

# create directory for station
station_path = join(service_path, network_code+"_"+station_code)

if not os.path.exists(station_path):
    os.mkdir(station_path)

# copy over files
data_contents = glob.glob(join(sd_card, '*.*'))

for data_file in data_contents:
    shutil.copy(data_file, station_path)