Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
phy-exp
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
recolic-hust
phy-exp
Commits
68a611f7
There was an error fetching the commit references. Please try again later.
Unverified
Commit
68a611f7
authored
7 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
Adjust unexposed method name... so that `from quickmap import *` works better.
parent
df957824
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
TuningFork/draw.py
+4
-5
4 additions, 5 deletions
TuningFork/draw.py
quickmap.py
+4
-4
4 additions, 4 deletions
quickmap.py
with
8 additions
and
9 deletions
TuningFork/draw.py
+
4
−
5
View file @
68a611f7
...
...
@@ -2,15 +2,14 @@
import
sys
sys
.
path
.
append
(
'
..
'
)
import
quickmap
from
quickmap
import
GetMultiMap
,
GetLine
from
quickmap
import
*
x1
,
y1
=
quickmap
.
DataFileToXYArray
(
'
without_damping.dat
'
)
x2
,
y2
=
quickmap
.
DataFileToXYArray
(
'
with_damping.dat
'
)
x1
,
y1
=
DataFileToXYArray
(
'
without_damping.dat
'
)
x2
,
y2
=
DataFileToXYArray
(
'
with_damping.dat
'
)
GetMultiMap
(
GetLine
(
x1
,
y1
,
smoothLine
=
True
)
+
GetLine
(
x2
,
y2
,
smoothLine
=
True
))
sq_T
=
'
14.633 19.327 24.256 29.192 34.589 39.547
'
.
split
(
'
'
)
sq_T
=
[
float
(
e
)
for
e
in
sq_T
]
m
=
[
0
,
10
,
20
,
30
,
40
,
50
]
quickmap
.
GetMap
(
m
,
sq_T
,
polyLine
=
True
)
GetMap
(
m
,
sq_T
,
polyLine
=
True
)
This diff is collapsed.
Click to expand it.
quickmap.py
+
4
−
4
View file @
68a611f7
...
...
@@ -11,7 +11,7 @@ from scipy.interpolate import spline
from
deprecated
import
deprecated
def
dotMultiply
(
vctA
,
vctB
):
def
_
dotMultiply
(
vctA
,
vctB
):
if
len
(
vctA
)
!=
len
(
vctB
):
print
(
"
Error: While vcta is
"
,
vctA
,
"
and vctb is
"
,
vctB
)
raise
ValueError
(
"
dotmulti needs lena == lenb.
"
)
...
...
@@ -92,7 +92,7 @@ def GetLine(arrX, arrY, name=fetchAnonymousLineName(), extendXRate=1, extendYRat
vctX
=
[
x
**
power
for
power
in
range
(
poly_maxXPower
+
1
)]
if
poly_passO
:
vctX
[
0
]
=
0
return
dotMultiply
(
k
,
vctX
)
return
_
dotMultiply
(
k
,
vctX
)
def
lossFunc
(
k
,
x
,
y
):
return
abs
(
lineFunc
(
k
,
x
)
-
y
)
...
...
@@ -111,10 +111,10 @@ def GetLine(arrX, arrY, name=fetchAnonymousLineName(), extendXRate=1, extendYRat
if
polyLine
:
if
poly_inverseK
:
py
=
numpy
.
linspace
(
minY
,
maxY
,
1000
)
px
=
dotMultiply
(
kFinal
,
[
py
**
power
for
power
in
range
(
poly_maxXPower
+
1
)])
px
=
_
dotMultiply
(
kFinal
,
[
py
**
power
for
power
in
range
(
poly_maxXPower
+
1
)])
else
:
px
=
numpy
.
linspace
(
minX
,
maxX
,
1000
)
py
=
dotMultiply
(
kFinal
,
[
px
**
power
for
power
in
range
(
poly_maxXPower
+
1
)])
py
=
_
dotMultiply
(
kFinal
,
[
px
**
power
for
power
in
range
(
poly_maxXPower
+
1
)])
elif
smoothLine
:
px
=
numpy
.
linspace
(
minX
,
maxX
,
1000
)
py
=
spline
(
X
,
Y
,
px
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment