{"action":"created","issue":{"url":"https://api.github.com/repos/obspy/obspy/issues/1061","labels_url":"https://api.github.com/repos/obspy/obspy/issues/1061/labels{/name}","comments_url":"https://api.github.com/repos/obspy/obspy/issues/1061/comments","events_url":"https://api.github.com/repos/obspy/obspy/issues/1061/events","html_url":"https://github.com/obspy/obspy/pull/1061","id":81922907,"number":1061,"title":"obspy.signal.rotate.rotate2ZNE seems buggy","user":{"login":"martinvandriel","id":2306288,"avatar_url":"https://avatars.githubusercontent.com/u/2306288?v=3","gravatar_id":"","url":"https://api.github.com/users/martinvandriel","html_url":"https://github.com/martinvandriel","followers_url":"https://api.github.com/users/martinvandriel/followers","following_url":"https://api.github.com/users/martinvandriel/following{/other_user}","gists_url":"https://api.github.com/users/martinvandriel/gists{/gist_id}","starred_url":"https://api.github.com/users/martinvandriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinvandriel/subscriptions","organizations_url":"https://api.github.com/users/martinvandriel/orgs","repos_url":"https://api.github.com/users/martinvandriel/repos","events_url":"https://api.github.com/users/martinvandriel/events{/privacy}","received_events_url":"https://api.github.com/users/martinvandriel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/obspy/obspy/labels/.signal","name":".signal","color":"0b02e1"},{"url":"https://api.github.com/repos/obspy/obspy/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/obspy/obspy/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"krischer","id":800487,"avatar_url":"https://avatars.githubusercontent.com/u/800487?v=3","gravatar_id":"","url":"https://api.github.com/users/krischer","html_url":"https://github.com/krischer","followers_url":"https://api.github.com/users/krischer/followers","following_url":"https://api.github.com/users/krischer/following{/other_user}","gists_url":"https://api.github.com/users/krischer/gists{/gist_id}","starred_url":"https://api.github.com/users/krischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krischer/subscriptions","organizations_url":"https://api.github.com/users/krischer/orgs","repos_url":"https://api.github.com/users/krischer/repos","events_url":"https://api.github.com/users/krischer/events{/privacy}","received_events_url":"https://api.github.com/users/krischer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/obspy/obspy/milestones/9","html_url":"https://github.com/obspy/obspy/milestones/0.10.x","labels_url":"https://api.github.com/repos/obspy/obspy/milestones/9/labels","id":1031268,"number":9,"title":"0.10.x","description":"Bugs to be addressed in the \"releases\" branch.","creator":{"login":"QuLogic","id":302469,"avatar_url":"https://avatars.githubusercontent.com/u/302469?v=3","gravatar_id":"","url":"https://api.github.com/users/QuLogic","html_url":"https://github.com/QuLogic","followers_url":"https://api.github.com/users/QuLogic/followers","following_url":"https://api.github.com/users/QuLogic/following{/other_user}","gists_url":"https://api.github.com/users/QuLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/QuLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuLogic/subscriptions","organizations_url":"https://api.github.com/users/QuLogic/orgs","repos_url":"https://api.github.com/users/QuLogic/repos","events_url":"https://api.github.com/users/QuLogic/events{/privacy}","received_events_url":"https://api.github.com/users/QuLogic/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":3,"state":"open","created_at":"2015-03-20T15:52:27Z","updated_at":"2015-06-03T16:18:56Z","due_on":null,"closed_at":null},"comments":16,"created_at":"2015-05-28T13:20:41Z","updated_at":"2015-06-04T15:56:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/obspy/obspy/pulls/1061","html_url":"https://github.com/obspy/obspy/pull/1061","diff_url":"https://github.com/obspy/obspy/pull/1061.diff","patch_url":"https://github.com/obspy/obspy/pull/1061.patch"},"body":"I am failing to understand the result of rotate2ZNE and I think the problem is in _dip_azimuth2ZSE_base_vector. If I build the matrix, I observe two problems: \r\n\r\n~~~~{.python}\r\n#!/usr/bin/env python\r\nimport numpy as np\r\nfrom obspy.signal.rotate import _dip_azimuth2ZSE_base_vector\r\n\r\ndip_1, dip_2, dip_3, = 35.3, 35.3, 35.3\r\nazimuth_1, azimuth_2, azimuth_3 = 0., 120., 240.\r\n\r\nbase_vector_1 = _dip_azimuth2ZSE_base_vector(dip_1, azimuth_1)\r\nbase_vector_2 = _dip_azimuth2ZSE_base_vector(dip_2, azimuth_2)\r\nbase_vector_3 = _dip_azimuth2ZSE_base_vector(dip_3, azimuth_3)\r\n\r\nT = np.matrix([base_vector_1, base_vector_2, base_vector_3]).transpose()\r\nprint(T)\r\n[[-0.57785762  0.28892881  0.28892881]\r\n [-0.81613759  0.4080688   0.4080688 ]\r\n [ 0.          0.8660254  -0.8660254 ]]\r\n\r\n~~~~\r\n\r\naccording to Wieland, this is what the matrix should look like:\r\n\r\n![wieland](https://cloud.githubusercontent.com/assets/2306288/7860781/4bfae708-054c-11e5-8735-8d2aecef7209.png)\r\n\r\nHowever, for the Z component (first line of T, last line in Wielands notation), the values are not all the same. Secondly, the matrix is not invertible, which it should be because the components are linearly independent;\r\n\r\n~~~~{.python}\r\n  File \"/home/ex/anaconda/lib/python2.7/site-packages/numpy/linalg/linalg.py\", line 90, in _raise_linalgerror_singular\r\n    raise LinAlgError(\"Singular matrix\")\r\nnumpy.linalg.linalg.LinAlgError: Singular matrix\r\n~~~~\r\n\r\nThis is what I would need at the moment, because I want to compute UVW given NEZ.\r\n\r\nAlso, the tests seem to cover only very specific examples (orthogonal bases)."},"comment":{"url":"https://api.github.com/repos/obspy/obspy/issues/comments/108945914","html_url":"https://github.com/obspy/obspy/pull/1061#issuecomment-108945914","issue_url":"https://api.github.com/repos/obspy/obspy/issues/1061","id":108945914,"user":{"login":"krischer","id":800487,"avatar_url":"https://avatars.githubusercontent.com/u/800487?v=3","gravatar_id":"","url":"https://api.github.com/users/krischer","html_url":"https://github.com/krischer","followers_url":"https://api.github.com/users/krischer/followers","following_url":"https://api.github.com/users/krischer/following{/other_user}","gists_url":"https://api.github.com/users/krischer/gists{/gist_id}","starred_url":"https://api.github.com/users/krischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krischer/subscriptions","organizations_url":"https://api.github.com/users/krischer/orgs","repos_url":"https://api.github.com/users/krischer/repos","events_url":"https://api.github.com/users/krischer/events{/privacy}","received_events_url":"https://api.github.com/users/krischer/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T15:56:54Z","updated_at":"2015-06-04T15:56:54Z","body":"Rebased on top of the releases branch and we added an additional and hopefully pretty good test. If everything passes this should be good to merge."}}