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
225ac7af
Commit
225ac7af
authored
Jul 02, 2021
by
Javier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor bugs in comp_t0 + error normalization t2E
error finding non-defined id
parent
9c245c00
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
26 deletions
+35
-26
src/juobs_obs.jl
src/juobs_obs.jl
+35
-26
No files found.
src/juobs_obs.jl
View file @
225ac7af
...
@@ -469,6 +469,7 @@ function comp_t0(Y::YData, plat::Vector{Int64}; L::Int64, pl::Bool=false,
...
@@ -469,6 +469,7 @@ function comp_t0(Y::YData, plat::Vector{Int64}; L::Int64, pl::Bool=false,
replica
=
size
.
([
Ysl
],
1
)
replica
=
size
.
([
Ysl
],
1
)
#Truncation
#Truncation
if
id
in
keys
(
ADerrors
.
wsg
.
str2id
)
n_ws
=
findfirst
(
x
->
x
==
ws
.
str2id
[
id
],
ws
.
map_nob
)
n_ws
=
findfirst
(
x
->
x
==
ws
.
str2id
[
id
],
ws
.
map_nob
)
if
!
isnothing
(
n_ws
)
if
!
isnothing
(
n_ws
)
ivrep_ws
=
ws
.
fluc
[
n_ws
]
.
ivrep
ivrep_ws
=
ws
.
fluc
[
n_ws
]
.
ivrep
...
@@ -484,6 +485,7 @@ function comp_t0(Y::YData, plat::Vector{Int64}; L::Int64, pl::Bool=false,
...
@@ -484,6 +485,7 @@ function comp_t0(Y::YData, plat::Vector{Int64}; L::Int64, pl::Bool=false,
error
(
"Automatic truncation failed. R = 1
\n
Try using truncate_data!"
)
error
(
"Automatic truncation failed. R = 1
\n
Try using truncate_data!"
)
end
end
end
end
end
Ysl
=
isnothing
(
rw
)
?
Ysl
:
apply_rw
(
Ysl
,
rw
)
Ysl
=
isnothing
(
rw
)
?
Ysl
:
apply_rw
(
Ysl
,
rw
)
xmax
=
size
(
Ysl
,
2
)
xmax
=
size
(
Ysl
,
2
)
...
@@ -552,8 +554,10 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
...
@@ -552,8 +554,10 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
if
!
all
(
id
.==
id
[
1
])
if
!
all
(
id
.==
id
[
1
])
error
(
"IDs are not equal"
)
error
(
"IDs are not equal"
)
end
end
id
=
id
[
1
]
#Truncation
#Truncation
n_ws
=
findfirst
(
x
->
x
==
ws
.
str2id
[
id
[
1
]],
ws
.
map_nob
)
if
id
in
keys
(
ADerrors
.
wsg
.
str2id
)
n_ws
=
findfirst
(
x
->
x
==
ws
.
str2id
[
id
],
ws
.
map_nob
)
if
!
isnothing
(
n_ws
)
if
!
isnothing
(
n_ws
)
ivrep_ws
=
ws
.
fluc
[
n_ws
]
.
ivrep
ivrep_ws
=
ws
.
fluc
[
n_ws
]
.
ivrep
...
@@ -571,6 +575,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
...
@@ -571,6 +575,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
end
end
replica
=
size
.
(
Ysl
,
1
)
replica
=
size
.
(
Ysl
,
1
)
end
end
end
Ysl
=
isnothing
(
rw
)
?
Ysl
:
apply_rw
(
Ysl
,
rw
)
Ysl
=
isnothing
(
rw
)
?
Ysl
:
apply_rw
(
Ysl
,
rw
)
tmp
=
Ysl
[
1
]
tmp
=
Ysl
[
1
]
...
@@ -583,7 +588,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
...
@@ -583,7 +588,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
for
i
=
1
:
xmax
for
i
=
1
:
xmax
k
=
1
k
=
1
for
j
=
nt0
-
dt0
:
nt0
+
dt0
for
j
=
nt0
-
dt0
:
nt0
+
dt0
Y_aux
[
i
,
k
]
=
uwreal
(
tmp
[
:
,
i
,
j
],
id
[
1
]
,
replica
)
Y_aux
[
i
,
k
]
=
uwreal
(
tmp
[
:
,
i
,
j
],
id
,
replica
)
k
=
k
+
1
k
=
k
+
1
end
end
end
end
...
@@ -629,6 +634,10 @@ end
...
@@ -629,6 +634,10 @@ end
function
t0_guess
(
t
::
Vector
{
Float64
},
Ysl
::
Array
{
Float64
,
3
},
plat
::
Vector
{
Int64
},
L
::
Int64
)
function
t0_guess
(
t
::
Vector
{
Float64
},
Ysl
::
Array
{
Float64
,
3
},
plat
::
Vector
{
Int64
},
L
::
Int64
)
t2E_ax
=
t
.^
2
.*
mean
(
mean
(
Ysl
[
:
,
plat
[
1
]
:
plat
[
2
],
:
],
dims
=
2
),
dims
=
1
)[
1
,
1
,
:
]
/
L
^
3
t2E_ax
=
t
.^
2
.*
mean
(
mean
(
Ysl
[
:
,
plat
[
1
]
:
plat
[
2
],
:
],
dims
=
2
),
dims
=
1
)[
1
,
1
,
:
]
/
L
^
3
#look for values t2E: t2E > 0.3 and 0.0 < t2E_ax < 0.3
if
!
(
any
(
t2E_ax
.>
0.3
)
&&
any
((
t2E_ax
.<
0.3
)
.&
(
t2E_ax
.>
0.0
)))
error
(
"Error finding solutions. Check volume normalization!"
)
end
t0_aux
=
minimum
(
abs
.
(
t2E_ax
.-
0.3
))
t0_aux
=
minimum
(
abs
.
(
t2E_ax
.-
0.3
))
nt0
=
findfirst
(
x
->
abs
(
x
-
0.3
)
==
t0_aux
,
t2E_ax
)
#index closest value to t0
nt0
=
findfirst
(
x
->
abs
(
x
-
0.3
)
==
t0_aux
,
t2E_ax
)
#index closest value to t0
return
nt0
return
nt0
...
...
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