# Path: thrifty/matchmaker.py
# def match_toads(toads, window, min_match=2):
# def load_matches(file_):
# def save_matches(matches, file_):
# def extract_match_matrix(detections, matches, rxids, txids=None):
# def _main():
# 
# Path: thrifty/toads_data.py
# class DetectionResult(object):
#     def __init__(self, timestamp, block, soa, carrier_info, corr_info,
#                  rxid=None, txid=None):
#     def serialize(self):
#     def deserialize(cls, string, with_rxid=False, with_txid=False):
# def _load_toads(stream, with_rxid=True, with_txid=True):
# def load_toad(stream):
# def load_toads(stream):
# def toads_array(detections, with_ids=True):


import numpy as np
import matplotlib.pyplot as plt
    import argparse
from matplotlib import gridspec
from statsmodels.nonparametric.smoothers_lowess import lowess
from thrifty import matchmaker
from thrifty import toads_data
        plt.xlabel('TX timestamp at RX0 (s)')
        plt.grid()

        plt.subplot(gs[1])
        plt.hist(cut * s2m, 20)
        plt.title("Histogram")

        plt.tight_layout()
        plt.subplots_adjust(top=0.90)
        plt.savefig(fig_prefix + '-cut{}.pdf'.format(i + 1), format='pdf')
        # plt.show()

    plt.show()


def _main():

    formatter = argparse.RawDescriptionHelpFormatter
    parser = argparse.ArgumentParser(description=__doc__,
                                     formatter_class=formatter)

    parser.add_argument('toads', nargs='?',
                        type=argparse.FileType('rb'), default='rx.toads',
                        help="toads data (\"-\" streams from stdin)")
    parser.add_argument('matches', nargs='?',
                        type=argparse.FileType('rb'), default='rx.match',
                        help="toads data (\"-\" streams from stdin)")
    args = parser.parse_args()

    toads = toads_data.load_toads(args.toads)

# Path: thrifty/matchmaker.py
# def match_toads(toads, window, min_match=2):
# def load_matches(file_):
# def save_matches(matches, file_):
# def extract_match_matrix(detections, matches, rxids, txids=None):
# def _main():
# 
# Path: thrifty/toads_data.py
# class DetectionResult(object):
#     def __init__(self, timestamp, block, soa, carrier_info, corr_info,
#                  rxid=None, txid=None):
#     def serialize(self):
#     def deserialize(cls, string, with_rxid=False, with_txid=False):
# def _load_toads(stream, with_rxid=True, with_txid=True):
# def load_toad(stream):
# def load_toads(stream):
# def toads_array(detections, with_ids=True):


# Path: scripts/reldist_nearest.py
import numpy as np
import matplotlib.pyplot as plt
    import argparse
from matplotlib import gridspec
from statsmodels.nonparametric.smoothers_lowess import lowess
from thrifty import matchmaker
from thrifty import toads_data

        plt.xlabel('TX timestamp at RX0 (s)')
        plt.grid()

        plt.subplot(gs[1])
        plt.hist(cut * s2m, 20)
        plt.title("Histogram")

        plt.tight_layout()
        plt.subplots_adjust(top=0.90)
        plt.savefig(fig_prefix + '-cut{}.pdf'.format(i + 1), format='pdf')
        # plt.show()

    plt.show()


def _main():

    formatter = argparse.RawDescriptionHelpFormatter
    parser = argparse.ArgumentParser(description=__doc__,
                                     formatter_class=formatter)

    parser.add_argument('toads', nargs='?',
                        type=argparse.FileType('rb'), default='rx.toads',
                        help="toads data (\"-\" streams from stdin)")
    parser.add_argument('matches', nargs='?',
                        type=argparse.FileType('rb'), default='rx.match',
                        help="toads data (\"-\" streams from stdin)")
    args = parser.parse_args()

    toads = toads_data.load_toads(args.toads)

    detections = toads_data.toads_array(toads, with_ids=True)