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
bae2f0f3
Commit
bae2f0f3
authored
2 years ago
by
Alejandro Saez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add concat_data!
parent
46a92fa4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
src/juobs_reader.jl
src/juobs_reader.jl
+55
-0
No files found.
src/juobs_reader.jl
View file @
bae2f0f3
...
...
@@ -520,4 +520,59 @@ function truncate_data!(data::Vector{Vector{CData}}, nc::Vector{Int64})
end
end
return
nothing
end
@doc
raw
"""
concat_data!(data1::Vector{CData}, data2::Vector{CData})
concat_data!(data1::Vector{Vector{CData}}, data2::Vector{Vector{CData}})
Concatenates the output of 2 calls to `read_mesons` over configurations.
Both data must have the same number of replicas and correlators.
The output is saved in the first argument, so if you want to concatenate
3 data sets: `concat_data!(data1, data2); concat_data!(data1, data3)`
Examples:
```@example
#Single replica
dat = read_mesons(path, "
G5
", "
G5
")
dat2 = read_mesons(path2, "
G5
", "
G5
")
concat_data!(dat, dat2)
#Two replicas
dat = read_mesons([path1, path2], "
G5
", "
G5
")
dat2 = read_mesons([path3, path4], "
G5
", "
G5
")
concat_data!(dat, dat2)
```
"""
function
concat_data
!
(
data1
::
Vector
{
CData
},
data2
::
Vector
{
CData
})
N
=
length
(
data1
)
if
length
(
data1
)
!=
length
(
data2
)
error
(
"number of correlators do not match"
)
end
for
k
=
1
:
N
data1
[
k
]
.
vcfg
=
vcat
(
data1
[
k
]
.
vcfg
,
data2
[
k
]
.
vcfg
)
data1
[
k
]
.
re_data
=
vcat
(
data1
[
k
]
.
re_data
,
data2
[
k
]
.
re_data
)
data1
[
k
]
.
im_data
=
vcat
(
data1
[
k
]
.
im_data
,
data2
[
k
]
.
im_data
)
end
return
nothing
end
function
concat_data
!
(
data1
::
Vector
{
Vector
{
CData
}},
data2
::
Vector
{
Vector
{
CData
}})
N
=
length
(
data1
)
if
length
(
data1
)
!=
length
(
data2
)
error
(
"number of correlators do not match"
)
end
R
=
length
(
data1
[
1
])
if
length
(
data1
[
1
])
!=
length
(
data2
[
1
])
error
(
"number of replicas do not match"
)
end
for
k
=
1
:
N
for
r
=
1
:
R
data1
[
k
][
r
]
.
vcfg
=
vcat
(
data1
[
k
][
r
]
.
vcfg
,
data2
[
k
][
r
]
.
vcfg
)
data1
[
k
][
r
]
.
re_data
=
vcat
(
data1
[
k
][
r
]
.
re_data
,
data2
[
k
][
r
]
.
re_data
)
data1
[
k
][
r
]
.
im_data
=
vcat
(
data1
[
k
][
r
]
.
im_data
,
data2
[
k
][
r
]
.
im_data
)
end
end
return
nothing
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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