f'\n\tpython ntk_computePSD.py net=TA sta=O18A loc=DASH start=2008-08-14T12:00:00 end=2008-08-14T13:30:00' f'\n\n\tyou can perform binning via:' f'\n\tpython {script} net=TA sta=O18A loc=DASH chan=BHZ start=2008-08-14T12:00:00 end=2008-08-14T13:30:00 ' f'xtype=period ' f'\n\n\n\n') # Get the run arguments. args = utils_lib.get_args(sys.argv, usage) if not args: usage() sys.exit(0) # Import the user-provided parameter file. The parameter file is under the param directory at the same level # as the script directory. param_file = utils_lib.get_param(args, 'param', default_param_file, usage) if param_file is None: usage() code = msg_lib.error(f' parameter file is required', 2) sys.exit(code) # Import the parameter file if it exists. if os.path.isfile(os.path.join(param_path, f'{param_file}.py')): param = importlib.import_module(param_file) else: usage() code = msg_lib.error(f'bad parameter file name [{param_file}]', 2) sys.exit(code) network = utils_lib.get_param(args, 'net', None, usage)
f'\n\n\t- reads data from files by changing the client (make sure data files exist) and gets the ' f'response from IRIS (to read responses from files, set fromFileOnly parameter to True' f'\n\tpython {script} net=TA sta=W5 loc=DASH start=2014-03-17T04:30:00 end=2014-03-17T05:30:00 type=period ' f'client=FILES plot=1' f'\n\n\n\n') # Get the run arguments. args = utils_lib.get_args(sys.argv, usage) if not args: usage() sys.exit(0) # Import the user-provided parameter file. The parameter file is under the param directory at the same level # as the script directory. param_file = utils_lib.get_param(args, 'param', default_param_file, usage) if param_file is None: usage() code = msg_lib.error(f' parameter file is required', 2) sys.exit(code) # Import the parameter file if it exists. if os.path.isfile(os.path.join(param_path, f'{param_file}.py')): param = importlib.import_module(param_file) else: usage() code = msg_lib.error(f'bad parameter file name [{param_file}]', 2) sys.exit(code) # Run parameters.
f'\n\n\t- usage:' f'\n\tpython {script}' f'\n\n\t- assuming that you have already "successfully" computed power via:' f'\n\tpython ntk_computePower.py param=computePower net=TA sta=O18A loc=DASH chan=BHZ xtype=period verbose=1 ' f'file=TA.O18A.--.BHZ.2008-08-14.2008-08-14.period.txt' f'\n\n\tthen, compute median power "successfully" via:' f'\n\tpython {script} param={default_param_file} net=TA sta=O18A loc=DASH chan=BHZ xtype=period verbose=0 ' f'win=12 start=2008-08-14T00:00:00 end=2008-08-14T23:00:00 ' f'file=TA.O18A.--.BHZ.2008-08-14.2008-08-14.txt' f'\n\n\n\n') # See if user has provided the run arguments. args = utils_lib.get_args(sys.argv, usage) param_file = utils_lib.get_param(args, 'param', default_param_file, usage) # Check and see if the param file exists. if os.path.isfile(os.path.join(param_path, param_file + ".py")): sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'param')) param = importlib.import_module(param_file) else: msg_lib.error(f'bad parameter file name {param_file}', 2) usage() sys.exit() verbose = utils_lib.get_param(args, 'verbose', False, usage) if verbose: msg_lib.info(f'script: {script} {len(sys.argv) - 1} args: {sys.argv}')
f'\n\n\t-usage:' f'\n\tpython {script}' f'\n\n\t- assuming that you already have executed the following command "successfully" to generate ' f'polarization files:' f'\n\tpython ntk_computePolarization.py net=NM sta=SLM loc=DASH ' f'start=2009-01-01T01:00:00 end=2009-01-01T03:00:00 xtype=frequency verbose=0' f'\n\n\tyou can bin the polarization parameters into daily files: ' f'\n\tpython {script} param={default_param_file} net=NM sta=SLM loc=DASH ' f'start=2009-01-01T01:00:00 end=2009-01-01T03:00:00 xtype=frequency verbose=0' f'\n\n\n\n') # See if user has provided the run arguments. args = utils_lib.get_args(sys.argv, usage) param_file = utils_lib.get_param(args, 'param', default_param_file, usage) # Check and see if the param file exists. if os.path.isfile(os.path.join(param_path, param_file + ".py")): sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'param')) param = importlib.import_module(param_file) else: usage() msg_lib.error(f'bad parameter file name {param_file}', 2) sys.exit() channel_directory = utils_lib.get_param( args, 'chandir', utils_lib.param(param, 'chanDir').chanDir, usage) verbose = utils_lib.get_param(args, 'verbose', False, usage)
f'file=NM.SLM.--.BHZ.2009-03-01.2009-03-31.period.txt verbose=0' f'\n\t\t 4) Compute 12-hour median power using the power file generated at step 3 above:' f' \n\t\t\tpython ntk_medianPower.py param=medianPower net=NM sta=SLM loc=DASH chan=BHZ ' f'start=2009-03-01T00:00:00 end=2009-03-31T00:00:00 xtype=period win=12 ' f'file=NM.SLM.--.BHZ.2009-03-01.2009-03-31.txt verbose=0' f'\n\n\tNow, plot the Secondary Microseism, SM :' f'\n\t\tpython {script} param={default_param_file} param=plotPower net=NM sta=SLM loc=DASH chan=BHZ ' f'start=2009-03-01T00:00:00 end=2009-03-31T00:00:00 win=12 bin=SM ' f'file=NM.SLM.--.BHZ.2009-03-01.2009-03-31.12h.txt ymax=0.06 bin=SM' f'\n\n\n\n') # See if user has provided the run arguments. args = utils_lib.get_args(sys.argv, usage) param_file = utils_lib.get_param(args, 'param', default_param_file, usage) # Check and see if the param file exists. if os.path.isfile(os.path.join(param_path, param_file + ".py")): sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'param')) param = importlib.import_module(param_file) else: msg_lib.error(f'bad parameter file name {param_file}', 2) usage() sys.exit() verbose = utils_lib.get_param(args, 'verbose', False, usage) if verbose: msg_lib.info(f'script: {script} {len(sys.argv) - 1} args: {sys.argv}')