{"action":"created","issue":{"url":"https://api.github.com/repos/mantidproject/mantid/issues/15953","repository_url":"https://api.github.com/repos/mantidproject/mantid","labels_url":"https://api.github.com/repos/mantidproject/mantid/issues/15953/labels{/name}","comments_url":"https://api.github.com/repos/mantidproject/mantid/issues/15953/comments","events_url":"https://api.github.com/repos/mantidproject/mantid/issues/15953/events","html_url":"https://github.com/mantidproject/mantid/pull/15953","id":149850856,"number":15953,"title":"Computes phonon density of states in the incoherent approximation.","user":{"login":"mducle","id":14106963,"avatar_url":"https://avatars.githubusercontent.com/u/14106963?v=3","gravatar_id":"","url":"https://api.github.com/users/mducle","html_url":"https://github.com/mducle","followers_url":"https://api.github.com/users/mducle/followers","following_url":"https://api.github.com/users/mducle/following{/other_user}","gists_url":"https://api.github.com/users/mducle/gists{/gist_id}","starred_url":"https://api.github.com/users/mducle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mducle/subscriptions","organizations_url":"https://api.github.com/users/mducle/orgs","repos_url":"https://api.github.com/users/mducle/repos","events_url":"https://api.github.com/users/mducle/events{/privacy}","received_events_url":"https://api.github.com/users/mducle/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mantidproject/mantid/labels/Component:%20Direct%20Inelastic","name":"Component: Direct Inelastic","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"NickDraper","id":1017173,"avatar_url":"https://avatars.githubusercontent.com/u/1017173?v=3","gravatar_id":"","url":"https://api.github.com/users/NickDraper","html_url":"https://github.com/NickDraper","followers_url":"https://api.github.com/users/NickDraper/followers","following_url":"https://api.github.com/users/NickDraper/following{/other_user}","gists_url":"https://api.github.com/users/NickDraper/gists{/gist_id}","starred_url":"https://api.github.com/users/NickDraper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickDraper/subscriptions","organizations_url":"https://api.github.com/users/NickDraper/orgs","repos_url":"https://api.github.com/users/NickDraper/repos","events_url":"https://api.github.com/users/NickDraper/events{/privacy}","received_events_url":"https://api.github.com/users/NickDraper/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mantidproject/mantid/milestones/5","html_url":"https://github.com/mantidproject/mantid/milestones/Release%203.7","labels_url":"https://api.github.com/repos/mantidproject/mantid/milestones/5/labels","id":1106939,"number":5,"title":"Release 3.7","description":"","creator":{"login":"peterfpeterson","id":404003,"avatar_url":"https://avatars.githubusercontent.com/u/404003?v=3","gravatar_id":"","url":"https://api.github.com/users/peterfpeterson","html_url":"https://github.com/peterfpeterson","followers_url":"https://api.github.com/users/peterfpeterson/followers","following_url":"https://api.github.com/users/peterfpeterson/following{/other_user}","gists_url":"https://api.github.com/users/peterfpeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/peterfpeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterfpeterson/subscriptions","organizations_url":"https://api.github.com/users/peterfpeterson/orgs","repos_url":"https://api.github.com/users/peterfpeterson/repos","events_url":"https://api.github.com/users/peterfpeterson/events{/privacy}","received_events_url":"https://api.github.com/users/peterfpeterson/received_events","type":"User","site_admin":false},"open_issues":590,"closed_issues":604,"state":"open","created_at":"2015-05-12T15:38:13Z","updated_at":"2016-04-22T12:49:03Z","due_on":"2016-06-05T23:00:00Z","closed_at":null},"comments":1,"created_at":"2016-04-20T18:36:55Z","updated_at":"2016-04-22T12:59:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/15953","html_url":"https://github.com/mantidproject/mantid/pull/15953","diff_url":"https://github.com/mantidproject/mantid/pull/15953.diff","patch_url":"https://github.com/mantidproject/mantid/pull/15953.patch"},"body":"This is a python algorithm to compute the phonon density of states from a powder S(q,w) dataset. In this case, all the scattering can be treated as incoherent (the coherent scattering averaged over all angles in a powder is similar to the isotropic incoherent scattering) and a simple formula can be applied to derive the neutron weighted partial density of states. The theory is partly detailed in the documentation rst.\r\n\r\nIt only operates on histogram workspaces with one axis being momentum transfer (Q) and one being energy transfer (in either meV or cm). By default it outputs the DOS g(E) in meV but can be specified to output in wavenumbers (cm^-1).\r\n\r\n**To test:**\r\n\r\nBy constructing a (Q,w) workspace\r\n\r\n```\r\nws = CreateSampleWorkspace(binWidth = 0.1, XMin = 0, XMax = 50, XUnit = 'DeltaE')\r\nws = ScaleX(ws, -25, \"Add\")\r\nLoadInstrument(ws, InstrumentName='MARI', RewriteSpectraMap = True)\r\nws = SofQW(ws, [0, 0.05, 8], 'Direct', 25)\r\nws_DOS = ComputeIncoherentDOS(ws)\r\n```\r\n\r\nAlternatively, with a datafile (note the datafiles should be accessible in the archive, but the mapfile might need to be copied somewhere accessible. It is here: https://svn.isis.rl.ac.uk/InstrumentFiles/trunk/mari/mari_res2013.map \r\nThe following uses a measurement of Aluminium on MARI at ISIS.\r\n\r\n```\r\nfrom Direct import DirectEnergyConversion\r\nrd = DirectEnergyConversion.DirectEnergyConversion('MARI')\r\nws = rd.convert_to_energy(21334, 21335, 60, [-55,0.05,55], 'mari_res2013.map', \r\n    monovan_run=21347, sample_mass=106.4, sample_rmm=27, monovan_mapfile='mari_res2013.map')\r\nws_sqw = SofQW3(ws, [0,0.1,12], 'Direct', 60)\r\nSetSampleMaterial(ws_sqw,'Al')\r\nws_dos = ComputeIncoherentDOS(ws_sqw, Temperature=5, StatesPerEnergy=True)\r\n\r\n```\r\n\r\nCompare to the data here: http://journals.aps.org/prb/abstract/10.1103/PhysRevB.77.024301\r\nToo high by a factor of around 3, which I haven't figured out why... \r\nPossibly from the Debye-Waller factor. Or possibly due to multiple scattering.\r\n\r\n<!-- Instructions for testing. -->\r\n\r\nFixes #15843.\r\n\r\n<!-- RELEASE NOTES\r\nEither edit the file in docs/source/release/... and it will be in your pull request or state\r\n*Does not need to be in the release notes.*\r\n-->\r\n\r\n---\r\n\r\n#### Reviewer ####\r\n\r\nPlease comment on the following ([full description](http://www.mantidproject.org/Individual_Ticket_Testing)):\r\n\r\n##### Code Review #####\r\n\r\n- [ ] Is the code of an acceptable quality?\r\n- [ ] Does the code conform to the coding standards? Is it well structured with small focussed classes/methods/functions?\r\n- [ ] Are there unit/system tests in place? Are the unit tests small and test the a class in isolation?\r\n- [ ] If there are changes in the release notes then do they describe the changes appropriately?\r\n\r\n##### Functional Tests #####\r\n\r\n- [ ] Do changes function as described? Add comments below that describe the tests performed?\r\n- [ ] How do the changes handle unexpected situations, e.g. bad input?\r\n- [ ] Has the relevant documentation been added/updated?\r\n- [ ] Is user-facing documentation written in a user-friendly manner?\r\n- [ ] Has developer documentation been updated if required?\r\n\r\n- Does everything look good? Comment with the ship it emoji but don't merge. A member of `@mantidproject/gatekeepers` will take care of it.\r\n"},"comment":{"url":"https://api.github.com/repos/mantidproject/mantid/issues/comments/213419254","html_url":"https://github.com/mantidproject/mantid/pull/15953#issuecomment-213419254","issue_url":"https://api.github.com/repos/mantidproject/mantid/issues/15953","id":213419254,"user":{"login":"NickDraper","id":1017173,"avatar_url":"https://avatars.githubusercontent.com/u/1017173?v=3","gravatar_id":"","url":"https://api.github.com/users/NickDraper","html_url":"https://github.com/NickDraper","followers_url":"https://api.github.com/users/NickDraper/followers","following_url":"https://api.github.com/users/NickDraper/following{/other_user}","gists_url":"https://api.github.com/users/NickDraper/gists{/gist_id}","starred_url":"https://api.github.com/users/NickDraper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickDraper/subscriptions","organizations_url":"https://api.github.com/users/NickDraper/orgs","repos_url":"https://api.github.com/users/NickDraper/repos","events_url":"https://api.github.com/users/NickDraper/events{/privacy}","received_events_url":"https://api.github.com/users/NickDraper/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T12:59:20Z","updated_at":"2016-04-22T12:59:20Z","body":"Code review is good, clear and well formatted.\r\nDocumentation looks good - There is one formula that is not parsing properly in github, but might be fine through sphinx - Still to check\r\nStill Building at the moment, so have yet to test results, but I'm slightly concerned about this comment\r\n\"Too high by a factor of around 3, which I haven't figured out why... \r\nPossibly from the Debye-Waller factor. Or possibly due to multiple scattering.\"\r\n\r\nDid the old PySlice routine show the same 3 fold factor increase? Otherwise we need to state that in the release notes."}}