Esempio n. 1
0
def main():
    parser = weakargs.stdparse('Decode phase-shift WWVB.')
    parser.add_argument("-center", metavar='Hz', default=1000.0, type=float)
    parser.add_argument("-file")
    args = weakargs.parse_args(parser)

    if args.cat != None:
        cat = weakcat.open(args.cat)
        cat.set_usb_data()
        cat.setf(0, 59000)

    if (args.card == None) == (args.file == None):
        parser.error("one of -card and -file are required")

    if args.file != None:
        r = WWVB()
        r.center = args.center
        r.gowav(args.file, 0)
        sys.exit(0)

    if args.card != None:
        r = WWVB()
        r.center = args.center
        r.opencard(args.card)
        r.gocard()
        sys.exit(0)

    parser.error("one of -card, -file, or -levels is required")

    sys.exit(1)
Esempio n. 2
0
def main():
  parser = weakargs.stdparse('Decode phase-shift WWVB.')
  parser.add_argument("-center", metavar='Hz', default=1000.0, type=float)
  parser.add_argument("-file")
  args = weakargs.parse_args(parser)

  if args.cat != None:
    cat = weakcat.open(args.cat)
    cat.set_usb_data()
    cat.setf(0, 59000)

  if (args.card == None) == (args.file == None):
    parser.error("one of -card and -file are required")

  if args.file != None:
    r = WWVB()
    r.center = args.center
    r.gowav(args.file, 0)
    sys.exit(0)

  if args.card != None:
    r = WWVB()
    r.center = args.center
    r.opencard(args.card)
    r.gocard()
    sys.exit(0)

  parser.error("one of -card, -file, or -levels is required")

  sys.exit(1)
Esempio n. 3
0
def main():
    parser = weakargs.stdparse('Decode JT65A.')
    parser.add_argument("-band")

    args = weakargs.parse_args(parser)
        
    if args.card == None:
        parser.error("jt65mon requires -card")
      
    if args.cat == None and args.band == None:
        parser.error("jt65mon needs either -cat or -band")

    jt65mon = JT65Mon(args.card, args.card2, args.cat, args.band)
    jt65mon.verbose = args.v
    jt65mon.go()
    jt65mon.close()
    sys.exit(0)
Esempio n. 4
0
def main():
    parser = weakargs.stdparse('Decode WSPR.')
    parser.add_argument("-band")
    args = weakargs.parse_args(parser)

    if args.card == None:
        parser.error("wsprmon requires -card")

    if args.cat == None and args.band == None:
        parser.error("wsprmon needs either -cat or -band")

    w = WSPRMon(args.card, args.cat, args.band)
    w.verbose = args.v
    w.start()
    w.go()
    w.close()

    sys.exit(0)
Esempio n. 5
0
def main():
    parser = weakargs.stdparse('Decode JT65A.')
    parser.add_argument("-band")
    parser.add_argument("-card2", nargs=2, metavar=('CARD', 'CHAN'))

    args = weakargs.parse_args(parser)
        
    if args.card == None:
        parser.error("jt65mon requires -card")
      
    if args.cat == None and args.band == None:
        parser.error("jt65mon needs either -cat or -band")

    jt65mon = JT65Mon(args.card, args.card2, args.cat, args.band)
    jt65mon.verbose = args.v
    jt65mon.go()
    jt65mon.close()
    sys.exit(0)
Esempio n. 6
0
def main():
    parser = weakargs.stdparse('Decode APRS.')
    args = weakargs.parse_args(parser)
    
    if args.cat != None:
        cat = weakcat.open(args.cat)
        cat.set_fm_data()
        # cat.sdr.setgain(0)
        cat.setf(0, 144390000)

    if args.card == None:
        parser.error("aprsmon requires -card")

    ar = aprsrecv.APRSRecv()
    ar.callback = cb
    ar.opencard(args.card)
    ar.gocard()

    sys.exit(0)
Esempio n. 7
0
def main():
    if False:
        optimize()
        sys.exit(0)

    if False:
        total = 0
        total += onebench("wwvx2.wav", 2017, 41, 20, 55, 18, True)
        total += onebench("wwvx3.wav", 2017, 41, 21, 17, 60, True)
        total += onebench("wwvx4.wav", 2017, 41, 22, 25, 92, True)
        total += onebench("wwvx7.wav", 2017, 43, 21, 18, 50, True)
        total += onebench("wwvx8.wav", 2017, 43, 22, 15, 72, True)
        total += onebench("wwvx9.wav", 2017, 43, 23, 33, 51, True)
        total += onebench("wwvx10.wav", 2017, 44, 9, 19, 54, True)
        print("%d total" % (total))
        sys.exit(0)

    parser = weakargs.stdparse('Decode WWV.')
    parser.add_argument("-file")
    args = weakargs.parse_args(parser)

    if (args.card == None) == (args.file == None):
        parser.error("one of -card and -file are required")

    if args.file != None:
        r = WWV()
        r.gofile(args.file, True)
        sys.exit(0)

    if args.card != None:
        if args.cat != None:
            hz = 15000000
            cat = weakcat.open(args.cat)
            cat.setf(0, hz)
            print("Frequency set to %.1f MHz" % (hz / 1000000.0))
        r = WWV()
        r.opencard(args.card)
        r.gocard()
        sys.exit(0)

    parser.error("one of -card, -file, or -levels is required")
    sys.exit(1)
Esempio n. 8
0
def main():
    if False:
        optimize()
        sys.exit(0)

    if False:
        total = 0
        total += onebench("wwvx2.wav", 2017, 41, 20, 55, 18, True)
        total += onebench("wwvx3.wav", 2017, 41, 21, 17, 60, True)
        total += onebench("wwvx4.wav", 2017, 41, 22, 25, 92, True)
        total += onebench("wwvx7.wav", 2017, 43, 21, 18, 50, True)
        total += onebench("wwvx8.wav", 2017, 43, 22, 15, 72, True)
        total += onebench("wwvx9.wav", 2017, 43, 23, 33, 51, True)
        total += onebench("wwvx10.wav", 2017, 44, 9, 19, 54, True)
        print("%d total" % (total))
        sys.exit(0)

    parser = weakargs.stdparse('Decode WWV.')
    parser.add_argument("-file")
    args = weakargs.parse_args(parser)

    if (args.card == None) == (args.file == None):
        parser.error("one of -card and -file are required")

    if args.file != None:
        r = WWV()
        r.gofile(args.file, True)
        sys.exit(0)

    if args.card != None:
        r = WWV()
        r.opencard(args.card)
        r.gocard()
        sys.exit(0)

    parser.error("one of -card, -file, or -levels is required")
    sys.exit(1)
Esempio n. 9
0
def driver_main(progname, recv_class, send_class, frequencies, auto_bands,
                logfileprefix, logmode):
    parser = weakargs.stdparse(progname)
    parser.add_argument("-band")
    parser.add_argument("-bands")
    parser.add_argument("-out", metavar="CARD")
    parser.add_argument("-test", action='store_true')
    args = weakargs.parse_args(parser)

    cards = [ 
        args.card,
        args.card2,
        args.card3,
        args.card4,
    ]
    cats = [ 
        args.cat,
        args.cat2,
        args.cat3,
        args.cat4,
    ]

    while len(cards) > 0 and cards[-1] == None and cats[-1] == None:
        cards = cards[0:-1]
        cats = cats[0:-1]

    for i in range(0, len(cats)):
        if cats[i] != None and cards[i] == None:
            if i == 0:
                parser.error("-cat but no -card")
            else:
                parser.error("-cat%d but no -card%d" % (i+1, i+1))

    for i in range(1, len(cards)):
        if cards[i] != None and cards[i-1] == None:
            if i == 1:
                parser.error("-card%d but missing -card" % (i+1))
            else:
                parser.error("-card%d but missing -card%d" % (i+1, i))

    if args.band != None and not args.band in frequencies:
        parser.error("band %s not recognized" % (args.band))

    if args.test:
        if args.out == None:
            parser.error("-test requires -out")
        dr = Driver(progname, recv_class, send_class,
                    frequencies, auto_bands,
                    logfileprefix, logmode,
                    args.out, cards, cats, args.band)
        dr.test_send()
        sys.exit(0)
        
    if args.card == None:
        parser.error("%s requires -card" % (progname))
      
    if args.band == None:
        for i in range(0, len(cards)):
            if cards[i] != None and cats[i] == None:
                if i == 0:
                    parser.error("%s needs either -cat or -band" % (progname))
                else:
                    parser.error("%s needs either -cat%d or -band" % (progname, i + 1))

    # -band "40 30 20"
    # overrides the list of bands among which to automatically switch.
    if args.bands != None:
        bands = args.bands.strip()
        bands = re.sub(r'  *', ' ', bands)
        a = bands.split(" ")
        for band in a:
            if not band in frequencies:
                parser.error("band %s not recognized" % (band))
        auto_bands = a

    dr = Driver(progname, recv_class, send_class,
                frequencies, auto_bands,
                logfileprefix, logmode,
                args.out, cards, cats, args.band)

    dr.go()
    dr.close()
    sys.exit(0)