Commit c41bbf02 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Try to use image with peak finding

parent 5710b0f5
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)
def find_peaks_single_panel(cnp.ndarray[cnp.npy_float, ndim=2] data, str geom_file):
crystfel.beam_params beam
crystfel.image image
image.dp[0] =
image.det = crystfel.get_detector_geometry(os.fsencode(geom_file), &beam)
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,
print("Done peak search")
npeaks = crystfel.image_feature_count(image.features)
print(f"Found {npeaks} peaks")
......@@ -103,8 +103,8 @@ cdef extern from "crystfel/image.h":
ImageFeatureList *features
char* filename
cdef extern from "crystfel/peakfinder8.h":
int peakfinder8(
cdef extern from "crystfel/peaks.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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment