Ticket #11020 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Create internal projection type

Reported by: Harry Jeffery Owned by: Harry Jeffery
Priority: major Milestone: Release 3.4
Component: Direct Inelastic Keywords:
Cc: Blocked By:
Blocking: #11021, #11316 Tester: Andrei Savici

Description

See http://docs.mantidproject.org/nightly/algorithms/CutMD-v1.html

In the usage example the projection is built by hand. This is inconvenient. There should be a Projection object that can be used to generate these projections manually. There also needs to be Python bindings for this object, so that it can be used by python algorithms, such as CutMD.

Change History

comment:1 Changed 6 years ago by Harry Jeffery

  • Blocking 11021 added

comment:2 Changed 6 years ago by Harry Jeffery

  • Status changed from new to assigned

comment:3 Changed 6 years ago by Harry Jeffery

  • Status changed from assigned to inprogress

comment:4 Changed 6 years ago by Harry Jeffery

Refs #11020 Fix whitespace in Geometry CMakeLists

Changeset: a4b9cebc5f590799a780479ced81adebdd1d5b95

comment:5 Changed 6 years ago by Harry Jeffery

Refs #11020 Add Projection class

Changeset: f4dbc26a7fb249a23b7490698582b18527b82d5f

comment:6 Changed 6 years ago by Harry Jeffery

Refs #11020 Add Projection unit tests

Changeset: 37405f8e9eb351ce662b83ddc45d8543885da0b5

comment:7 Changed 6 years ago by Harry Jeffery

Refs #11020 Move Projection impl. into cpp file

Changeset: 09d9ca317a146d6687f87ac300f1afec7a8c7153

comment:8 Changed 6 years ago by Harry Jeffery

Refs #11020 Don't allow one dimensional Projections

They don't actually make sense. 2+ dimensions are required.

Changeset: eb259ae7a44f0b87812610422d7cb720a42b0c6a

comment:9 Changed 6 years ago by Harry Jeffery

Refs #11020 Refactor Projection interface

Changeset: 22cf2935a80861e7717926bcf0bf1d25be5cc5a0

comment:10 Changed 6 years ago by Harry Jeffery

Refs #11020 Add UVW accessors to Projection

Changeset: 0e2184cfecc554fa980f5eb1b9f60f62cd7d7463

comment:11 Changed 6 years ago by Harry Jeffery

Refs #11020 Add Python bindings for Projection

Changeset: b393079594fa2bc7df7bba30f52000105edfad4c

comment:12 Changed 6 years ago by Harry Jeffery

Refs #11020 Add unit to Projection

In Horace's python interface this is known as type

Changeset: 2ab9a6a7dbb47743254d96996e36895656ccc438

comment:13 Changed 6 years ago by Harry Jeffery

Refs #11020 Make U,V,W accessors python properties

Changeset: 50e2a84b4f88f573c0c1876fdc9270f842848078

comment:14 Changed 6 years ago by Harry Jeffery

Refs #11020 Add Projection.toWorkspace in Python

Changeset: 414a7f9c48efe38abc7e1004b5961a820495485a

comment:15 Changed 6 years ago by Harry Jeffery

Refs #11020 Update CutMD usage example

The usage example should use the new Projection object, and its python bindings to create a table workspace for CutMD, rather than forcing the user to manually construct one themselves.

Changeset: f326c13c81741df4dc037ca0a655522df50f0783

comment:16 Changed 6 years ago by Harry Jeffery

  • Status changed from inprogress to verify
  • Resolution set to fixed

This is being verified as pull request #189.

comment:17 Changed 6 years ago by Harry Jeffery

Refs #11020 Move Projection from Geometry to API

Changeset: 847e05c96ce2c158b11a29a3a4d2f75c28931ddb

comment:18 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:19 Changed 6 years ago by Harry Jeffery

Refs #11020 Use [sg]etType in python interface

The Horace users expect the methods to be called get/set Type, not unit, so we'll use type on the Python side, but try to use a better naming scheme on the C++ side.

Changeset: b5ed8bfe541a135da26d335d94bc3ef69f843edf

comment:20 Changed 6 years ago by Harry Jeffery

Refs #11020 Unit test python interface

Changeset: b5752daa9561b6a9b301ae7aaafbf1c1a2099080

comment:21 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:22 Changed 6 years ago by Harry Jeffery

Refs #11020 Suppress GCC warning on RHEL6

Changeset: 224f8a747dc7b3655f6fbdb451c6e4e62060b3dc

comment:23 Changed 6 years ago by Harry Jeffery

Jenkins, test this please.

comment:24 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:25 Changed 6 years ago by Harry Jeffery

Jenkins, test this please.

comment:26 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:27 Changed 6 years ago by Harry Jeffery

Jenkins, test this please.

comment:28 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:29 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:30 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:31 Changed 6 years ago by Andrei Savici

15:25:54 /home/builder/jenkins-linode/workspace/pull_requests/label/rhel6-build/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Projection.cpp: In function ‘void export_Projection()’: 15:25:54 /home/builder/jenkins-linode/workspace/pull_requests/label/rhel6-build/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Projection.cpp:63: error: #pragma GCC diagnostic not allowed inside functions 15:25:54 /home/builder/jenkins-linode/workspace/pull_requests/label/rhel6-build/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Projection.cpp:92: error: #pragma GCC diagnostic not allowed inside functions

comment:32 Changed 6 years ago by Martyn Gigg

The GCC_DIAG calls need to be outside the function.

comment:33 Changed 6 years ago by Andrei Savici

Here are a few problems:

  1. In Horace, people are used to have only two projections, each of them a 3D vector. So you give u=VMD(1.,0,0.) and v=VMD(0.,1.,0.). The w projection is calculated automatically
  2. I am in mantidplot, I generated py projection p=Projection(u,v), and I want to convert it to a table workspace, so I run x=p.toWorkspace(). The table workspace does not show up. I need to explicitly add it to the ADS with AnalysisDataService.add('x',x)
  3. The table is confusing. The u and v vectors are shown as columns. The type is also shown as a column, but each componnent is ligned up with a compoinent of u or v. The type corresponds to the entire u vector or entire v vector, not to one component. Maybe it should look like

Name | Value


u | 1 , 0 , 0 v | 0 , 1 , 0 type| r r r

Obviously I lost the third components of u and v when I defined only two 3D vectors

comment:34 Changed 6 years ago by Harry Jeffery

Refs #11020 Fix strict aliasing error

Changeset: 3903f47cb11a501539635e403ea454b8e89c18ec

comment:35 Changed 6 years ago by Harry Jeffery

@AndreiSavici Ah, I was following these while creating the type:

The format of the table itself is as expected by the CutMD algorithm: http://docs.mantidproject.org/nightly/algorithms/CutMD-v1.html (see the usage example specifically)

Changing the format of the table will require changing the format expected by CutMD, which is backwards incompatible.

Any ideas on how to proceed?

comment:36 Changed 6 years ago by Harry Jeffery

Refs #11020 Tweak Projection table format

Changeset: 6ece26dee84289dde884366ef87884568f451e33

comment:37 Changed 6 years ago by Harry Jeffery

Refs #11020 Use double for Projection.offset

Changeset: 93c2b8a8afd861181f7cc77669748566709bdc93

comment:38 Changed 6 years ago by Harry Jeffery

Refs #11020 Re-order axis names in calc extents

Changeset: eb6f489ccce6712cd1b591fe8d37a3c2dc19530b

comment:39 Changed 6 years ago by Harry Jeffery

Refs #11020 Update verify_projection_input

Changeset: 5ca21170c14568a2797e9983cfe5c7fd7a7ea575

comment:40 Changed 6 years ago by Harry Jeffery

Refs #11020 Parse uvw from new tableworkspace

Changeset: 0357a68dd7171394eb84a1d4f78daaadf91ae401

comment:41 Changed 6 years ago by Harry Jeffery

Refs #11020 Fix typecast inside CutMD

Changeset: b7ca5249172df95b7d1ab3ab68c5eec4ed024374

comment:42 Changed 6 years ago by Harry Jeffery

Merge branch 'master' into 11020_create_internal_projection_type

Refs #11020

Changeset: 4cb1779ed31c3845147f66fba0b80e5148f09cc5

comment:43 Changed 6 years ago by Harry Jeffery

Refs #11020 Make column count exception more explicit

Changeset: 5d5e9918239e5cbb9c9f38312137106387100f6d

comment:44 Changed 6 years ago by Harry Jeffery

Refs #11020 Use new projection table format in CutMD

Changeset: 2fb38f5618dea0ce4fc300ec4d4e583570613c9e

comment:45 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:46 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:47 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:48 Changed 6 years ago by Harry Jeffery

Refs #11020 Use const references in Projection constructor

Changeset: db1f17d9f9b7b631ac1ee2653be695b1a60f93b5

comment:49 Changed 6 years ago by Harry Jeffery

Refs #11020 Attempt to fix RHEL6 warning

Changeset: 41e3b5b8537f8d0e007676ca0700609bbb35e09f

comment:50 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:51 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:52 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:53 Changed 6 years ago by Harry Jeffery

Refs #11020 Style code to 80 columns / clang-format

Changeset: f3327ec896c3912779a4387a3092e08b9ed03362

comment:54 Changed 6 years ago by Harry Jeffery

Refs #11020 Add PyObjectToVMD converter

Changeset: 1432919c406a4a6c6ed2ecff5356d42c12f63bb9

comment:55 Changed 6 years ago by Harry Jeffery

Refs #11020 Allow lists in Projection ctors and setAxis

Changeset: 559819f3702f6eb74337b7db9fdf25187caeaf05

comment:56 Changed 6 years ago by Harry Jeffery

Refs #11020 Add python list property accessors to Projection

Changeset: 5f5dc8fe1f9a1548e1aca85b70616f5f6a8ae291

comment:57 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:58 Changed 6 years ago by Harry Jeffery

Refs #11020 Fix RHEL6 warning

Changeset: 56b7016132257d891ef095dee8728c437994fdc8

comment:59 Changed 6 years ago by Harry Jeffery

Refs #11020 Attempt to fix RHEL6 warning

Changeset: 693ee3147e2a7fa0cb7553ed30b4d6ddf13585c5

comment:60 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:61 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:62 Changed 6 years ago by Harry Jeffery

Refs #11020 Fix the build

Changeset: 2fd122da97f783ce97cf2d1754e04d6f6979df5e

comment:63 Changed 6 years ago by Harry Jeffery

Refs #11020 Default to identity projection

Changeset: da91ffc2a0fb55249babe5e00e7ffdf02a72ef9c

comment:64 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:65 Changed 6 years ago by Harry Jeffery

Refs #11020 Update documentation for CutMD

Changeset: 1e41fecfdd7f189340b8302ff2eccc122a771383

comment:66 Changed 6 years ago by Harry Jeffery

Notable changes:

  • The table's schema has changed. CutMD has been updated in a backwards incompatible way to reflect this.
  • Projection in python now has .u, .v, and .w accessors, and accepts python lists as well as VMDs in all relevant methods and constructors.
  • The initial value of the projection is now an identity matrix, i.e. for 3 dimensions: u = [1,0,0], v = [0,1,0], w = [0,0,1].

comment:67 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:68 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:69 Changed 6 years ago by Andrei Savici

I still want to create a projection based on 2 3D vectors ` a=Projection(VMD(2,2,2),VMD(1,0,0)) ` This will not give me a.w (ValueError: invalid axis), which is wrong, and I cannot change the value of the type for the third axis.

In all cases, the number of vectors has to be equal to the number of dimensions. So if I use VMDs of dimension 3, I need to get u,v,w, even if I initialize it with only 2 vectors. In that case w=u x v, where x is the cross product

comment:70 Changed 6 years ago by Harry Jeffery

Refs #11020 Assume 3 dimensions when only given 2

Changeset: ede531eba4b7a4664f7fa3b53206c879117c6d25

comment:71 Changed 6 years ago by Harry Jeffery

Refs #11020 Respect name column in CutMD

Changeset: f63bceeda9a70258471deb3dba087eca044f1e1f

comment:72 Changed 6 years ago by Harry Jeffery

Refs #11020 Fix broken unit test

Changeset: c0c532d936d1686750164388067e02da469521a4

comment:73 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:74 Changed 6 years ago by Harry Jeffery

Refs #11020 Fix unit test

Changeset: c0a60932fdb27675c1214a244544b77fa33652d1

comment:75 Changed 6 years ago by Andrei Savici

  • Status changed from verify to verifying
  • Tester set to Andrei Savici

comment:76 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:77 Changed 6 years ago by Harry Jeffery

Refs #11020 Simplify Projection class

Changeset: 8b34435c1b5a1814c7bab1cf7d6980a8df39c597

comment:78 Changed 6 years ago by Harry Jeffery

Refs #11020 Require coplanarity

Changeset: da596e09196349ca8542f68305264ffbb986ebd5

comment:79 Changed 6 years ago by Harry Jeffery

Refs #11020 Fix broken unit test

Changeset: eb44f368037b309da4e5a001393830ac5b0a4727

comment:80 Changed 6 years ago by Harry Jeffery

Refs #11020 Correct coplanarity check

Changeset: f40f1a68f8c184416bf4ad064c7a166b5b60953b

comment:81 Changed 6 years ago by Harry Jeffery

  • Blocking 11316 added

comment:82 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

Ubuntu and OSX succeeded on the first build. Fedora, RHEL6 and Win7 failed to checkout.

comment:83 Changed 6 years ago by Harry Jeffery

Jenkins, retest this please.

comment:84 Changed 6 years ago by Andrei Savici

Merge pull request #189 from mantidproject/11020_create_internal_projection_type

Refs #11020 Create projection type

Changeset: fdd07c45fd20ad074a4d4130920ecc469e70e797

comment:85 Changed 6 years ago by Andrei Savici

  • Status changed from verifying to closed

Merge pull request #189 from mantidproject/11020_create_internal_projection_type

Refs #11020 Create projection type

Full changeset: fdd07c45fd20ad074a4d4130920ecc469e70e797

comment:86 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11859

Note: See TracTickets for help on using tickets.