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
88a5a34f
Commit
88a5a34f
authored
Mar 12, 2021
by
Javier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
read_ms also reads Qsl and Wsl
parent
e1b4dd72
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
8 deletions
+18
-8
src/juobs_obs.jl
src/juobs_obs.jl
+2
-2
src/juobs_reader.jl
src/juobs_reader.jl
+15
-5
src/juobs_types.jl
src/juobs_types.jl
+1
-1
No files found.
src/juobs_obs.jl
View file @
88a5a34f
...
...
@@ -216,7 +216,7 @@ function comp_t0(Y::YData, plat::Vector{Int64}; L::Int64, pl::Bool=false,
rw
::
Union
{
Matrix
{
Float64
},
Nothing
}
=
nothing
,
npol
::
Int64
=
2
,
ws
::
ADerrors
.
wspace
=
ADerrors
.
wsg
,
wpm
::
Union
{
Dict
{
Int64
,
Vector
{
Float64
}},
Dict
{
String
,
Vector
{
Float64
}},
Nothing
}
=
nothing
)
Ysl
=
Y
.
Ysl
Ysl
=
Y
.
obs
t
=
Y
.
t
id
=
Y
.
id
replica
=
size
.
([
Ysl
],
1
)
...
...
@@ -296,7 +296,7 @@ function comp_t0(Y::Vector{YData}, plat::Vector{Int64}; L::Int64, pl::Bool=false
wpm
::
Union
{
Dict
{
Int64
,
Vector
{
Float64
}},
Dict
{
String
,
Vector
{
Float64
}},
Nothing
}
=
nothing
)
nr
=
length
(
Y
)
Ysl
=
getfield
.
(
Y
,
:
Ysl
)
Ysl
=
getfield
.
(
Y
,
:
obs
)
t
=
getfield
.
(
Y
,
:
t
)
t
=
t
[
1
]
id
=
getfield
.
(
Y
,
:
id
)
...
...
src/juobs_reader.jl
View file @
88a5a34f
...
...
@@ -275,13 +275,13 @@ function read_md(path::String)
end
@doc
raw
"""
read_ms(path::String; id::Union{String, Nothing}=nothing, dtr::Int64=1)
read_ms(path::String; id::Union{String, Nothing}=nothing, dtr::Int64=1
, obs::String="
Y
"
)
Reads openQCD ms dat files at a given path. This method return YData:
- `t(t)`: flow time values
- `
Ysl(icfg, x0, t)`: the time-slice sums of the densities of the Yang-Mills action
- `
obs(icfg, x0, t)`: the time-slice sums of the densities of the observable (Wsl, Ysl or Qsl)
- `vtr`: vector that contains trajectory number
...
...
@@ -295,7 +295,7 @@ Examples:
Y = read_ms(path)
```
"""
function
read_ms
(
path
::
String
;
id
::
Union
{
String
,
Nothing
}
=
nothing
,
dtr
::
Int64
=
1
)
function
read_ms
(
path
::
String
;
id
::
Union
{
String
,
Nothing
}
=
nothing
,
dtr
::
Int64
=
1
,
obs
::
String
=
"Y"
)
if
isnothing
(
id
)
bname
=
basename
(
path
)
m
=
findfirst
(
r
"[A-Z][0-9]{3}r[0-9]{3}"
,
bname
)
...
...
@@ -351,7 +351,17 @@ function read_ms(path::String; id::Union{String, Nothing}=nothing, dtr::Int64=1)
end
close
(
data
)
t
=
Float64
.
(
0
:
nn
)
.*
dn
.*
eps
if
obs
==
"W"
return
YData
(
vntr
,
t
,
Wsl
,
id
)
elseif
obs
==
"Y"
return
YData
(
vntr
,
t
,
Ysl
,
id
)
elseif
obs
==
"Q"
return
YData
(
vntr
,
t
,
Qsl
,
id
)
else
println
(
"obs = "
,
obs
,
" is not valid"
)
return
nothing
end
end
@doc
raw
"""
...
...
@@ -382,7 +392,7 @@ truncate_data!(Y, [nc1, nc2])
"""
function
truncate_data
!
(
data
::
YData
,
nc
::
Int64
)
data
.
vtr
=
data
.
vtr
[
1
:
nc
]
data
.
Ysl
=
data
.
Ysl
[
1
:
nc
,
:
,
:
]
data
.
obs
=
data
.
obs
[
1
:
nc
,
:
,
:
]
return
nothing
end
function
truncate_data
!
(
data
::
Vector
{
YData
},
nc
::
Vector
{
Int64
})
...
...
src/juobs_types.jl
View file @
88a5a34f
...
...
@@ -172,7 +172,7 @@ end
mutable struct
YData
vtr
::
Vector
{
Int32
}
t
::
Vector
{
Float64
}
Ysl
::
Array
{
Float64
,
3
}
obs
::
Array
{
Float64
,
3
}
id
::
String
YData
(
a
,
b
,
c
,
d
)
=
new
(
a
,
b
,
c
,
d
)
end
...
...
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