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
ffe7d8fe
Commit
ffe7d8fe
authored
9 months ago
by
Egor Sobolev
Browse files
Options
Downloads
Patches
Plain Diff
Add minimal number of peaks which is needed to refine a panel
parent
5dc3cbdd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/geomtools/sfx/optimiser.py
+6
-3
6 additions, 3 deletions
src/geomtools/sfx/optimiser.py
src/geomtools/sfx/refine.py
+4
-2
4 additions, 2 deletions
src/geomtools/sfx/refine.py
with
10 additions
and
5 deletions
src/geomtools/sfx/optimiser.py
+
6
−
3
View file @
ffe7d8fe
...
@@ -2,9 +2,9 @@ import argparse
...
@@ -2,9 +2,9 @@ import argparse
import
pathlib
import
pathlib
import
tempfile
import
tempfile
from
.refine
import
refine_geometry
from
.crystfelio
import
extract_geometry
,
read_crystfel_streamfile
from
..detector
import
read_crystfel_geom
,
write_crystfel_geom
from
..detector
import
read_crystfel_geom
,
write_crystfel_geom
from
.crystfelio
import
extract_geometry
,
read_crystfel_streamfile
from
.refine
import
refine_geometry
def
refine
():
def
refine
():
...
@@ -14,6 +14,8 @@ def refine():
...
@@ -14,6 +14,8 @@ def refine():
help
=
"
Crystfel stream file
"
)
help
=
"
Crystfel stream file
"
)
parser
.
add_argument
(
'
-c
'
,
'
--connected
'
,
default
=
"
modules
"
,
parser
.
add_argument
(
'
-c
'
,
'
--connected
'
,
default
=
"
modules
"
,
help
=
"
Collection of rigid groups to pose
"
)
help
=
"
Collection of rigid groups to pose
"
)
parser
.
add_argument
(
'
-m
'
,
'
--min-counts
'
,
type
=
int
,
default
=
50
,
help
=
"
Minimum counts per group
"
)
parser
.
add_argument
(
'
-o
'
,
'
--output
'
,
type
=
pathlib
.
Path
,
parser
.
add_argument
(
'
-o
'
,
'
--output
'
,
type
=
pathlib
.
Path
,
default
=
pathlib
.
Path
(
"
refined.geom
"
),
default
=
pathlib
.
Path
(
"
refined.geom
"
),
help
=
"
File to store refined geometry
"
)
help
=
"
File to store refined geometry
"
)
...
@@ -35,7 +37,8 @@ def refine():
...
@@ -35,7 +37,8 @@ def refine():
fr
,
pe
,
la
,
re
,
ma
=
read_crystfel_streamfile
(
fr
,
pe
,
la
,
re
,
ma
=
read_crystfel_streamfile
(
stream_filename
,
panels
,
args
.
connected
,
disp
=
True
)
stream_filename
,
panels
,
args
.
connected
,
disp
=
True
)
panels_new
,
transform
,
clen
=
refine_geometry
(
ma
,
panels
,
1.0
)
panels_new
,
transform
,
clen
=
refine_geometry
(
ma
,
panels
,
1.0
,
args
.
min_counts
)
with
open
(
args
.
output
.
absolute
(),
"
w
"
)
as
f
:
with
open
(
args
.
output
.
absolute
(),
"
w
"
)
as
f
:
write_crystfel_geom
(
f
,
panels_new
,
beam
,
[
"
modules
"
,
"
quads
"
])
write_crystfel_geom
(
f
,
panels_new
,
beam
,
[
"
modules
"
,
"
quads
"
])
...
...
This diff is collapsed.
Click to expand it.
src/geomtools/sfx/refine.py
+
4
−
2
View file @
ffe7d8fe
import
time
import
time
import
numpy
as
np
import
numpy
as
np
import
pandas
as
pd
import
pandas
as
pd
from
natsort
import
natsorted
from
natsort
import
natsorted
def
refine_geometry
(
matches
,
panels
,
clen_scale
=
1.
,
def
refine_geometry
(
matches
,
panels
,
clen_scale
=
1.
,
min_counts
=
50
,
rigid_group
=
"
modules
"
,
disp
=
True
):
rigid_group
=
"
modules
"
,
disp
=
True
):
transform
=
{}
transform
=
{}
clen
=
panels
.
clen
[
0
]
clen
=
panels
.
clen
[
0
]
...
@@ -21,6 +21,8 @@ def refine_geometry(matches, panels, clen_scale=1.,
...
@@ -21,6 +21,8 @@ def refine_geometry(matches, panels, clen_scale=1.,
groups
=
matches
[
columns
].
groupby
(
rigid_group
)
groups
=
matches
[
columns
].
groupby
(
rigid_group
)
for
modname
,
mp
in
natsorted
(
groups
):
for
modname
,
mp
in
natsorted
(
groups
):
count
=
len
(
mp
)
count
=
len
(
mp
)
if
count
<
min_counts
:
continue
# AGIPD1M layout
# AGIPD1M layout
ss_p
=
mp
.
ss_p
+
(
np
.
round
(
mp
.
ss_p
)
//
64
)
*
2
ss_p
=
mp
.
ss_p
+
(
np
.
round
(
mp
.
ss_p
)
//
64
)
*
2
...
...
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