Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omit overlapping shoeboxes because we can't handle them yet #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions adse13_187/adse13_221/basic_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import math
from scipy import constants
ENERGY_CONV = 1e10*constants.c*constants.h / constants.electron_volt
REFL_BORDER = 3
SLOW_SIZE = 254
FAST_SIZE = 254
PANEL_SIZE = SLOW_SIZE * FAST_SIZE

class MCMC_manager:
def get_amplitudes(self, dials_model, refl_table, test_without_mpi=True):
Expand All @@ -32,6 +36,34 @@ def set_whitelist(self,value):
from LS49.adse13_187.adse13_221.lunus_wrap import mask_manager
class basic_run_manager(mask_manager):

def remove_overlaps(self):
refl = self.refl_table
pixels_irefls = dict()
irefls_noduplicates = flex.bool(refl.size(), True)
for i_refl in range(refl.size()):
pixels = []
bbox = refl[i_refl]['bbox']
panel = refl[i_refl]['panel']
slow_min = max(0, bbox[2]-REFL_BORDER)
slow_max = min(SLOW_SIZE, bbox[3]+REFL_BORDER)
fast_min = max(0, bbox[0]-REFL_BORDER)
fast_max = min(FAST_SIZE, bbox[1]+REFL_BORDER)

for i_slow in range(slow_min, slow_max):
for i_fast in range(fast_min, fast_max):
px = panel*PANEL_SIZE + i_slow*SLOW_SIZE + i_fast
pixels.append(px)

for px in pixels:
if px in pixels_irefls: #pixel in multiple shoeboxes
pixels_irefls[px].append(i_refl)
for i in pixels_irefls[px]:
irefls_noduplicates[i] = False
else:
pixels_irefls[px] = [i_refl]

self.refl_table = refl.select(irefls_noduplicates)

def refl_analysis(self,dials_model):
"""This function sets up some data structures (spots_*) allowing us to index into the spots
and pixels of interest. These will be repeatedly used during parameter refinement
Expand Down
1 change: 1 addition & 0 deletions adse13_187/adse13_221/mcmc_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def parse_input():
def run(params):
basename = "%s_%05d."%(params.output.label, params.output.index)
M = mcmc_run_manager.from_files(params.trusted_mask, params.refl, params.expt)
M.remove_overlaps()
M.get_trusted_and_refl_mask()
M.refl_analysis(params.cryst) # new
M.simple_rmsd() # new
Expand Down