Skip to content
Snippets Groups Projects
Commit e155e9ba authored by Egor Sobolev's avatar Egor Sobolev
Browse files

Add background estimation parameters to find_center script

parent 41ccc971
No related branches found
No related tags found
1 merge request!3Center refinement using powder diffraction data
...@@ -43,6 +43,10 @@ def main(argv=None): ...@@ -43,6 +43,10 @@ def main(argv=None):
help="Detector layout") help="Detector layout")
parser.add_argument("-c", "--calibrant", required=True, parser.add_argument("-c", "--calibrant", required=True,
choices=CALIBRANTS, help="Calibrant") choices=CALIBRANTS, help="Calibrant")
parser.add_argument("-s", "--sigma", type=float, default=2,
help="The width of gaussian filter")
parser.add_argument("--snr", type=float, default=1.5,
help="Relative threshold for background removal")
parser.add_argument("-o", "--output", default=".", parser.add_argument("-o", "--output", default=".",
help="Output directory") help="Output directory")
parser.add_argument("powder_data", parser.add_argument("powder_data",
...@@ -95,8 +99,10 @@ def main(argv=None): ...@@ -95,8 +99,10 @@ def main(argv=None):
rings = get_calibrant(args.calibrant) rings = get_calibrant(args.calibrant)
borders = BORDER_MASK[detector_type](num_modules) borders = BORDER_MASK[detector_type](num_modules)
pw = PowderDiffraction(geom, rings, clen, lmd, pw = PowderDiffraction(
border_mask=~borders, make_shadow_mask=True) geom, rings, clen, lmd, sigma=args.sigma, snr=args.snr,
border_mask=~borders, make_shadow_mask=True
)
pw.fit(img_mean, mask, num_frames) pw.fit(img_mean, mask, num_frames)
pw.refinement_info() pw.refinement_info()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment