Skip to content

Commit

Permalink
Add dummy crystal_symmetry
Browse files Browse the repository at this point in the history
  • Loading branch information
terwill authored and russell-taylor committed Jul 13, 2021
1 parent 816180c commit 83f8cfa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion iotbx/map_model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ def __init__(self,
# any_map_manager, model, ncs_object know about shift

any_map_manager = mmmn.map_manager()
# Put shifted map in the right place. It is either map_manager or map_manager_1
# Put shifted map in the right place. It is either map_manager
# or map_manager_1
if any_map_manager_is_map_manager:
map_manager = any_map_manager
else:
Expand Down
16 changes: 16 additions & 0 deletions mmtbx/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,22 @@ def get_ss_annotation(self, log=null_out()):
def set_ss_annotation(self, ann):
self._ss_annotation = ann

def add_crystal_symmetry_if_necessary(self, box_cushion = 3):
'''
If this model does not have crystal_symmetry set, create a dummy
crystal_symmetry that goes around the model. Do not shift position.
'''
if self.crystal_symmetry() and self.crystal_symmetry().unit_cell() and \
self.crystal_symmetry().space_group() :
return # nothing to do

sites_cart=self.get_sites_cart()

a,b,c = matrix.col(sites_cart.max()) - matrix.col(sites_cart.min()) + \
2 * matrix.col((box_cushion,box_cushion,box_cushion))
crystal_symmetry=crystal.symmetry((a,b,c, 90,90,90),1)
self.set_crystal_symmetry(crystal_symmetry)

def set_unit_cell_crystal_symmetry_and_shift_cart(self,
unit_cell_crystal_symmetry=None,
shift_cart=None):
Expand Down

0 comments on commit 83f8cfa

Please sign in to comment.