pace-neutrons / Horace

Horace is a suite of programs for the visualization and analysis of large datasets from time-of-flight neutron inelastic scattering spectrometers.
https://pace-neutrons.github.io/Horace/stable/
GNU General Public License v3.0
7 stars 4 forks source link

reverting incorrect changes to sphere and cylinder proj descriptions #1686

Closed abuts closed 2 months ago

abuts commented 2 months ago

I believe, recent changes to ortholinear proj description are incorrect. The discussion on this matter are as follows: https://pace-neutrons.slack.com/archives/C05E5KBQE9X/p1715678054094759 This ticket is to revert the changes pending further discussion.

abuts
  19:02
@Jacob Wilkins
 I suspect the images for spherical/cylindrical coordinate system are incorrect as well. you write w = [u x v] but this is correct only if lattice is orthogonal. u,v are in crystal Cartesian so if lattice is non-orthogonal, this is incorrect. Or it is not-obvious it is correct. If this is wrong, formulas are probably also wrong.
[19:02](https://pace-neutrons.slack.com/archives/C05E5KBQE9X/p1715623357899779)
let me check
19:07
bm = bmatrix([1,2,3],[70,60,35])
bm =
   11.9977   -4.4032   -0.9956
         0    3.3432   -0.7623
         0         0    2.0944
>> u = [1,0,0]
u =
     1     0     0
>> v = [1,1,0]
v =
     1     1     0
>> co = cross(u,v)
co =
     0     0     1
>> co_cc = bm*co'
co_cc =
   -0.9956
   -0.7623
    2.0944
>> co_cc = cross(bm*u',bm*v')
co_cc =
         0
         0
   40.1108 (edited) 
19:08
Absolutely different vectors. Your "simplification" is incorrect. I am not sure who you were discussed your changes with but they are wrong (edited) 
19:10
your formulas are also wrong. I should probably revert your changes.
19:10
this is probably the source of the issues you are having with symmetrization in non-orthogonal lattice.

abuts
  19:21
spherical/cylindrical coordinate systems are related to Crystal Cartezian coordinate system not the reciprocal lattice, as you changes imply

abuts
  09:32
@Chris Marooney
 -- do you need me personally in the meeting at 16Pm or we can do it on-line? Today I again need to go to Swindon to pick up remaining drugs at around 1Pm. From here its 30 min journey. To office its 1hr journey from there, so I would better work from home today, but can get to office if necessary.
Sorry, Misread dates. Meeting tomorrow. I am working from home today.
[@Jacob Wilkins](https://pace-neutrons.slack.com/team/U01EHTRUSKS)
 -- any objection on reverting your images of ortholinear coordinate system and correspondent formulas? (edited) 
09:35
Almost finished changes to documentation (projection bugs pending) and may be quick glance through remaining docs. Hope to start with projection scales if not found something substantial to add to docs. (edited) 

Toby Perring
  09:47
Standup: inching forward on detector averaging from .nxspe files, but for the next two weeks it will be a crawl...

Jacob Wilkins
  09:51
Yes I have objections:
None of the parts mention spaces, so whether it's in crystal cartesian space or otherwise makes no difference., in fact, non-orthogonality of the lattice is defined as a special case extra to this. It seems like what would be more useful would simply be a note defining the space in which these projections are taken to clarify the docs for non-orthogonal lattices as special cases and leave the simple equations where people can parse them out. Perhaps with a reference to the full form for non-orthogonal lattices.
u and v are declared to be vectors in hklE if this is not the case more things need to be changed than those
This seems to suggest that doing a spherical cut in a non-orthonormal lattice would result in an hklE ellipsoid which I would think would go against natural expectations
I think more importantly you need to find someone (not you) who will do a non-orthogonal spherical cut (no guidance, just the docs) and see if it meets their expectations or if there is confusion (edited) 
09:54
Standup: Mostly fixing issues with existing PRs and addressing comments in review

abuts
  09:54
"u and v are declared to be vectors in hklE if this is not the case more things need to be changed than those".
u, v are vectors in hklE and they define the position of the coordinate system in Crystal Cartesian coordinates. Crystal Cartesian have vectors e_x, e_z which were unit vectors of orthogonal system coordinate. This is clear from my formulas, but indeed, not everybody can read the formulas. Additional description in words may be useful. (edited) 

Jacob Wilkins
  09:54
I presume you mean orientation, the position is presumably the offset.

abuts
  09:54
The space makes difference, as spherical coordinate systems (angles) is calculated from vectors in Crystal Cartesian
09:55
they coincide only in case of orthogonal lattice
09:55
yes, I mean orientation
09:56
in my initial document I had orthogonal and non-orthogonal lattice separately, but would agree that it is fine to define them on a single image. As it was done in my version of images. (edited) 

Jacob Wilkins
  09:57
But nobody could understand that diagram

abuts
  09:58
Douing spherical cut in non-orthogonal lattice would indeed produce hklE ellipsoid and would go according to natural expectations (edited) 
09:58
I have no experience in elliptical coordinate system so did not pursued this direction
10:00
Many symmetries of non-orthogonal coordinate system are violated by current spherical projection unlike what is implied from your image
10:01
If I am implementing elliptical cut, I would indeed need guidance from expert in non-orthogonal lattice.
10:02
I am doing spherical/cylindrical cuts in Crystal Cartesian, this is pretty simple example I have implemented
10:03
This what my image was describing and is missing in yours.

abuts
  10:10
"But nobody could understand that diagram"
Your understandable diagram is incorrect for non-orthogonal lattice.  May be better description is needed but I want indeed to talk to somebody who did not understand it to see what needs to be added
10:14
I am reverting images and formulas because yours are wrong and leave further clarification for the discussion.
10:17
May be a sentence "u,v define Crystal Cartesian coordinate system used as the basis of the spherical coordinate system" would be enough to clear misunderstanding. This was written in formulas, but words would be helpful indeed. (edited)
abuts commented 2 months ago

Resolved through Re #1689

abuts commented 2 months ago

sorted by Re #1689