Ejemplo n.º 1
0
        raise OutlierCellError(
            "Skipping cell with outlier dimensions (%g %g %g %g %g %g" %
            unit_cell.parameters())
    print >> out, "Integrated data:"
    result_array.show_summary(f=out, prefix="  ")
    # XXX don't force reference setting here, it will be done later, after the
    # original unit cell is recorded
    return obj


cxi_merge.load_result = load_result

if (__name__ == "__main__"):
    show_plots = False
    if ("--plots" in sys.argv):
        sys.argv.remove("--plots")
        show_plots = True
    result = cxi_merge.run(args=sys.argv[1:])
    if result is None:
        sys.exit(1)
    if (show_plots):
        try:
            result.plots.show_all_pyplot()
            from wxtbx.command_line import loggraph
            loggraph.run([result.loggraph_file])
        except Exception, e:
            print "Can't display plots"
            print "You should be able to view them by running this command:"
            print "  wxtbx.loggraph %s" % result.loggraph_file
            raise e
                params=self.params,
                reindex_op=reindex_op,
                out=out,
                get_predictions_to_edge=self.params.predictions_to_edge.apply,
                image_info=image_info,
                exclude_CSPAD_sensor=self.params.validation.
                exclude_CSPAD_sensor)
            if result is None:
                return null_data(file_name=file_hash,
                                 log_out=out.getvalue(),
                                 file_error=True)
        except OutlierCellError, e:
            print >> out, str(e)
            return null_data(file_name=file_hash,
                             log_out=out.getvalue(),
                             wrong_cell=True)
        except WrongBravaisError, e:
            print >> out, str(e)
            return null_data(file_name=file_hash,
                             log_out=out.getvalue(),
                             wrong_bravais=True)
        return self.scale_frame_detail(result, file_hash, db_mgr, out)


cxi_merge.scaling_manager = scaling_manager

if (__name__ == "__main__"):
    result = run(args=sys.argv[1:])
    if result is None:
        sys.exit(1)