Ejemplo n.º 1
0
def run_tests(fl):
  # Set the pressure
  meters = fl * 1E2 * altitude.meter_per_foot
  pres = altitude.altitude_to_pressure(meters) / 1E3
  print "    Setting pressure to %.3f kPa (FL%03.0f)" % (pres, fl)
  ppc.wait_pressure(pres, stable=args.settle_altitude, \
    timeout=args.settle_timeout, volume=args.volume)
  # Sweep Temperature
  for temp_idx in range(args.count_temperature):
    # Set temperature on device
    temp = temp_idx * temp_step + args.min_temperature
    print "      Setting Temperature to %g" % temp
    for unit in units:
      unit.temp(temp)
    # Wait for stabilization
    sleep(args.settle_temperature)
    # Make the measurements
    print "        Taking measurements"
    for unit in units:
      pres = ppc.status()
      unit.measure(*pres)
  # Return temperature to minimum so it can cool during pressure change
  if args.count_temperature > 1:
    print "      Resetting Temperature to %g" % args.min_temperature
    for unit in units:
      unit.temp(args.min_temperature)
Ejemplo n.º 2
0
def run_test(fl):
    # Set the pressure
    meters = fl * 1E2 * altitude.meter_per_foot
    pres = altitude.altitude_to_pressure(meters) / 1E3
    print "Setting pressure to %.3f kPa (FL%03.0f)" % (pres, fl)
    ppc.wait_pressure(pres, stable=args.settle, timeout=600.0)
    # Take the measurements
    print "  Taking measurements"
    ts0 = datetime.now().isoformat()
    premeasure = ppc.status()
    ts1 = datetime.now().isoformat()
    sbmap = sb.query()
    local = tom.vars()
    ts2 = datetime.now().isoformat()
    postmeasure = ppc.status()
    ts3 = datetime.now().isoformat()
    # Commit to logfile
    logfile.write('%s,' % ts0)
    logfile.write('%d,%f,%f,%f,%d,%f,' % premeasure)
    logfile.write('%s,' % ts1)
    for var in sbvars:
        try:
            logfile.write('%s,' % sbmap[var][1])
        except KeyError:
            logfile.write('UNK,')
    for var in lclvar:
        try:
            logfile.write('%s,' % local[var])
        except KeyError:
            logfile.write('UNK,')
    logfile.write('%s,' % ts2)
    logfile.write('%d,%f,%f,%f,%d,%f,' % postmeasure)
    logfile.write('%s\n' % ts3)
    logfile.flush()
Ejemplo n.º 3
0
def run_test(fl):
    # Set the pressure
    meters = fl * 1E2 * altitude.meter_per_foot
    pres = altitude.altitude_to_pressure(meters) / 1E3
    print "Setting pressure to %.3f kPa (FL%03.0f)" % (pres, fl)
    ppc.wait_pressure(pres, stable=args.settle, timeout=600.0)
    # Take the measurements
    print "  Taking measurements"
    ts0 = datetime.now().isoformat()
    premeasure = ppc.status()
    ts1 = datetime.now().isoformat()
    sbmap = sb.query()
    local = tom.vars()
    ts2 = datetime.now().isoformat()
    postmeasure = ppc.status()
    ts3 = datetime.now().isoformat()
    # Commit to logfile
    logfile.write('%s,' % ts0)
    logfile.write('%d,%f,%f,%f,%d,%f,' % premeasure)
    logfile.write('%s,' % ts1)
    for var in sbvars:
        try:
            logfile.write('%s,' % sbmap[var][1])
        except KeyError:
            logfile.write('UNK,')
    for var in lclvar:
        try:
            logfile.write('%s,' % local[var])
        except KeyError:
            logfile.write('UNK,')
    logfile.write('%s,' % ts2)
    logfile.write('%d,%f,%f,%f,%d,%f,' % postmeasure)
    logfile.write('%s\n' % ts3)
    logfile.flush()
Ejemplo n.º 4
0
def run_test(fl):
    # Set the pressure
    meters = fl * 1E2 * altitude.meter_per_foot
    pres = altitude.altitude_to_pressure(meters) / 1E3
    print "Setting pressure to %.3f kPa (FL%03.0f)" % (pres, fl)
    ppc.pressure(pres)
    # Wait for the pressure to settle
    print "  Waiting for Pressure to Settle"
    waitstart = datetime.now()
    ready = False
    while not ready:
        now = datetime.now()
        if not pcc.is_ready():
            waitstart = now
        elif (now - waitstart) >= settle:
            ready = True
    # Take the measurements
    for sample in range(args.count):
        print "  Taking measurement %d of %d" % (sample+1, args.count)
        ts0 = datetime.now().isoformat()
        ppcout = ppc.status()
        adcout = subprocess.check_output(['./read']).strip()
        ts1 = datetime.now().isoformat()
        # Commit to logfile
        logfile.write('%s,' % ts0)
        logfile.write('%d,%f,%f,%f,%d,%f,' % ppcout)
        logfile.write('%s,' % adcout)
        logfile.write('%s\n' % ts1)
        logfile.flush()
        # Delay between samples
        sleep(args.capture_delay)
Ejemplo n.º 5
0
def run_tests(fl):
    # Set the pressure
    meters = fl * 1e2 * altitude.meter_per_foot
    pres = altitude.altitude_to_pressure(meters) / 1e3
    print "  Setting pressure to %.3f kPa (FL%03.0f)" % (pres, fl)
    ppc.wait_pressure(pres)
    sleep(10.0)
    # Mesure a data point
    pres = ppc.status()
    gpio = aa_gpio_get(aardvark)
    out.write(datetime.now().isoformat())
    for v in pres:
        out.write(",%e" % v)
    out.write(",%d" % bool(~gpio & GPIO_NC))
    out.write(",%d" % bool(~gpio & GPIO_NO))
    out.write("\n")
    out.flush()
Ejemplo n.º 6
0
def run_tests(fl):
    # Set the pressure
    meters = fl * 1E2 * altitude.meter_per_foot
    pres = altitude.altitude_to_pressure(meters) / 1E3
    print "  Setting pressure to %.3f kPa (FL%03.0f)" % (pres, fl)
    ppc.wait_pressure(pres)
    sleep(10.0)
    # Mesure a data point
    pres = ppc.status()
    gpio = aa_gpio_get(aardvark)
    out.write(datetime.now().isoformat())
    for v in pres:
        out.write(',%e' % v)
    out.write(',%d' % bool(~gpio & GPIO_NC))
    out.write(',%d' % bool(~gpio & GPIO_NO))
    out.write('\n')
    out.flush()
Ejemplo n.º 7
0
def run_test(fl):
    # Set the pressure
    meters = fl * 1E2 * altitude.meter_per_foot
    pres = altitude.altitude_to_pressure(meters) / 1E3
    print "Setting pressure to %.3f kPa (FL%03.0f)" % (pres, fl)
    ppc.pressure(pres)
    # Wait for the pressure to settle
    print "  Waiting for Pressure to Settle"
    while not ppc.is_ready():
        while not ppc.is_ready():
            pass
        sleep(args.settle)
    # Take the measurements
    print "  Taking measurements"
    ts0 = datetime.now().isoformat()
    premeasure = ppc.status()
    ts1 = datetime.now().isoformat()
    sbmap = sb.query()
    ts2 = datetime.now().isoformat()
    aeromap = aero.measure()
    ts3 = datetime.now().isoformat()
    postmeasure = ppc.status()
    ts4 = datetime.now().isoformat()
    print "  Transponder tests: %s" % aeromap['overall']
    # Commit to logfile
    logfile.write('%s,' % ts0)
    logfile.write('%d,%f,%f,%f,%d,%f,' % premeasure)
    logfile.write('%s,' % ts1)
    for var in sbvars:
        try:
            logfile.write('%s,' % sbmap[var][1])
        except KeyError:
            logfile.write('UNK,')
    logfile.write('%s,' % ts2)
    for var in aerovars:
        try:
            logfile.write('%s,' % aeromap[var])
        except KeyError:
            logfile.write('UNK,')
    logfile.write('%s,' % ts3)
    logfile.write('%d,%f,%f,%f,%d,%f,' % postmeasure)
    logfile.write('%s\n' % ts4)
    logfile.flush()
Ejemplo n.º 8
0
def run_test(fl):
    # Set the pressure
    meters = fl * 1E2 * altitude.meter_per_foot
    pres = altitude.altitude_to_pressure(meters) / 1E3
    print "Setting pressure to %.3f kPa (FL%03.0f)" % (pres, fl)
    ppc.pressure(pres)
    # Wait for the pressure to settle
    print "  Waiting for Pressure to Settle"
    while not ppc.is_ready():
        while not ppc.is_ready():
            pass
        sleep(args.settle)
    # Take the measurements
    print "  Taking measurements"
    ts0 = datetime.now().isoformat()
    premeasure = ppc.status()
    ts1 = datetime.now().isoformat()
    sbmap = sb.query()
    ts2 = datetime.now().isoformat()
    aeromap = aero.measure()
    ts3 = datetime.now().isoformat()
    postmeasure = ppc.status()
    ts4 = datetime.now().isoformat()
    print "  Transponder tests: %s" % aeromap['overall']
    # Commit to logfile
    logfile.write('%s,' % ts0)
    logfile.write('%d,%f,%f,%f,%d,%f,' % premeasure)
    logfile.write('%s,' % ts1)
    for var in sbvars:
        try:
            logfile.write('%s,' % sbmap[var][1])
        except KeyError:
            logfile.write('UNK,')
    logfile.write('%s,' % ts2)
    for var in aerovars:
        try:
            logfile.write('%s,' % aeromap[var])
        except KeyError:
            logfile.write('UNK,')
    logfile.write('%s,' % ts3)
    logfile.write('%d,%f,%f,%f,%d,%f,' % postmeasure)
    logfile.write('%s\n' % ts4)
    logfile.flush()