{"action":"created","issue":{"url":"https://api.github.com/repos/mantidproject/mantid/issues/10390","repository_url":"https://api.github.com/repos/mantidproject/mantid","labels_url":"https://api.github.com/repos/mantidproject/mantid/issues/10390/labels{/name}","comments_url":"https://api.github.com/repos/mantidproject/mantid/issues/10390/comments","events_url":"https://api.github.com/repos/mantidproject/mantid/issues/10390/events","html_url":"https://github.com/mantidproject/mantid/issues/10390","id":84719728,"number":10390,"title":"Allow Tube Calibration File for Each Bank","user":{"login":"PeterParker","id":1109668,"avatar_url":"https://avatars0.githubusercontent.com/u/1109668?v=4","gravatar_id":"","url":"https://api.github.com/users/PeterParker","html_url":"https://github.com/PeterParker","followers_url":"https://api.github.com/users/PeterParker/followers","following_url":"https://api.github.com/users/PeterParker/following{/other_user}","gists_url":"https://api.github.com/users/PeterParker/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterParker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterParker/subscriptions","organizations_url":"https://api.github.com/users/PeterParker/orgs","repos_url":"https://api.github.com/users/PeterParker/repos","events_url":"https://api.github.com/users/PeterParker/events{/privacy}","received_events_url":"https://api.github.com/users/PeterParker/received_events","type":"User","site_admin":false},"labels":[{"id":40342875,"url":"https://api.github.com/repos/mantidproject/mantid/labels/Component:%20SANS","name":"Component: SANS","color":"009800","default":false}],"state":"open","locked":false,"assignee":{"login":"AntonPiccardoSelg","id":8955784,"avatar_url":"https://avatars0.githubusercontent.com/u/8955784?v=4","gravatar_id":"","url":"https://api.github.com/users/AntonPiccardoSelg","html_url":"https://github.com/AntonPiccardoSelg","followers_url":"https://api.github.com/users/AntonPiccardoSelg/followers","following_url":"https://api.github.com/users/AntonPiccardoSelg/following{/other_user}","gists_url":"https://api.github.com/users/AntonPiccardoSelg/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonPiccardoSelg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonPiccardoSelg/subscriptions","organizations_url":"https://api.github.com/users/AntonPiccardoSelg/orgs","repos_url":"https://api.github.com/users/AntonPiccardoSelg/repos","events_url":"https://api.github.com/users/AntonPiccardoSelg/events{/privacy}","received_events_url":"https://api.github.com/users/AntonPiccardoSelg/received_events","type":"User","site_admin":false},"assignees":[{"login":"AntonPiccardoSelg","id":8955784,"avatar_url":"https://avatars0.githubusercontent.com/u/8955784?v=4","gravatar_id":"","url":"https://api.github.com/users/AntonPiccardoSelg","html_url":"https://github.com/AntonPiccardoSelg","followers_url":"https://api.github.com/users/AntonPiccardoSelg/followers","following_url":"https://api.github.com/users/AntonPiccardoSelg/following{/other_user}","gists_url":"https://api.github.com/users/AntonPiccardoSelg/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonPiccardoSelg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonPiccardoSelg/subscriptions","organizations_url":"https://api.github.com/users/AntonPiccardoSelg/orgs","repos_url":"https://api.github.com/users/AntonPiccardoSelg/repos","events_url":"https://api.github.com/users/AntonPiccardoSelg/events{/privacy}","received_events_url":"https://api.github.com/users/AntonPiccardoSelg/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2014-05-30T07:55:20Z","updated_at":"2017-10-05T10:27:47Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"sans_feature\nThis issue was originally [TRAC 9547](http://trac.mantidproject.org/mantid/ticket/9547)\n\nThe `TUBECALIBFILE` command in User Files can be used to specify a calibration file for the SANS2D instrument.  Currently, this is set up so that only one file can be specified.\n\nUnfortunately, each bank in SANS2D will have it's own calibration file, and so we need some way to specify ''two'' files, and then merge the detector positions of one bank into a workspace containing the detectors positions of the other.\n\nI'm not yet sure how we should change the command to accommodate this.  Maybe `TUBECALIBFILE/REAR` and `TUBECALIBFILE/FRONT` is the best way, but I'd like to try and make things as generic as possible.\n\nMeanwhile, I provided a script to Richard so that he can merge the files manually so that he only has to specify one file.  It may come in useful when implementing this ticket:\n\n```\n  #!python\n# Files in \\\\isis\\inst$\\Instruments$\\NDXSANS2D\\user\\Masks:\nrear_calib_file = \"TubeCalibrationTable_512pixel_23563rear_29May14.nxs\"\nfront_calib_file = \"TubeCalibrationTable_512pixel_23610front_28May14.nxs\"\n\nrear_calib = Load(rear_calib_file)\nfront_calib = Load(front_calib_file)\n\ndet_id_list = []\nfor ws_index in range(rear_calib.getNumberHistograms()):\n    spectrum = rear_calib.getSpectrum(ws_index)\n    if spectrum.getSpectrumNo() < 0:\n        continue\n    for det_id in spectrum.getDetectorIDs():\n        if det_id > 2523511:\n            continue\n        det_id_list.append(det_id)\n\nrear_inst = rear_calib.getInstrument()\n\n# Creating an unmanaged version of the algorithm is important here.  Otherwise,\n# things get really slow, and the workspace history becomes unmanageable.\nmove = AlgorithmManager.createUnmanaged('MoveInstrumentComponent')\nmove.initialize()\nmove.setChild(True)\nmove.setProperty(\"Workspace\", \"front_calib\")\nmove.setProperty(\"RelativePosition\", False)\n\nfor det_id in det_id_list:\n    det = rear_inst.getDetector(det_id)\n    if \"rear-detector\" in det.getFullName():\n        move.setProperty(\"DetectorID\", det_id)\n        move.setProperty(\"X\", det.getPos().getX())\n        move.setProperty(\"Y\", det.getPos().getY())\n        move.setProperty(\"Z\", det.getPos().getZ())\n        move.setProperty(\"DetectorID\", det_id)\n        move.execute()\n\nRenameWorkspace(InputWorkspace=\"front_calib\", OutputWorkspace=\"merged\")\nDeleteWorkspace(Workspace=\"rear_calib\")\n```\n"},"comment":{"url":"https://api.github.com/repos/mantidproject/mantid/issues/comments/334425269","html_url":"https://github.com/mantidproject/mantid/issues/10390#issuecomment-334425269","issue_url":"https://api.github.com/repos/mantidproject/mantid/issues/10390","id":334425269,"user":{"login":"AntonPiccardoSelg","id":8955784,"avatar_url":"https://avatars0.githubusercontent.com/u/8955784?v=4","gravatar_id":"","url":"https://api.github.com/users/AntonPiccardoSelg","html_url":"https://github.com/AntonPiccardoSelg","followers_url":"https://api.github.com/users/AntonPiccardoSelg/followers","following_url":"https://api.github.com/users/AntonPiccardoSelg/following{/other_user}","gists_url":"https://api.github.com/users/AntonPiccardoSelg/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonPiccardoSelg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonPiccardoSelg/subscriptions","organizations_url":"https://api.github.com/users/AntonPiccardoSelg/orgs","repos_url":"https://api.github.com/users/AntonPiccardoSelg/repos","events_url":"https://api.github.com/users/AntonPiccardoSelg/events{/privacy}","received_events_url":"https://api.github.com/users/AntonPiccardoSelg/received_events","type":"User","site_admin":false},"created_at":"2017-10-05T10:27:47Z","updated_at":"2017-10-05T10:27:47Z","author_association":"MEMBER","body":"@Mantid-Matthew Ask the scientists if this is relevant (It would only be relevant for SANS2D)"}}
{"actor":{"display_login":"AntonPiccardoSelg"}}