Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Kluyver
Pycrystfel
Commits
c41bbf02
Commit
c41bbf02
authored
Jan 08, 2021
by
Thomas Kluyver
Browse files
Try to use image with peak finding
parent
5710b0f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
pycrystfel/bindings.pyx
View file @
c41bbf02
import
os
cimport
numpy
as
cnp
from
.
cimport
crystfel
def
progress_bar
(
val
,
total
,
text
):
...
...
@@ -13,3 +15,21 @@ def inspect_geom_file(path):
print
(
"panel names:"
,
[
det
.
panels
[
i
].
name
for
i
in
range
(
det
.
n_panels
)])
print
(
"photon energy:"
,
beam
.
photon_energy
)
crystfel
.
free_detector_geometry
(
det
)
def
find_peaks_single_panel
(
cnp
.
ndarray
[
cnp
.
npy_float
,
ndim
=
2
]
data
,
str
geom_file
):
cdef
:
crystfel
.
beam_params
beam
crystfel
.
image
image
image
.
dp
[
0
]
=
data
.
data
image
.
det
=
crystfel
.
get_detector_geometry
(
os
.
fsencode
(
geom_file
),
&
beam
)
crystfel
.
search_peaks_peakfinder8
(
image
,
max_n_peaks
=
200
,
threshold
=
20
,
min_snr
=
3
,
min_pix_count
=
2
,
max_pix_count
=
200
,
local_bg_radius
=
3
,
min_res
=
0
,
max_res
=
1200
,
use_saturated
=
True
,
)
print
(
"Done peak search"
)
npeaks
=
crystfel
.
image_feature_count
(
image
.
features
)
print
(
f
"Found
{
npeaks
}
peaks"
)
pycrystfel/crystfel.pxd
View file @
c41bbf02
...
...
@@ -103,8 +103,8 @@ cdef extern from "crystfel/image.h":
ImageFeatureList
*
features
char
*
filename
cdef
extern
from
"crystfel/peak
finder8
.h"
:
int
peakfinder8
(
cdef
extern
from
"crystfel/peak
s
.h"
:
int
search_peaks_
peakfinder8
(
image
*
img
,
int
max_n_peaks
,
float
threshold
,
float
min_snr
,
int
min_pix_count
,
int
max_pix_count
,
int
local_bg_radius
,
int
min_res
,
int
max_res
,
int
use_saturated
...
...
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