# -*- org -*-

* 5.1.9 UNRELEASED
** Binoculars-ng (Haskell program)
   - Added support for mars mesh. (2D scan).
   - Added the =input.flatmatrix= parameter which allows to provide a
     way to correct each pixel with a different value. This parameter
     can contain the =default= value (specific to each kind of
     detector), or directly the path to a =.npy= file cointaining the
     values. If this parameter is not provided, the default value is
     =default=.
* 5.1.8 <2026-04-02 jeu.>
** Binoculars (C-library)
   - Added support for uint8 images.
** Binoculars-ng (Haskell program)
   - Added the =input.dynamic_mask= parameter in the configuration in
     order to deal with hot detector's pixels. This parameter takes
     only one =double= value which mask all pixels above it.
* 5.1.7 <2026-02-16 lun.>
** Tests
   - fixes typo when checking for arch (arm64 and ppc64el)
* 5.1.6 <2026-02-16 lun.>
** Tests
   - updated the sha256 for the =CIRPAD= detector on numerous
     architectures. It i snow possible to skip these test or an
     architecture by using the =NULL= sha256.
* 5.1.5 <2026-02-13 ven.>
** Binoculars-ng (Haskell program)
   - Build with ghc 9.10 (Debian unstable)
** Ghkl (Gui)
   - add toggled buttons in order to display bullet internal and/or
     openGL model. It helps when debuging collision issues.
** Hkl (C-library)
   - Added the =SOLEIL CRISTAL K4C= diffractometer.
* 5.1.4 <2026-01-20 mar.>
** Build system
   - It is now possible to gives a CABALFLAGS on the command line.
     The haskell code was instrumented to support a new option
     useThreaded. This options is activated by default, but some
     architecture do not supporte threading, so in order to allow
     build and test on these architectures, is is possible to call
     configure like this.
     #+begin_src shell
       ./configure CABALFLAGS="-f -useThreaded"
     #+end_src
   - remove old ICA files, used by the old maven build system.
** Binoculars (C-library)
   - Added support for double images.
   - Added the `hkl_binoculars_detectors_2d_img_load` in order to
     load rigaku img files. For now only uint16_t images.
   - Added the Rigaku XSPA 1M detector (RigakuXspa1M).
   - fixed the polarisation correction.
   - switch the photons array to float in order to deal with small corrections. (polarisation)
   - limit the stereo projection to the north pole.
** Binoculars-ng (Haskell program)
   - dispatcher.ncores = 0 mean: use all capabilities of the CPU hardware.
     The default remains equal to `4` if this property is not defined.
   - Projections
     - 'q_thetax_phix' -> latitude and longitude of q with qx as reference.
     - 'q_thetay_phiy' -> latitude and longitude of q with qy as reference.
     - 'q_thetaz_phiz' -> latitude and longitude of q with qz as reference.
   - DataSource
     - better error message when we do not find the data's. It display
       the faulty DataSourcePaths.
     - When opening a datafile, display the real DataSource of the DataFrame.
   - DataSource Image
     - support for double image from hdf5 files.
     - Added a constructor in order to read the Rigaku images.
       `DataSourcePath'Image'Img (Detector Hkl DIM2) (DataSourcePath Attenuation) Text Scannumber`
     - Added a new constructor for dummy images.
       DataSourcePath'Image'Dummy.

       this is usefull if you want to obtain a cube with the intensity
       corrections (polarisation) . Just set all the image pixels
       values to 1.0 and voilà.
** Documentation
   - Updated thanks to Didier Weirmeille from the ESRF
** Hkl3D (Anticollision)
  - switch from the g3d un-maintained library to assimp in order to
    read model files.
  - full rewrite of the configure file parser. (it should be more
    robust now).
** Gui
   - migrated from gtk3 to gtk4.
** Tests
   - binoculars-ng detectors tests are using sha256 in order to check
     mask and coordinates integrity. If you change a detector
     definition you need to update the sha256 fingerprint in the
     hkl-binoculars_t.c file.

     example of a failure:

     detector 9 fingerpring: 5c747478f67ad54485bc3502c825bff41c0934c94a0160179909c483d75f541a , expected: 49885be2c9cfea697b8f6a6e0c00f9dec687760a8b4cfdb4eda94af1014322ce
     not ok 3 - mask_get
* 5.1.3 <2025-01-15 mer.>
** Lib binoculars
   - it is now possible to mask a ring of n pixels around each module.
     Most of the times these pixel's statistics are bad.
** Binoculars-ng
   - Added float64 support for masks
   - It is possible to define a fall back for mask location with this
     syntax. `my_first_mask.npy | my_second_mask.npy`

* 5.1.0 <2024-10-15 mar.>
** General
   - 5.x runtime can be co-installed with the 4.x series.
   - hkl.h contain all the Public API.
   - A clear separation between the public and private API was
     achieved, in order to propose a Long Time Support of the
     5.x series.
   - c-tap-hardness library was embeded to provide the unit test
     framework.
   - gobject-instrospection provide the binding support. Look at this
     [[https://gi.readthedocs.io/en/latest/][page]] for more informations.
   - Documentation was generated with org-mode and asymptote for the figures.
   - New diffractometers added
     - APS POLAR thanks to Pete R. Jemian <jemian@anl.gov>.
     - E4CH (eulerian 4 circles horizontal) geometry.
     - MARS beamline (SOLEIL) eulerian 4 circles vertical geometry.
     - SOLEIL SIRIUS KAPPA
     - SOLEIL SIRIUS TURRET
   - New Pseudo Axes engines.
     - qper_qpar
   - A not yet public hkl3d library used only by the gui allow to
     compute (Bullet) and display (OpenGL) collision for model
     described using the COLLADA file format.
   - all private symbols are now hidden.
** Binoculars-ng
   - Added this new program in order to project 2D Detectors images in
     the hkl reciprocal space, qxqyqz, etc... It support for now a
     bunch of Soleil beamlines experiments (all SIXS geometries, MARS,
     CRISTAL and DIFFABS).
   - make it compile with ghc 9.6
   - Added support for mask per scan.
** Buildsystem
   - add a --disable-hkl3d flag to avoid hkl3d library compilation.
   - replace the --enable-ghkl with a --disable-gui.
   - use ./configure --help for all the options
** Gui
   - Rewriten using Gtk instead of Gtkmm, in order to minimise the
     required dependencies.
   - Added a 3D view to display diffractometers and collisions.
   - Added the K6C 3D model.
** Bindings
   - Provide the garantie via unit tests that the python API will be
     stable during all the 5.x lifetime.
   - For other languages look at [[https://gi.readthedocs.io/en/latest/users.html][here]].

* 5.0.0.3381 <2023-11-21 mar.>
- fix for real the HklLattice segfault <2023-11-21 mar.>
- added the [qx_qy|qx_qz|qy_qz]_timestamp custom projection to binoculars-ng <2023-11-20 Mon>
- added the q_sampleaxis_timestamp custom projection to binoculars-ng <2023-11-17 Fri>
- fix the segfault when trying to create a non valid HklLattice <2023-11-17 Fri>
* 5.0.0.2661 <2020-10-02 Fri>
** Only finite float values are allow when setting an HklParameter value or range.
When using =hkl_parameter_value_set= or
=hkl_parameter_min_max_set= functions it is not allowed to use the
float =NaN=, =-Inf=, =+Inf= value.
** use python3 instead of python2 for unit tests
In order to prepare the removal of python2 for Debian 11, we
switched the unit test. The remaining part is during the build of
the documentation. The best would be to report a bug against emacs
in order to set python3 as default python interpreter.
** Added the Soleil Nanoscopium robot setup.
* 5.0.0.2456 <2018-02-22 Thu>
** add emergence on all e4c diffractometers <2017-03-16 Thu>
    The emergence pseudo axis was added to =SOLEIL MARS= and =E4CV=
** Fix for multiarch (headers) <2016-05-04 mer.>
    The =ccan_config.h= generated file is arch specific. It is then
    necessary to install this file under /usr/include/<triplet> on
    Debian like systems. This way it will be possible to co-installa
    32/64 bit version of hkl, or to do cross-compilation (arm on
    x86_64, etc...)
** Fix the FTBFS with the new bullet 2.86.1 version <2017-08-13 dim.>
    In order to update the internal structures of =Hkl3DObject= (the
    =is-colliding= member), we were using a callback which became
    un-effective with this new version of bullet. The logic was
    rewritten in order to be much more efficient using the manifold
    informations. Now we iterate on =Hkl3DObject= object only once
    (n) complexity instead of (n²) with the previous one.
** Added "SOLEIL SIXS MED2+3 v2" geometry <2019-03-29 Fri>
This diffractometer contains a global HklEngineList parameter in
order to activate or not the rotation of the Detector. A new
public API was added in order to deal with these parameters.
#+begin_src c
  const darray_string *hkl_engine_list_parameters_names_get(const HklEngineList *self);

  const HklParameter *hkl_engine_list_parameter_get(const HklEngineList *self, const char *name,
                                                    GError **error);

  int hkl_engine_list_parameter_set(HklEngineList *self,
                                    const char *name, const HklParameter *parameter,
                                    GError **error);

  void hkl_engine_list_parameters_values_get(const HklEngineList *self,
                                             double values[], size_t n_values,
                                             HklUnitEnum unit_type);

  int hkl_engine_list_parameters_values_set(HklEngineList *self,
                                            double values[], size_t n_values,
                                            HklUnitEnum unit_type, GError **error);
#+end_src

And also available via the Python binding.

#+begin_src python :export code
  engines = factory.create_new_engine_list()

  # get parameters names
  names = engines.parameters_names_get()

  # get the parameters values
  values = engines.parameters_values_get(Hkl.UnitEnum.USER)

  # set the parameters values
  engines.parameters_values_set(values, Hkl.UnitEnum.USER)
#+end_src

* 5.0.0.2080 <2016-04-27 mer.>
** =HklEngine= <2016-01-20 mer.>
    emergence_fixed for the SOLEIL SIX MED 2+2 geometry.
** =HklVector= <2016-02-09 mar.>
    The hkl_vector_init method is now public.
** =HklParameter= <2016-02-25 Thu>
    At the end of the computation all solutions are filtered in order
    to check that they are valid (min < value < range). BUT for a
    rotation axis this check was instead (min < value % 2pi < max).
** =HklGeometry= <2016-04-20 mer.>
    Add hkl_geometry_[sample/detector]_rotation_get method. It is now
    possible to get the sample or the detector rotation expressed as a
    =HklQuaternion=.
#+begin_src python :export code
  qr = geometry.sample_rotation_get(sample)
  qd = geometry.detector_rotation_get(detector)
#+end_src
** =HklQuaternion= <2016-04-20 mer.>
    Add hkl_quaternion_to_matrix in order to convert a =HklQuaternion=
    into a =HklMatrix=. Then you just need to convert this HklMatrix
    into a numpy array when used from the python binding
#+begin_src python :export code
  def hkl_matrix_to_numpy(m):
      M = empty((3, 3))
      for i in range(3):
          for j in range(3):
              M[i, j] = m.get(i, j)
      return M


  M = hkl_matrix_to_numpy(q.to_matrix())
#+end_src
** Soleil Sirius Turret <2016-04-26 mar.>
    Add the =basepitch= axis which rotate around $\vec{y}$ in mrad.
* 4.99.99.1955 <2015-07-15 mer.>
   Add the ccan_config.h public header. This header is generated with
   the ccan configurator program.
* 4.99.99.1950 <2015-07-07 mar.>
   Fix an FTBFS observed on the sparc arch
* 4.99.99.1949 <2015-07-03 ven.>
** =HklInterval= <2015-07-03 ven.>
    =hkl_interval_cmp= was wrong. Now the comparison is done between
    =HKL_EPSILON= and the distance between minimum and maximum. This
    problem was triggered first on ppc64el architecture.
** PATH_MAX <2015-07-03 ven.>
    Replace getcwd called by get_current_dir_path instead in order to
    avoid PATH_MAX which is not available on hurd.
* 4.99.99.1946 <2015-06-30 mar.>
** =HklEngine=
*** "emergence" <2015-06-22 lun.>
     Add a new emergence engine which contains only one pseudo axis.
     + =emergence= the outgoing beam emergence from the sample's surface.
     + =azimuth= the sample's surface azimuth.
* 4.99.99.1940 <2015-05-04 lun.>
** =HklLattice= add an =hkl_lattice_volume_get=
#+begin_src c
  volume = hkl_lattice_volume_get(lattice);
#+end_src
** =HklEngine=
*** "nrj, sample, ...  dependencies" <2015-03-24 mar.>
     Add the =hkl_engine_dependencies_get= method which return if the
     =HklEngine= depends of the axes, the energy, or the sample. the
     possible values are stored in the =HklEngineDependencies= enum.

#+begin_src c
  dependencies = hkl_engine_dependencies_get(engine);
  if (dependencies & HKL_ENGINE_DEPENDENCIES_ENERGY) {
          ...
  }
  if (dependencies & HKL_ENGINE_DEPENDENCIES_SAMPLE) {
          ...
  }
  ...
#+end_src
*** "tth2" <2015-04-03 ven>
     Add a new hkl engine which contains two pseudo axes.
     + =tth=  two times the diffraction angle $\theta$
     + =alpha= the azimuth of q in the zOy plan.
*** "incidence" <2015-04-21 mar.>
     Add a new incidence engine which contain only one pseudo axis.
     + =incidence= the incoming beam incidence on the sample surface.
     + =azimuth= the sample surface azimuth.
*** =hkl_engine_parameter_set= <2015-05-04 lun.>
     Fix a bug and expose the method in the binding.
*** general
     - use #define AXIS "axis_name" in all the code to set the axes
       names at only one place. <2015-04-23 jeu.>
** =HklLattice= expose in the binding the _x_get/set methods <2015-03-24 mar.>
    Now you can use hkl_lattice_x_get where x=a, b, c, alpha, beta,
    gamma in the bindings.
#+begin_src python :export code
  a = lattice.a_get()
  lattice.a_set(a)
#+end_src
** =HklSampleReflection= expose the flag_get/set and geometry_get/set method <2015-03-24 mar.>
It is now possible to change the geometry stored in a reflection via
the bindings.
#+begin_src python :export code
  flag = reflection.flag_get()
  reflection.flag_set(flag)

  geometry = reflection.geometry_get()
  geometry.axes_values_set([omega, chi, phi, ...])
  reflection.geometry_set(geometry)
#+end_src
* 4.0.4	UNRELEASED
	* add the SOLEIL SIXS MED2+2 diffractometer
	  - engine: hkl
	    - mode: reflectivity.
	  - engine: qper_qpar
	* add the SOLEIL MARS diffractometer
	  - engine: qper_qpar
	* add the PETRA3 P09 EH2 diffractometer
	  - engine: qper_qpar
	* modified E6C
	  - engine: qper_qpar
	  - add modes : hkl psi_constant_horizontal, constant_mu_horizontal
	* K6C
	  - engine hkl:
	    - add the constant_incidence mode
	  - engine: qper_qpar
	* add the sphinx documentation

* 4.0.3	<2010-06-06 dim.>
	* remove the usage.c file to avoid a GPL2-GPL3+ incompatibility
	* update the documentation
	* fix warning catched by clang
* 4.0.2	<2010-06-01 mar.>
	* add the ghkl manpage and .desktop file
	* fix the ghkl quit menuitem bugs

* 4.0.1	<2010-05-10 lun.>
	* fix a few ghkl bugs (.ui files installation)
	* add a --enable-ghkl=[yes,no] flag to allow compiling the gui interface
	* do not forgot to link ghkl against gsl.
	* display by default the preference panel of ghkl.

* 4.0.0	<2010-04-14 mer.>
	* add the autotools buildsystem and remove all other systems.
	* add a GUI ghkl for testing purpose based on gtkmm.
	* add the GNU info doc
	* add the gtk-doc to document the api (work in progress)
	* new structure for the HklDetector (prepare for 2D detectors)
	* HklGeometryConfig shared between all equivalent HklGeometries.
	* fix for 64 bits computers runtime error.
	* add the GError class to report calculation errors (not yet used)
	* new way to set the UB matrix of a sample (hkl_sample_set_UB).
	* new ZAxis geometry
		- mode zaxis
		- mode reflectivity (mu = gamma)
* 3.0.1	<2009-10-23 ven.>

	* add the psi_constant mode to the e4cv, e6c, k4cv and k6c geometries. (thanks teresa)
	* upgrade the user guide to explain how to add a mode.
	* the horizontal modes are also valid if omega = +-PI. (e6c, k6c)
	* remove geometries with an invalid range from the list of solutions.

* 3.0.0	<2009-07-15 mer.>

	* Rewrote from scratch in C with the GSL library.
		- now most of pseudo axes modes are numeric.
		  So a 6 circles mode is now a real 6 circles mode.
	* Eulerian 4 circles
		- PseudoAxisEngine  "hkl": "h", "k", "l"
			* Mode "bissector"
			* Mode "constant_omega"
			* Mode "constant_chi"
			* Mode "constant_phi"
			* Mode "double_diffraction"
		- PseudoAxisEngine "psi": "psi"
			* Mode "psi"
	* Kappa 4 circles
		- PseudoAxisEngine  "hkl": "h", "k", "l"
			* Mode "bissector"
			* Mode "constant_omega"
			* Mode "constant_chi"
			* Mode "constant_phi"
			* Mode "double_diffraction"
		- PseudoAxisEngine "psi": "psi"
			* Mode "psi"
		- PseudoAxisEngien "eulerians": "omega", "chi", "phi"
			* mode "eulerians"
	* Eulerian 6 circles
		- PseudoAxisEngine  "hkl": "h", "k", "l"
			* Mode "bissector_vertical"
			* Mode "constant_omega_vertical"
			* Mode "constant_chi_vertical"
			* Mode "constant_phi_vertical"
			* Mode "double_diffraction_vertical"
			* Mode "lifting_detector"
			* Mode "bissector_horizontal"
			* Mode "double_diffraction_horizontal"
		- PseudoAxisEngine "psi": "psi"
			* Mode "psi"
	* Kappa 6 circles
		- PseudoAxisEngine  "hkl": "h", "k", "l"
			* Mode "bissector_vertical"
			* Mode "constant_omega_vertical"
			* Mode "constant_chi_vertical"
			* Mode "constant_phi_vertical"
			* Mode "double_diffraction_vertical"
			* Mode "lifting_detector"
			* Mode "bissector_horizontal"
			* Mode "constant_phi_horizontal"
			* Mode "constant_kphi_horizontal"
			* Mode "double_diffraction_horizontal"
		- PseudoAxisEngine "psi": "psi"
			* Mode "psi"
		- PseudoAxisEngien "eulerians": "omega", "chi", "phi"
			* mode "eulerians"

* 2.3.0 <2007-01-24 mer.>

    * Refactoring of the sample part.
      - It is now possible to create different kind of samples easily.
        - MonoCrystal type.

    * Diffractometers:
      - Eulerian 6 Circles.
      - kappa 4 Circles Vertical.

    * Refactoring of the PseudoAxe part.
      - Derived PseudoAxe can be created from an already existing PseudoAxe if the Geometry conversion exist.
      - Better related PseudoAxes (ex Eulerians on a Kappa)
      - The PseudoAxe is just a interface, computation is done by the PseudoAxeEngine.
      - Eulerian 4 Circles Vertical
        - "th2th" : derived from the twoC
        - "q2th" : derived from the twoC
        - "q" : derived from the twoC
      - kappa 4 Circles Vertical
        - "omega", "chi", "phi" : eulerian 4 circles Vertical pseudoAxes.
        - "th2th" : derived from the twoC
        - "q2th" : derived from the twoC
        - "q" : derived from the twoC
        - "psi" : derived from the Eulerian 4 Circlers Vertical.
      - Eulerian 6 Circles:
        - "tth" : 2 * theta
        - "q" : 2 * tau * sin(theta) / lambda
        - "psi" : derived from the Eulerian 4 Circlers Vertical.
      - Kappa6C
        - "omega", "chi", "phi" : derived from the Kappa 4 Circles Vertical.
        - "tth" derived from the Eulerian6C.
        - "q" derived from the Eulerian6C.
        - "psi" : derived from the Eulerian 4 Circlers Vertical.

    * Refactoring of the Modes.
      - Derived Mode can be created from an already existing Mode if the Geometry conversion exist.
      - all Eulerian 4 Circles on the kappa4C, Eulerian6c and Kappa6C diffractometers.

* 2.2.0 <2006-06-19 lun.>

    * Diffractometers:
      - twoC Vertical.
      - Eulerian 4 Circles Vertical.
      - Kappa 6 Circles.

    * PseudoAxes
      - twoC
        - "th2th": omega - 2theta (domega = d2theta / 2)
        - "q2th" : omega - 2theta (domega = d2theta / 2) but q2th = 2 tau sin(theta) / lambda
        - "q" : 2 * tau * sin(theta) / lambda
      - Eulerian 4 Circles Vertical
        - "th2th": omega - 2theta (domega = d2theta / 2)
        - "q2th" : omega - 2theta (domega = d2theta / 2) but q2th = 2 tau sin(theta) / lambda
        - "q" : 2 * tau * sin(theta) / lambda
        - "psi" : Rotation of the sample oaround the Q vector.

    * Modes
      - twoC
        - "symetric" (omega = theta, 2theta = 2 * theta)
        - "fix incidence" (omega = free, 2theta = 2 * theta)
      - Eulerian 4 circles:
        - "Bissector"
        - "Delta Theta"
        - "Constant Omega"
        - "Constant Chi"
        - 'Constant Phi"
      - Kappa6C
        - all Eulerian 4 Circles modes.
