예제 #1
0
    print "using directory " + args.f
    for f in os.listdir(args.f):
        print "processing file " + f
        if f.endswith(".log"):
            print "ignoring file"
            continue
        fi = args.f.rstrip('/') + '/' + f

        # READ INPUT DATA FILE
        # --------------------
        this_run_time, this_run_x, this_run_y, this_run_d, this_run_d_err, this_run_t, this_run_h = read_data_file(fi, args.de, args.w)

        # CORRECT FOR NONLINEAR MOTION OF STAGES
        # --------------------------------------
        if args.nc:
            this_run_x, this_run_y = correct_stage_positions(F_CALX, F_CALY, this_run_x, this_run_y)

        # CORRECT FOR TEMPERATURE EXCURSIONS
        # ----------------------------------
        if args.nt:
            this_run_d = correct_for_temperature(F_CORT, this_run_d, this_run_t)

        TIME.append(np.asarray(this_run_time))
        x.append(np.mean(this_run_x))
        y.append(np.mean(this_run_y))
        d.append(np.mean(this_run_d))
        t.append(np.asarray(this_run_t))
        h.append(np.asarray(this_run_h))
        print
else:
    print "using file " + args.f
예제 #2
0
    for f in os.listdir(args.f):
        print "processing file " + f
        if f.endswith(".log"):
            print "ignoring file"
            continue
        fi = args.f.rstrip('/') + '/' + f

        # READ INPUT DATA FILE
        # --------------------
        this_run_time, this_run_x, this_run_y, this_run_d, this_run_d_err, this_run_t, this_run_h = read_data_file(
            fi, args.de, args.w)

        # CORRECT FOR NONLINEAR MOTION OF STAGES
        # --------------------------------------
        if args.nc:
            this_run_x, this_run_y = correct_stage_positions(
                F_CALX, F_CALY, this_run_x, this_run_y)

        # CORRECT FOR TEMPERATURE EXCURSIONS
        # ----------------------------------
        if args.nt:
            this_run_d = correct_for_temperature(F_CORT, this_run_d,
                                                 this_run_t)

        TIME.append(np.asarray(this_run_time))
        x.append(np.mean(this_run_x))
        y.append(np.mean(this_run_y))
        d.append(np.mean(this_run_d))
        t.append(np.asarray(this_run_t))
        h.append(np.asarray(this_run_h))
        print
else:
run_data_d = []
run_data_d_err = []
for f in os.listdir(args.f):
    print "processing file " + f
    if f.endswith(".log"):
        print "ignoring file"
        continue
    fi = args.f.rstrip('/') + '/' + f
    # READ INPUT DATA FILE
    # --------------------
    this_time, x, y, d, d_err, t, h = read_data_file(fi, args.de, args.w)

    # CORRECT FOR NONLINEAR MOTION OF STAGES
    # --------------------------------------
    if args.nc:
        x, y = correct_stage_positions(F_CALX, F_CALY, x, y)

    # CORRECT FOR TEMPERATURE EXCURSIONS
    # ----------------------------------
    if args.nt:
        d = correct_for_temperature(F_CORT, d, t)

    run_data_x.append(np.mean(x))
    run_data_y.append(np.mean(y))
    run_data_d.append(np.mean(d))
    run_data_d_err.append(np.mean(d_err))
    print

with open("flat.dat", 'w') as out:
    for i in range(len(run_data_x)):
        if not np.isnan(run_data_x[i]):
예제 #4
0
run_data_d = []
run_data_d_err = []
for f in os.listdir(args.f):
    print "processing file " + f
    if f.endswith(".log"):
        print "ignoring file"
        continue
    fi = args.f.rstrip('/') + '/' + f
    # READ INPUT DATA FILE
    # --------------------
    this_time, x, y, d, d_err, t, h = read_data_file(fi, args.de, args.w)

    # CORRECT FOR NONLINEAR MOTION OF STAGES
    # --------------------------------------
    if args.nc:
        x, y = correct_stage_positions(F_CALX, F_CALY, x, y)

    # CORRECT FOR TEMPERATURE EXCURSIONS
    # ----------------------------------
    if args.nt:
        d = correct_for_temperature(F_CORT, d, t)

    run_data_x.append(np.mean(x))
    run_data_y.append(np.mean(y))
    run_data_d.append(np.mean(d))
    run_data_d_err.append(np.mean(d_err))
    print

with open("flat.dat", 'w') as out:
    for i in range(len(run_data_x)):
        if not np.isnan(run_data_x[i]):
예제 #5
0
parser = argparse.ArgumentParser()
parser.add_argument('--fl', help="add file to list", action='append')
parser.add_argument('--de', help="maximum error in distance measurement", action="store", type=float, default=1.0)
parser.add_argument('--w', help="window, defaults to min/max of data (x1,x2,y1,y2)", action="store", type=str, default='25,210,285,285')
parser.add_argument('--ca', help="don't apply stage calibration files", action="store_false")
parser.add_argument('--cax', help="calibration file for x if stage calibration is to be applied", action="store", type=str, default='calibration_files/45855915_cal.dat')
parser.add_argument('--cay', help="calibration file for y if stage calibration is to be applied", action="store", type=str, default='calibration_files/45855916_cal.dat')
args = parser.parse_args()

args.w = ([float(n) for n in args.w.split(',')])

for f in args.fl:
    # READ INPUT DATA FILE(S)
    # -----------------------
    x, y, d, de = read_data_file(f, args.de, args.w)

    # CORRECT FOR NONLINEAR MOTION OF STAGES
    # --------------------------------------
    if args.ca:
        x, y = correct_stage_positions(args.cax, args.cay, x, y)

    c = np.polyfit(x, d, 1)
    d_slope = np.polyval(c, x)
    plt.plot(x, d-d_slope, label="y= " + f)

plt.legend()
plt.ylim([-50,50])
plt.show()

예제 #6
0
    action="store",
    type=str,
    default='calibration_files/45855915_cal.dat')
parser.add_argument(
    '--cay',
    help="calibration file for y if stage calibration is to be applied",
    action="store",
    type=str,
    default='calibration_files/45855916_cal.dat')
args = parser.parse_args()

args.w = ([float(n) for n in args.w.split(',')])

for f in args.fl:
    # READ INPUT DATA FILE(S)
    # -----------------------
    x, y, d, de = read_data_file(f, args.de, args.w)

    # CORRECT FOR NONLINEAR MOTION OF STAGES
    # --------------------------------------
    if args.ca:
        x, y = correct_stage_positions(args.cax, args.cay, x, y)

    c = np.polyfit(x, d, 1)
    d_slope = np.polyval(c, x)
    plt.plot(x, d - d_slope, label="y= " + f)

plt.legend()
plt.ylim([-50, 50])
plt.show()