# 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
                                byteorder=byteorder)
            fout_handler.write(eq, header="Sample rate: %g Hz." % fs)
            clt.print_msg("Done\n")


def main(argv=None):
    '''Command line options.'''

    if argv is None:
        argv = sys.argv
    else:
        sys.argv.extend(argv)

    program_name = __import__('__main__').__doc__.split("\n")[0]
    program_version = "v%s" % __version__
    program_version_message = '%%(prog)s %s' % program_version
    program_description = '''
    %s %s

    A tool that generates synthetic seismic signals.

    Renders synthetic seismic data in two ways: If a list of input files
    containing seismic data is provided, the tool generates a new output
    signal for each one of them by adding background noise. If no input
    file is provided, it generates a list of synthetic seismic signals.

    Artificial earthquakes are generated at desired start point from
    white noise band-filtered and modulated by using different envelope
    functions for each band.
    Similarly, background noise is modeled from white noise and finally

# 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

                                byteorder=byteorder)
            fout_handler.write(eq, header="Sample rate: %g Hz." % fs)
            clt.print_msg("Done\n")


def main(argv=None):
    '''Command line options.'''

    if argv is None:
        argv = sys.argv
    else:
        sys.argv.extend(argv)

    program_name = __import__('__main__').__doc__.split("\n")[0]
    program_version = "v%s" % __version__
    program_version_message = '%%(prog)s %s' % program_version
    program_description = '''
    %s %s

    A tool that generates synthetic seismic signals.

    Renders synthetic seismic data in two ways: If a list of input files
    containing seismic data is provided, the tool generates a new output
    signal for each one of them by adding background noise. If no input
    file is provided, it generates a list of synthetic seismic signals.

    Artificial earthquakes are generated at desired start point from
    white noise band-filtered and modulated by using different envelope
    functions for each band.
    Similarly, background noise is modeled from white noise and finally

    added to the previously generated sequence that contains the synthetic