Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
PlotFitPy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlson Moses Büth
PlotFitPy
Commits
d1738aff
Commit
d1738aff
authored
Dec 08, 2019
by
Carlson Moses Büth
🌝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added functions-class and class descriptions
parent
18f32be6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
plotfitpy/composer.py
plotfitpy/composer.py
+1
-0
plotfitpy/fitODR.py
plotfitpy/fitODR.py
+26
-0
plotfitpy/funcs.py
plotfitpy/funcs.py
+16
-0
No files found.
plotfitpy/composer.py
View file @
d1738aff
# Class for composing functions
import
numpy
as
np
#Liefert wichtige Rechenfunktionen und numpy-arrays; vergleichsweise schnelle Befehle
import
uncertainties
as
uc
#Rechnen mit Größen, die fehlerbehaftet sind.
from
uncertainties
import
ufloat
as
uf
...
...
plotfitpy/fitODR.py
View file @
d1738aff
# Class for integrated Fit+Plot Functions
import
numpy
as
np
#Liefert wichtige Rechenfunktionen und numpy-arrays; vergleichsweise schnelle Befehle
import
uncertainties
as
uc
#Rechnen mit Größen, die fehlerbehaftet sind.
import
matplotlib.pyplot
as
plt
from
scipy.odr
import
*
import
uncertainties.unumpy
as
unp
unv
=
unp
.
nominal_values
usd
=
unp
.
std_devs
def
fitOdrXYun
(
func
,
x
,
y
,
sx
=
None
,
sy
=
None
,
startW
=
[
1
]):
data
=
RealData
(
x
,
y
,
sx
,
sy
)
func_model
=
Model
(
func
)
odr
=
ODR
(
data
,
func_model
,
beta0
=
startW
)
out
=
odr
.
run
()
for
index
,
item
in
enumerate
(
out
.
beta
):
print
(
out
.
beta
[
index
],
'
\t
'
,
out
.
sd_beta
[
index
])
out
.
pprint
()
#zum Debuggen nutzlich (wenn Fit nicht konvergiert)
d
=
(
max
(
x
)
-
min
(
x
))
/
20
x_fit
=
np
.
linspace
(
min
(
x
)
-
d
,
max
(
x
)
+
d
,
200
)
y_fit
=
func
(
out
.
beta
,
x_fit
)
plt
.
errorbar
(
x
,
y
,
sy
,
sx
,
linestyle
=
'None'
,
fmt
=
'.'
,
capsize
=
5
,
linewidth
=
2
,
zorder
=
5
)
plt
.
plot
(
x_fit
,
y_fit
,
"--"
,
alpha
=
1
,
zorder
=
6
)
return
out
.
beta
,
out
.
sd_beta
\ No newline at end of file
plotfitpy/funcs.py
0 → 100644
View file @
d1738aff
# Functions used to fit
def
getAllFunctions
():
inspect
.
getmembers
(
self
,
predicate
=
inspect
.
ismethod
)
def
constFunc
(
p
,
x
):
(
c
)
=
p
return
0
*
x
+
c
def
linFunc
(
p
,
x
):
(
m
,
c
)
=
p
return
m
*
x
+
c
def
quadFunc
(
p
,
x
)
(
m
,
x0
,
c
)
return
m
*
(
x
-
x0
)
**
2
+
c
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment