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
e78fc9de
Commit
e78fc9de
authored
9 months ago
by
Egor Sobolev
Browse files
Options
Downloads
Patches
Plain Diff
Add generation of bad pixels mask in the optimiser
parent
a1d2e368
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/geomtools/sfx/optimiser.py
+13
-1
13 additions, 1 deletion
src/geomtools/sfx/optimiser.py
with
13 additions
and
1 deletion
src/geomtools/sfx/optimiser.py
+
13
−
1
View file @
e78fc9de
...
...
@@ -2,8 +2,11 @@ import argparse
import
pathlib
import
tempfile
import
h5py
from
..detector
import
read_crystfel_geom
,
write_crystfel_geom
from
.crystfelio
import
extract_geometry
,
read_crystfel_streamfile
from
.misc
import
badpixels_mask
,
get_detector_shape
,
pixels_to_image
from
.refine
import
refine_geometry
...
...
@@ -40,9 +43,18 @@ def refine():
panels_new
,
transform
,
clen
=
refine_geometry
(
ma
,
panels
,
1.0
,
args
.
min_counts
)
with
open
(
args
.
output
.
absolute
(),
"
w
"
)
as
f
:
px
=
badpixels_mask
(
pe
,
panels
)
shape
=
get_detector_shape
(
panels
)
msk
=
pixels_to_image
(
shape
,
px
)
geom_fn
=
args
.
output
with
open
(
geom_fn
.
absolute
(),
"
w
"
)
as
f
:
write_crystfel_geom
(
f
,
panels_new
,
beam
,
[
"
modules
"
,
"
quads
"
])
mask_fn
=
geom_fn
.
parent
/
(
geom_fn
.
stem
+
"
_mask.h5
"
)
with
h5py
.
File
(
mask_fn
,
"
w
"
)
as
f
:
f
[
"
/entry_1/data_1/mask
"
]
=
msk
.
astype
(
"
u2
"
)
if
__name__
==
"
__main__
"
:
refine
()
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