Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
juobs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
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
Javier Ugarrio
juobs
Commits
712711a2
Commit
712711a2
authored
May 13, 2021
by
Javier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug in wpm
broadcasting dictionaries is not allowed
parent
46040edf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
src/juobs_linalg.jl
src/juobs_linalg.jl
+1
-1
src/juobs_obs.jl
src/juobs_obs.jl
+3
-3
src/juobs_tools.jl
src/juobs_tools.jl
+5
-5
No files found.
src/juobs_linalg.jl
View file @
712711a2
...
...
@@ -126,7 +126,7 @@ function energies(evals::Union{Vector{Vector{uwreal}},Array{Array{uwreal}} }; wp
ratio
=
evals
[
t
][
i
]
/
evals
[
t
+
1
][
i
]
aux_en
[
t
]
=
0.5
*
log
(
ratio
*
ratio
)
end
isnothing
(
wpm
)
?
uwerr
.
(
aux_en
)
:
uwerr
.
(
aux_en
,
wpm
)
isnothing
(
wpm
)
?
uwerr
.
(
aux_en
)
:
[
uwerr
(
a
,
wpm
)
for
a
in
aux_en
]
eff_en
[
i
]
=
copy
(
aux_en
)
end
return
eff_en
...
...
src/juobs_obs.jl
View file @
712711a2
...
...
@@ -347,7 +347,7 @@ function dec_const_pcvc(corr::Vector{uwreal}, plat::Vector{Int64}, m::uwreal, mu
else
uwerr
(
f
,
wpm
)
uwerr
(
R_av
,
wpm
)
uwerr
.
(
R
,
wpm
)
[
uwerr
(
Raux
,
wpm
)
for
Raux
in
R
]
end
v
=
value
(
R_av
)
...
...
@@ -464,7 +464,7 @@ function comp_t0(Y::YData, plat::Vector{Int64}; L::Int64, pl::Bool=false,
uwerr
.
(
t2E
)
else
uwerr
(
t0
,
wpm
)
uwerr
.
(
t2E
,
wpm
)
[
uwerr
(
t2E_aux
,
wpm
)
for
t2E_aux
in
t2E
]
end
v
=
value
.
(
t2E
)
...
...
@@ -553,7 +553,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
uwerr
.
(
t2E
)
else
uwerr
(
t0
,
wpm
)
uwerr
.
(
t2E
,
wpm
)
[
uwerr
(
t2E_aux
,
wpm
)
for
t2E_aux
in
t2E
]
end
v
=
value
.
(
t2E
)
...
...
src/juobs_tools.jl
View file @
712711a2
...
...
@@ -300,7 +300,7 @@ function md_val(a::uwreal, obs::Corr, derm::Vector{Corr})
end
function
plat_av
(
obs
::
Vector
{
uwreal
},
plat
::
Vector
{
Int64
},
wpm
::
Union
{
Dict
{
Int64
,
Vector
{
Float64
}},
Dict
{
String
,
Vector
{
Float64
}},
Nothing
}
=
nothing
)
isnothing
(
wpm
)
?
uwerr
.
(
obs
)
:
uwerr
.
(
obs
,
wpm
)
isnothing
(
wpm
)
?
uwerr
.
(
obs
)
:
[
uwerr
(
obs_aux
,
wpm
)
for
obs_aux
in
obs
]
w
=
1
./
err
.
(
obs
)[
plat
[
1
]
:
plat
[
2
]]
.^
2
av
=
sum
(
w
.*
obs
[
plat
[
1
]
:
plat
[
2
]])
/
sum
(
w
)
return
av
...
...
@@ -329,7 +329,7 @@ m2_phys = fitp[1] + fitp[2] * phi2_phys
```
"""
function
lin_fit
(
x
::
Vector
{
<:
Real
},
y
::
Vector
{
uwreal
};
wpm
::
Union
{
Dict
{
Int64
,
Vector
{
Float64
}},
Dict
{
String
,
Vector
{
Float64
}},
Nothing
}
=
nothing
)
isnothing
(
wpm
)
?
uwerr
.
(
y
)
:
uwerr
.
(
y
,
wpm
)
isnothing
(
wpm
)
?
uwerr
.
(
y
)
:
[
uwerr
(
yaux
,
wpm
)
for
yaux
in
y
]
par
=
lin_fit
(
x
,
value
.
(
y
),
err
.
(
y
))
chisq
(
p
,
d
)
=
sum
((
d
.-
p
[
1
]
.-
p
[
2
]
.*
x
)
.^
2
./
err
.
(
y
)
.^
2
)
(
fitp
,
csqexp
)
=
fit_error
(
chisq
,
par
,
y
)
...
...
@@ -383,7 +383,7 @@ fit_routine(model, xdata, ydata, param=3, covar=true)
```
"""
function
fit_routine
(
model
::
Function
,
xdata
::
Array
{
<:
Real
},
ydata
::
Array
{
uwreal
},
param
::
Int64
=
3
;
wpm
::
Union
{
Dict
{
Int64
,
Vector
{
Float64
}},
Dict
{
String
,
Vector
{
Float64
}},
Nothing
}
=
nothing
)
#isnothing(wpm) ? uwerr.(ydata) : uwerr.(ydata, wpm)
isnothing
(
wpm
)
?
uwerr
.
(
ydata
)
:
[
uwerr
(
yaux
,
wpm
)
for
yaux
in
ydata
]
yval
=
value
.
(
ydata
)
yer
=
err
.
(
ydata
)
...
...
@@ -411,8 +411,8 @@ function fit_routine(model::Function, xdata::Array{uwreal}, ydata::Array{uwreal}
uwerr
.
(
ydata
)
uwerr
.
(
xdata
)
else
uwerr
.
(
ydata
,
wpm
)
uwerr
.
(
xdata
,
wpm
)
[
uwerr
(
yaux
,
wpm
)
for
yaux
in
ydata
]
[
uwerr
(
xaux
,
wpm
)
for
xaux
in
xdata
]
end
yval
=
value
.
(
ydata
)
...
...
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