Esempio n. 1
0
  def display(self,path):
    import wx
    from rstbx.viewer.frame import XrayFrame

    app   = wx.App(0)
    frame = XrayFrame(None, -1, "X-ray image display", size=(1200,1080))
    frame.SetSize((1024,780))
    frame.load_image(path)
    frame.Show()
    app.MainLoop()
Esempio n. 2
0
def run_one_index(path, *arguments, **kwargs):

    assert arguments[0].find("target=") == 0
    target = arguments[0].split("=")[1]

    from xfel.phil_preferences import load_cxi_phil
    if "--nodisplay" in arguments[1:]:
        display = False
        arguments = list(arguments)
        arguments.remove("--nodisplay")
    else:
        display = True

    args = [
        "indexing.data=%s" % path,
        "beam_search_scope=0.5",
        "lepage_max_delta = 3.0",
        "spots_pickle = None",
        "subgroups_pickle = None",
        "refinements_pickle = None",
        "rmsd_tolerance = 5.0",
        "mosflm_rmsd_tolerance = 5.0",
        "difflimit_sigma_cutoff=2.0",
        #"indexing.verbose_cv=True",
        "indexing.open_wx_viewer=%s" % display
    ] + list(arguments[1:])

    horizons_phil = load_cxi_phil(target, args)

    info = run_one_index_core(horizons_phil)
    info.Files = info.organizer.Files
    info.phil_params = info.horizons_phil

    # The spotfinder view within cxi.index is an anachronism; no useful purpose anymore
    # therefore remove this option within cxi.index:
    return
    work = wrapper_of_callback(info)

    if kwargs.get("display", False):
        import wx
        from rstbx.viewer import display
        from rstbx.viewer.frame import XrayFrame
        display.user_callback = work.user_callback

        app = wx.App(0)
        frame = XrayFrame(None, -1, "X-ray image display", size=(1200, 1080))
        frame.SetSize((1024, 780))
        frame.load_image(path)
        frame.Show()
        app.MainLoop()