/* * Generate a SANS test workspace, with instrument geometry. * The geometry is the SANSTEST geometry, with a 30x30 pixel 2D detector. * * @param workspace: name of the workspace to be created. */ Workspace2D_sptr SANSInstrumentCreationHelper::createSANSInstrumentWorkspace( std::string workspace) { // Create a test workspace with test data with a well defined peak // The test instrument has two monitor channels Workspace2D_sptr ws = WorkspaceCreationHelper::create2DWorkspace123( nBins * nBins + nMonitors, 1, 1); AnalysisDataService::Instance().addOrReplace(workspace, ws); ws->getAxis(0)->unit() = Mantid::Kernel::UnitFactory::Instance().create("Wavelength"); ws->setYUnit(""); // Load instrument geometry runLoadInstrument("SANSTEST", ws); runLoadMappingTable(ws, nBins, nBins); return ws; }