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
18f32be6
Commit
18f32be6
authored
Dec 08, 2019
by
Carlson Moses Büth
🌝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make composer class with basic functions
parent
be89192e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
plotfitpy/composer.py
plotfitpy/composer.py
+30
-0
No files found.
plotfitpy/composer.py
View file @
18f32be6
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
from
uncertainties.unumpy
import
uarray
as
ua
import
uncertainties.unumpy
as
unp
unv
=
unp
.
nominal_values
usd
=
unp
.
std_devs
def
FormUF
(
u
,
n
=
3
,
d
=
0
):
if
(
d
==
0
):
prt
=
str
(
np
.
round
(
unv
(
u
),
n
))
+
"+-"
+
str
(
np
.
round
(
usd
(
u
),
n
))
else
:
prt
=
str
(
np
.
round
(
unv
(
u
)
*
10
**
(
-
d
),
n
))
+
"+-"
+
str
(
np
.
round
(
usd
(
u
)
*
10
**
(
-
d
),
n
))
+
"d"
+
str
(
d
)
return
prt
def
numFromUF
(
u
,
n
=
3
,
d
=
0
):
# uncertainty float, Nachkommastelen, Größenordnung
return
"
\n
um{"
+
FromUF
(
u
,
n
,
d
)
+
"}"
def
siFromUF
(
u
,
unit
,
n
=
3
,
d
=
0
):
# uncertainty float, Nachkommastelen, Größenordnung
return
"\SI{"
+
FromUF
(
u
,
n
,
d
)
+
"}{"
+
unit
+
"}"
def
strFromUF
(
u
,
n
=
3
,
d
=
0
,
wLatex
=
True
):
# uncertainty float, Nachkommastelen, Größenordnung
if
(
d
==
0
):
prt
=
"("
+
str
(
np
.
round
(
unv
(
u
),
n
))
+
"\pm"
+
str
(
np
.
round
(
usd
(
u
),
n
))
+
")"
else
:
prt
=
"("
+
str
(
round
(
unv
(
u
)
*
10
**
(
-
d
),
n
))
+
"\pm"
+
str
(
round
(
usd
(
u
)
*
10
**
(
-
d
),
n
))
+
")\cdot 10^{"
+
str
(
d
)
+
"}"
if
(
wLatex
==
True
):
prt
=
"$"
+
prt
+
"$"
return
prt
\ 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