-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified widget to only accept files whose name starts with D[digit] Moved main script to bin/ Updated setup.py accordingly and removed some unused variables. Renamed widget module to avoid duplicating package name. Added simple tester to svn repository.
- Loading branch information
rowen
committed
Oct 11, 2011
1 parent
52f7477
commit 1bef2c1
Showing
10 changed files
with
92 additions
and
31 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
from __future__ import with_statement | ||
"""Fit plug plate measurements | ||
History: | ||
2011-10-11 ROwen Moved this code from a library module. | ||
""" | ||
import sys | ||
import Tkinter | ||
import fitPlugPlateMeas | ||
|
||
filePathList = sys.argv[1:] | ||
# strip first argument if it starts with "-", as happens when run as a Mac application | ||
if filePathList and filePathList[0].startswith("-"): | ||
filePathList = filePathList[1:] | ||
|
||
root = Tkinter.Tk() | ||
root.title("FitPlugPlateMeas") | ||
|
||
fitPlugPlateWdg = fitPlugPlateMeas.FitPlugPlateMeasWdg(master=root, filePathList=filePathList) | ||
fitPlugPlateWdg.pack(side="left", expand=True, fill="both") | ||
root.mainloop() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .version import * | ||
from .fitPlugPlateMeasWdg import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env python | ||
"""A simple test of whether the fitter is working well. | ||
This should be turned into a unit test that reports pass/fail. | ||
""" | ||
import numpy | ||
import matplotlib.pyplot as pyplot | ||
from . import fitData | ||
|
||
posArr = numpy.arange(-1.0, 1.01, 0.1, dtype=float) | ||
nomPos = numpy.zeros((len(posArr)**2,2)) | ||
i = 0 | ||
for x in posArr: | ||
for y in posArr: | ||
nomPos[i] = (x, y) | ||
i += 1 | ||
|
||
pyplot.ion() | ||
|
||
print "QuadrupoleModel" | ||
qpModel = fitData.QuadrupoleModel() | ||
qpModel.setMagnitudeAngle(0.1, 45.0) | ||
print "desired coeffs=", qpModel.getCoeffs() | ||
qpPos = qpModel.apply(nomPos) | ||
|
||
for testCoeffs in ((1, 1), (10, 10), (0.5, -45)): | ||
print "init coeffs=", testCoeffs | ||
qpFit = fitData.ModelFit( | ||
model = fitData.QuadrupoleModel(testCoeffs), | ||
measPos = qpPos, | ||
nomPos = nomPos, | ||
doRaise = True, | ||
) | ||
print "fit coeffs=", qpFit.model.getCoeffs() | ||
|
||
|
||
print "TransRotScaleModel" | ||
trsModel = fitData.TransRotScaleModel((0.2, -0.3, 0.8, -0.9)) | ||
trsPos = trsModel.apply(nomPos) | ||
print "desired coeffs=", trsModel.getCoeffs() | ||
|
||
for testCoeffs in ((1, 1, 1, 1), (10, 10, 10, 10), (0.5, -0.6, 0.5, -0.5)): | ||
print "init coeffs=", testCoeffs | ||
trsFit = fitData.ModelFit( | ||
model = fitData.TransRotScaleModel(testCoeffs), | ||
measPos = trsPos, | ||
nomPos = nomPos, | ||
doRaise = True, | ||
) | ||
print "fit coeffs=", trsFit.model.getCoeffs() | ||
|
||
|
||
# pyplot.plot( | ||
# nomPos[:,0], nomPos[:,1], "b.", | ||
# qpPos[:,0], qpPos[:,1], "r.", | ||
# ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "2.4.1" |