<commit_before>﻿# -*- coding: utf-8 -*-
u"""
.. _qook_tutorial:

Using xrtQook for script generation
-----------------------------------

- Start xrtQook: type ``python xrtQookStart.pyw`` from xrt/gui or, if you have
  installed xrt by running setup.py, type ``xrtQookStart.pyw`` from any
  location.

  .. note::
     On some Qt systems, e.g. in macOS Anaconda, the access from the Qt browser
     to local files is by default forbidden. This results in some incomplete
     rendering of the help pages in xrtQook. The solution is to use the Qt
     switch ``--disable-web-security``::

         python xrtQookStart.pyw --disable-web-security

  .. note::
     If you want to start xrtQook from Spyder, select the run option
     "Execute in an external system terminal".

- Rename beamLine to myTestBeamline by double clicking on it (you do not have
  to, only for demonstration).

- Right-click on myTestBeamline and Add Source → BendingMagnet. The same can be
  done from the icon buttons on the left.

  .. imagezoom:: _images/qookTutor01.png
     :scale: 60 %

- In its properties change eMin to 10000-10 and eMax to 10000+10. The middle of
  this range will be used to automatically align crystals (one crystal in this
  example) unless the parameter myTestBeamline.alignE sets another value. Blue
  color indicates non-default values. These will be included into the generated
  script. All the default-valued parameters do not propagate into the script.

  .. imagezoom:: _images/qookTutor02.png
     :scale: 60 %

- Create a crystalline material CrystalSi. This will create a Si111 crystal at
  room temperature.<commit_msg>:memo:  add note on scaling the GUI<commit_after>﻿# -*- coding: utf-8 -*-
u"""
.. _qook_tutorial:

Using xrtQook for script generation
-----------------------------------

- Start xrtQook: type ``python xrtQookStart.pyw`` from xrt/gui or, if you have
  installed xrt by running setup.py, type ``xrtQookStart.pyw`` from any
  location.

  .. note::
     On some Qt systems, e.g. in macOS Anaconda, the access from the Qt browser
     to local files is by default forbidden. This results in some incomplete
     rendering of the help pages in xrtQook. The solution is to use the Qt
     switch ``--disable-web-security``::

         python xrtQookStart.pyw --disable-web-security


  .. note::
      The scaling of GUI may behave differently in different systems and Qt
      versions. If it looks wrong, try the scaling options in
      ``xrtQookStart.pyw``.

  .. note::
     If you want to start xrtQook from Spyder, select the run option
     "Execute in an external system terminal".

- Rename beamLine to myTestBeamline by double clicking on it (you do not have
  to, only for demonstration).

- Right-click on myTestBeamline and Add Source → BendingMagnet. The same can be
  done from the icon buttons on the left.

  .. imagezoom:: _images/qookTutor01.png
     :scale: 60 %

- In its properties change eMin to 10000-10 and eMax to 10000+10. The middle of
  this range will be used to automatically align crystals (one crystal in this
  example) unless the parameter myTestBeamline.alignE sets another value. Blue
  color indicates non-default values. These will be included into the generated
  script. All the default-valued parameters do not propagate into the script.

  .. imagezoom:: _images/qookTutor02.png
     :scale: 60 %

- Create a crystalline material CrystalSi. This will create a Si111 crystal at
  room temperature.
{'fraction_non_alphanumeric': 0.0893371757925072, 'fraction_numerical': 0.014985590778097982, 'mean_word_length': 2.9805045871559632, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2984447', 'n_tokens_mistral': 1047, 'n_tokens_neox': 968, 'n_words': 455}