# Path: apasvo/_version.py

# 
# Path: apasvo/utils/clt.py
# def float_secs_2_string_date(x, starttime=datetime.datetime.utcfromtimestamp(0)):
# def print_msg(msg):
# def query_yes_no_all_quit(question, default="yes"):
# def query_custom_answers(question, answers, default=None):
#     def __init__(self, name, data, align=ALIGN.RIGHT, fmt='%.6g'):
#     def __init__(self, *columns):
#     def get_row(self, i=None):
#     def get_line(self):
#     def join_n_wrap(self, char, elements):
#     def get_rows(self):
#     def __str__(self):
#     def __init__(self, minValue=0, maxValue=100, totalWidth=12):
#     def updateAmount(self, newAmount=0):
#     def __str__(self):
# class ALIGN:
# class Column():
# class Table:
# class ProgressBar:
#     LEFT, RIGHT = '-', ''
# 
# Path: apasvo/utils/parse.py
# def filein(arg):
# def positive_float(arg):
# def positive_int(arg):
# def non_negative_int(arg):
# def percentile(arg):
# def fraction(arg):
#     def __call__(self, parser, namespace, values, option_string=None):
#     def _fopen(self, fname):
#     def __init__(self, *args, **kwargs):
#     def convert_arg_line_to_args(self, line):
# class GlobInputFilenames(argparse.Action):
# class CustomArgumentParser(argparse.ArgumentParser):
# 
# Path: apasvo/utils/futils.py
# def istextfile(filename, blocksize=512):
# def is_little_endian():
# def read_in_chunks(file_object, chunk_size=1024):
# def read_txt_in_chunks(file_object, n=1024, comments='#'):
# def getSize(f):
# def get_delimiter(fileobject, lines=16):
# def get_sample_rate(filename, max_header_lines=64, comments='#'):
# def copytree(src, dst, symlinks=False, ignore=None):
# 
# Path: apasvo/utils/formats/rawfile.py
# class RawFile(object):
# class BinFile(RawFile):
# class TextFile(RawFile):
#     def __init__(self):
#     def read(self):
#     def read_in_blocks(self, block_size):
#     def write(self, array):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
# def get_file_handler(filename, fmt='', dtype='float64', byteorder='native', **kwargs):
# 
# Path: apasvo/picking/eqgenerator.py
# def gutenberg_richter(b=1.0, size=1, m_min=2.0, m_max=None):
# def generate_artificial_earthquake(tmax, t0, fs, P_signal_db, P_noise_db,
#                                    bfirls=None, low_period=50., high_period=10.,
#                                    bandwidth=4., overlap=1., f_low=2.,
#                                    f_high=18., low_amp=.2, high_amp=.1):
# def generate_seismic_earthquake(tmax, t0, fs, P_signal_db, low_period,
#                                    high_period, bandwidth, overlap,
#                                    f_low, f_high, low_amp, high_amp):
# def generate_seismic_noise(tmax, fs, P_noise_db, bfirls=None):
#     def __init__(self, bfirls=None, fs=50.0, P_noise_db=0.0,
#                  low_period=50.0, high_period=10.0, bandwidth=4.0,
#                  overlap=1.0, f_low=2.0, f_high=18.0,
#                  low_amp=0.2, high_amp=0.1, **kwargs):
#     def load_noise_coefficients(self, fileobj, dtype='float64',
#                                 byteorder='native'):
#     def generate_events(self, t_average, t_max, b=1.0,
#                                m_min=2.0, m_max=7.0):
#     def generate_nevents(self, t_average, event_n, b=1.0,
#                                m_min=2.0, m_max=7.0):
#     def generate_earthquake(self, t_max, t0, p_eq):
#     def generate_noise(self, eq):
#     L = int(tmax * fs) + 1
#     L = int(tmax * fs) + 1
# class EarthquakeGenerator(object):


import argparse
import os
import sys
from apasvo._version import __version__
from apasvo.utils import clt, parse, futils
from apasvo.utils.formats import rawfile
from apasvo.picking import eqgenerator
    text file named 'settings.txt'
    Saves them to 'eq00.txt', ..., 'eq29.txt', plain text format.

    Rendered signals has the following characteristics:

        Earthquake power: 10.0 dB.
        Noise power: 0.0 dB.
        FIR filter coefficients: 'coeffs.txt'
        Length: 1200 seconds.
        Arrival time: 250.0 seconds.

    So, the following is the content of 'settings.txt':

    >> cat settings.txt
    -ep 10.0
    -np 0.0
    -fir coeffs.txt
    -l 1200
    -t 250
    '''
    try:
        # Setup argument parser
        parser = parse.CustomArgumentParser(description=program_description,
                                            epilog=program_examples,
                                formatter_class=argparse.RawDescriptionHelpFormatter,
                                fromfile_prefix_chars='@')
        parser.add_argument('-V', '--version', action='version',
                            version=program_version_message)
        parser.set_defaults(func=generate)
        parser.add_argument("FILEIN", nargs='*',

# Path: apasvo/_version.py

# 
# Path: apasvo/utils/clt.py
# def float_secs_2_string_date(x, starttime=datetime.datetime.utcfromtimestamp(0)):
# def print_msg(msg):
# def query_yes_no_all_quit(question, default="yes"):
# def query_custom_answers(question, answers, default=None):
#     def __init__(self, name, data, align=ALIGN.RIGHT, fmt='%.6g'):
#     def __init__(self, *columns):
#     def get_row(self, i=None):
#     def get_line(self):
#     def join_n_wrap(self, char, elements):
#     def get_rows(self):
#     def __str__(self):
#     def __init__(self, minValue=0, maxValue=100, totalWidth=12):
#     def updateAmount(self, newAmount=0):
#     def __str__(self):
# class ALIGN:
# class Column():
# class Table:
# class ProgressBar:
#     LEFT, RIGHT = '-', ''
# 
# Path: apasvo/utils/parse.py
# def filein(arg):
# def positive_float(arg):
# def positive_int(arg):
# def non_negative_int(arg):
# def percentile(arg):
# def fraction(arg):
#     def __call__(self, parser, namespace, values, option_string=None):
#     def _fopen(self, fname):
#     def __init__(self, *args, **kwargs):
#     def convert_arg_line_to_args(self, line):
# class GlobInputFilenames(argparse.Action):
# class CustomArgumentParser(argparse.ArgumentParser):
# 
# Path: apasvo/utils/futils.py
# def istextfile(filename, blocksize=512):
# def is_little_endian():
# def read_in_chunks(file_object, chunk_size=1024):
# def read_txt_in_chunks(file_object, n=1024, comments='#'):
# def getSize(f):
# def get_delimiter(fileobject, lines=16):
# def get_sample_rate(filename, max_header_lines=64, comments='#'):
# def copytree(src, dst, symlinks=False, ignore=None):
# 
# Path: apasvo/utils/formats/rawfile.py
# class RawFile(object):
# class BinFile(RawFile):
# class TextFile(RawFile):
#     def __init__(self):
#     def read(self):
#     def read_in_blocks(self, block_size):
#     def write(self, array):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
#     def __init__(self, filename, dtype='float64', byteorder='native'):
#     def read(self, **kwargs):
#     def read_in_blocks(self, block_size=1024):
#     def write(self, array, **kwargs):
# def get_file_handler(filename, fmt='', dtype='float64', byteorder='native', **kwargs):
# 
# Path: apasvo/picking/eqgenerator.py
# def gutenberg_richter(b=1.0, size=1, m_min=2.0, m_max=None):
# def generate_artificial_earthquake(tmax, t0, fs, P_signal_db, P_noise_db,
#                                    bfirls=None, low_period=50., high_period=10.,
#                                    bandwidth=4., overlap=1., f_low=2.,
#                                    f_high=18., low_amp=.2, high_amp=.1):
# def generate_seismic_earthquake(tmax, t0, fs, P_signal_db, low_period,
#                                    high_period, bandwidth, overlap,
#                                    f_low, f_high, low_amp, high_amp):
# def generate_seismic_noise(tmax, fs, P_noise_db, bfirls=None):
#     def __init__(self, bfirls=None, fs=50.0, P_noise_db=0.0,
#                  low_period=50.0, high_period=10.0, bandwidth=4.0,
#                  overlap=1.0, f_low=2.0, f_high=18.0,
#                  low_amp=0.2, high_amp=0.1, **kwargs):
#     def load_noise_coefficients(self, fileobj, dtype='float64',
#                                 byteorder='native'):
#     def generate_events(self, t_average, t_max, b=1.0,
#                                m_min=2.0, m_max=7.0):
#     def generate_nevents(self, t_average, event_n, b=1.0,
#                                m_min=2.0, m_max=7.0):
#     def generate_earthquake(self, t_max, t0, p_eq):
#     def generate_noise(self, eq):
#     L = int(tmax * fs) + 1
#     L = int(tmax * fs) + 1
# class EarthquakeGenerator(object):


# Path: bin/apasvo-generator.py
import argparse
import os
import sys
from apasvo._version import __version__
from apasvo.utils import clt, parse, futils
from apasvo.utils.formats import rawfile
from apasvo.picking import eqgenerator

    text file named 'settings.txt'
    Saves them to 'eq00.txt', ..., 'eq29.txt', plain text format.

    Rendered signals has the following characteristics:

        Earthquake power: 10.0 dB.
        Noise power: 0.0 dB.
        FIR filter coefficients: 'coeffs.txt'
        Length: 1200 seconds.
        Arrival time: 250.0 seconds.

    So, the following is the content of 'settings.txt':

    >> cat settings.txt
    -ep 10.0
    -np 0.0
    -fir coeffs.txt
    -l 1200
    -t 250
    '''
    try:
        # Setup argument parser
        parser = parse.CustomArgumentParser(description=program_description,
                                            epilog=program_examples,
                                formatter_class=argparse.RawDescriptionHelpFormatter,
                                fromfile_prefix_chars='@')
        parser.add_argument('-V', '--version', action='version',
                            version=program_version_message)
        parser.set_defaults(func=generate)
        parser.add_argument("FILEIN", nargs='*',

                            action=parse.GlobInputFilenames,