# 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 thrifty import matchmaker
from thrifty import toads_data
    parser = argparse.ArgumentParser(description=__doc__,
                                     formatter_class=formatter)

    parser.add_argument('toads', nargs='?',
                        type=argparse.FileType('rb'), default='data.toads',
                        help="toads data (\"-\" streams from stdin)")
    parser.add_argument('matches', nargs='?',
                        type=argparse.FileType('rb'), default='data.match',
                        help="toads data (\"-\" streams from stdin)")
    parser.add_argument('--beacon', type=int, default=0,
                        help="transmitter ID of beacon")
    parser.add_argument('--rx0', type=int, default=0,
                        help="receiver ID of first receiver")
    parser.add_argument('--rx1', type=int, default=1,
                        help="receiver ID of second receiver")
    parser.add_argument('--range', type=parse_range, default=None,
                        help="limit to a range of detection IDs")
    parser.add_argument('--deg', type=int, default=2,
                        help="degree of polynomial to fit through the SOAs")
    parser.add_argument('--export', type=str, nargs='?',
                        const=True,
                        help="export plot to a .PDF file")

    args = parser.parse_args()

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

    all_matches = matchmaker.load_matches(args.matches)


# 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: thrifty/beacon_analysis.py
import numpy as np
import matplotlib.pyplot as plt
    import argparse
from thrifty import matchmaker
from thrifty import toads_data

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

    parser.add_argument('toads', nargs='?',
                        type=argparse.FileType('rb'), default='data.toads',
                        help="toads data (\"-\" streams from stdin)")
    parser.add_argument('matches', nargs='?',
                        type=argparse.FileType('rb'), default='data.match',
                        help="toads data (\"-\" streams from stdin)")
    parser.add_argument('--beacon', type=int, default=0,
                        help="transmitter ID of beacon")
    parser.add_argument('--rx0', type=int, default=0,
                        help="receiver ID of first receiver")
    parser.add_argument('--rx1', type=int, default=1,
                        help="receiver ID of second receiver")
    parser.add_argument('--range', type=parse_range, default=None,
                        help="limit to a range of detection IDs")
    parser.add_argument('--deg', type=int, default=2,
                        help="degree of polynomial to fit through the SOAs")
    parser.add_argument('--export', type=str, nargs='?',
                        const=True,
                        help="export plot to a .PDF file")

    args = parser.parse_args()

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

    all_matches = matchmaker.load_matches(args.matches)


    matches = matchmaker.extract_match_matrix(toads, all_matches,