def run(self, args=None): # Parse the command line params, options = self.parser.parse_args(args, show_diff_phil=True) if not params.rs_mapper.map_file: raise RuntimeError("Please specify output map file (map_file=)") else: self.map_file = params.rs_mapper.map_file # Ensure we have either a data block or an experiment list self.experiments = flatten_experiments(params.input.experiments) if len(self.experiments) != 1: self.parser.print_help() print("Please pass either an experiment list\n") return self.reverse_phi = params.rs_mapper.reverse_phi self.grid_size = params.rs_mapper.grid_size self.max_resolution = params.rs_mapper.max_resolution self.ignore_mask = params.rs_mapper.ignore_mask self.grid = flex.double( flex.grid(self.grid_size, self.grid_size, self.grid_size), 0 ) self.counts = flex.int( flex.grid(self.grid_size, self.grid_size, self.grid_size), 0 ) for experiment in self.experiments: self.process_imageset(experiment.imageset) recviewer.normalize_voxels(self.grid, self.counts) # Let's use 1/(100A) as the unit so that the absolute numbers in the # "cell dimensions" field of the ccp4 map are typical for normal # MX maps. The values in 1/A would give the "cell dimensions" around # or below 1 and some MX programs would not handle it well. box_size = 100 * 2.0 / self.max_resolution uc = uctbx.unit_cell((box_size, box_size, box_size, 90, 90, 90)) ccp4_map.write_ccp4_map( self.map_file, uc, sgtbx.space_group("P1"), (0, 0, 0), self.grid.all(), self.grid, flex.std_string(["cctbx.miller.fft_map"]), )
def run(self): from dials.util.options import flatten_datablocks # Parse the command line params, options = self.parser.parse_args(show_diff_phil=True) # Ensure we have a data block datablocks = flatten_datablocks(params.input.datablock) if len(datablocks) == 0: self.parser.print_help() return elif len(datablocks) != 1: raise RuntimeError('only 1 datablock can be processed at a time') if not params.rs_mapper.map_file: raise RuntimeError('Please specify output map file (map_file=)') else: self.map_file = params.rs_mapper.map_file self.datablocks = flatten_datablocks(params.input.datablock) if len(self.datablocks) == 0: self.parser.print_help() return self.reverse_phi = params.rs_mapper.reverse_phi self.grid_size = params.rs_mapper.grid_size self.max_resolution = params.rs_mapper.max_resolution self.grid = flex.double( flex.grid(self.grid_size, self.grid_size, self.grid_size), 0) self.cnts = flex.int( flex.grid(self.grid_size, self.grid_size, self.grid_size), 0) for datablock in self.datablocks: for imageset in datablock.extract_imagesets(): self.process_imageset(imageset) recviewer.normalize_voxels(self.grid, self.cnts) # Let's use 1/(100A) as the unit so that the absolute numbers in the # "cell dimensions" field of the ccp4 map are typical for normal # MX maps. The values in 1/A would give the "cell dimensions" around # or below 1 and some MX programs would not handle it well. box_size = 100 * 2.0 / self.max_resolution uc = uctbx.unit_cell((box_size, box_size, box_size, 90, 90, 90)) ccp4_map.write_ccp4_map(self.map_file, uc, sgtbx.space_group("P1"), (0, 0, 0), self.grid.all(), self.grid, flex.std_string(["cctbx.miller.fft_map"]))
def run(self): from dials.util.command_line import Command from dials.util.options import flatten_datablocks # Parse the command line params, options = self.parser.parse_args(show_diff_phil=True) # Ensure we have a data block datablocks = flatten_datablocks(params.input.datablock) if len(datablocks) == 0: self.parser.print_help() return elif len(datablocks) != 1: raise RuntimeError("only 1 datablock can be processed at a time") if not params.rs_mapper.map_file: raise RuntimeError("Please specify output map file (map_file=)") else: self.map_file = params.rs_mapper.map_file self.datablocks = flatten_datablocks(params.input.datablock) if len(self.datablocks) == 0: self.parser.print_help() return self.reverse_phi = params.rs_mapper.reverse_phi self.grid_size = params.rs_mapper.grid_size self.max_resolution = params.rs_mapper.max_resolution self.grid = flex.double(flex.grid(self.grid_size, self.grid_size, self.grid_size), 0) self.cnts = flex.int(flex.grid(self.grid_size, self.grid_size, self.grid_size), 0) for datablock in self.datablocks: for imageset in datablock.extract_imagesets(): self.process_imageset(imageset) recviewer.normalize_voxels(self.grid, self.cnts) uc = uctbx.unit_cell((self.grid_size, self.grid_size, self.grid_size, 90, 90, 90)) ccp4_map.write_ccp4_map( self.map_file, uc, sgtbx.space_group("P1"), (0, 0, 0), self.grid.all(), self.grid, flex.std_string(["cctbx.miller.fft_map"]), )
def run(self): from dials.util.command_line import Command from dials.util.options import flatten_datablocks # Parse the command line params, options = self.parser.parse_args(show_diff_phil=True) # Ensure we have a data block datablocks = flatten_datablocks(params.input.datablock) if len(datablocks) == 0: self.parser.print_help() return elif len(datablocks) != 1: raise RuntimeError('only 1 datablock can be processed at a time') if not params.rs_mapper.map_file: raise RuntimeError('Please specify output map file (map_file=)') else: self.map_file = params.rs_mapper.map_file self.datablocks = flatten_datablocks(params.input.datablock) if len(self.datablocks) == 0: self.parser.print_help() return self.reverse_phi = params.rs_mapper.reverse_phi self.grid_size = params.rs_mapper.grid_size self.max_resolution = params.rs_mapper.max_resolution self.grid = flex.double( flex.grid(self.grid_size, self.grid_size, self.grid_size), 0) self.cnts = flex.int( flex.grid(self.grid_size, self.grid_size, self.grid_size), 0) for datablock in self.datablocks: for imageset in datablock.extract_imagesets(): self.process_imageset(imageset) recviewer.normalize_voxels(self.grid, self.cnts) uc = uctbx.unit_cell( (self.grid_size, self.grid_size, self.grid_size, 90, 90, 90)) ccp4_map.write_ccp4_map(self.map_file, uc, sgtbx.space_group("P1"), (0, 0, 0), self.grid.all(), self.grid, flex.std_string(["cctbx.miller.fft_map"]))