Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dataAnalysis
geomtools
Commits
ff7cd862
Commit
ff7cd862
authored
6 months ago
by
Egor Sobolev
Browse files
Options
Downloads
Patches
Plain Diff
Fix the use of detector source
parent
98965fa2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Center refinement using powder diffraction data
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/geomtools/powder/image_agg.py
+1
-2
1 addition, 2 deletions
src/geomtools/powder/image_agg.py
src/geomtools/powder/powdersum.py
+4
-8
4 additions, 8 deletions
src/geomtools/powder/powdersum.py
with
5 additions
and
10 deletions
src/geomtools/powder/image_agg.py
+
1
−
2
View file @
ff7cd862
...
@@ -79,8 +79,7 @@ class ImageAgg:
...
@@ -79,8 +79,7 @@ class ImageAgg:
tm0
=
time
.
perf_counter
()
tm0
=
time
.
perf_counter
()
print
(
f
"
[
{
self
.
_rank
:
2
d
}
]
{
modno
:
3
d
}
:
"
,
end
=
""
)
print
(
f
"
[
{
self
.
_rank
:
2
d
}
]
{
modno
:
3
d
}
:
"
,
end
=
""
)
source_id
=
source_pattern
.
format
(
source_id
=
source_pattern
.
format
(
modno
)
detector_id
=
self
.
detector_id
,
modno
=
modno
)
dc
=
dc_img
.
select
(
dc
=
dc_img
.
select
(
[(
source_id
,
"
image.data
"
),
(
source_id
,
"
image.mask
"
)],
[(
source_id
,
"
image.data
"
),
(
source_id
,
"
image.mask
"
)],
require_all
=
True
require_all
=
True
...
...
This diff is collapsed.
Click to expand it.
src/geomtools/powder/powdersum.py
+
4
−
8
View file @
ff7cd862
...
@@ -181,11 +181,7 @@ def main(argv=None):
...
@@ -181,11 +181,7 @@ def main(argv=None):
modules
=
args
.
modules
modules
=
args
.
modules
if
modules
is
None
:
if
modules
is
None
:
re_pattern
=
re
.
compile
(
re_pattern
=
re
.
compile
(
"
^
"
+
"
^
"
+
det_source_pattern
.
replace
(
"
*
"
,
r
"
(?P<modno>\d+)
"
)
+
"
$
"
)
source_pattern
.
format
(
detector_id
=
detector_id
,
modno
=
r
"
(?P<modno>\d+)
"
)
+
"
$
"
)
matches
=
(
re_pattern
.
match
(
s
)
for
s
in
dc_img
.
all_sources
)
matches
=
(
re_pattern
.
match
(
s
)
for
s
in
dc_img
.
all_sources
)
modules
=
sorted
(
int
(
m
[
"
modno
"
])
for
m
in
matches
if
m
is
not
None
)
modules
=
sorted
(
int
(
m
[
"
modno
"
])
for
m
in
matches
if
m
is
not
None
)
num_modules
=
len
(
modules
)
num_modules
=
len
(
modules
)
...
@@ -217,11 +213,11 @@ def main(argv=None):
...
@@ -217,11 +213,11 @@ def main(argv=None):
mpi_print
()
mpi_print
()
mpi_print
(
"
Rounding threshold:
"
,
rounding_threshold
)
mpi_print
(
"
Rounding threshold:
"
,
rounding_threshold
)
det_source_pattern
=
det_source_pattern
.
replace
(
"
*
"
,
"
{}
"
)
if
args
.
layout
is
None
:
if
args
.
layout
is
None
:
px_area
=
None
px_area
=
None
for
modno
in
modules
:
for
modno
in
modules
:
source_id
=
source_pattern
.
format
(
source_id
=
det_source_pattern
.
format
(
modno
)
detector_id
=
detector_id
,
modno
=
modno
)
if
source_id
in
dc_img
.
all_sources
:
if
source_id
in
dc_img
.
all_sources
:
break
break
shape
=
dc_img
[
source_id
,
"
image.data
"
].
shape
[
1
:]
shape
=
dc_img
[
source_id
,
"
image.data
"
].
shape
[
1
:]
...
@@ -245,7 +241,7 @@ def main(argv=None):
...
@@ -245,7 +241,7 @@ def main(argv=None):
rounding_threshold
,
px_area
=
px_area
)
rounding_threshold
,
px_area
=
px_area
)
agg
.
prepare
(
output_fn
,
mask
=
mask0
,
comm
=
comm
,
conditions
=
conditions
)
agg
.
prepare
(
output_fn
,
mask
=
mask0
,
comm
=
comm
,
conditions
=
conditions
)
agg
.
compute
(
dc_img
,
source_pattern
)
agg
.
compute
(
dc_img
,
det_
source_pattern
)
agg
.
flush
()
agg
.
flush
()
tm1
=
time
.
perf_counter
()
tm1
=
time
.
perf_counter
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment