Skip to content

Commit

Permalink
Made some minor improvement. Refs #10555.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Feb 2, 2015
1 parent cfa883a commit 7c78975
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions Code/Mantid/Framework/MDAlgorithms/src/LoadHFIRPDData.cpp
Expand Up @@ -559,6 +559,7 @@ IMDEventWorkspace_sptr LoadHFIRPDData::createMonitorMDWorkspace(
return workspace;
}

//---
/**
* @brief LoadHFIRPDD::appendSampleLogs
* @param mdws
Expand Down
23 changes: 20 additions & 3 deletions Code/Mantid/Framework/MDAlgorithms/test/LoadHFIRPDDataTest.h
Expand Up @@ -69,11 +69,14 @@ class LoadHFIRPDDataTest : public CxxTest::TestSuite {
TS_ASSERT_EQUALS(detids.size(), 44);
}

/** TODO - Add comments
* @brief test_LoadHB2AData
*/
void test_LoadHB2AData() {
// This is the solution of stage 1. Stage 2 will be different
LoadSpiceAscii spcloader;
spcloader.initialize();

/// TODO - Add comments
TS_ASSERT_THROWS_NOTHING(
spcloader.setProperty("Filename", "HB2A_exp0231_scan0001.dat"));
TS_ASSERT_THROWS_NOTHING(
Expand All @@ -84,23 +87,23 @@ class LoadHFIRPDDataTest : public CxxTest::TestSuite {
"DateAndTimeLog", "date,MM/DD/YYYY,time,HH:MM:SS AM"));
TS_ASSERT_THROWS_NOTHING(
spcloader.setProperty("IgnoreUnlistedLogs", false));

spcloader.execute();

ITableWorkspace_sptr datatablews =
boost::dynamic_pointer_cast<ITableWorkspace>(
AnalysisDataService::Instance().retrieve("DataTable"));
TS_ASSERT(datatablews);

/// TODO - Add comments
MatrixWorkspace_sptr parentlogws =
boost::dynamic_pointer_cast<MatrixWorkspace>(
AnalysisDataService::Instance().retrieve("LogParentWS"));
TS_ASSERT(parentlogws);

/// TODO - Add comments
LoadHFIRPDData loader;
loader.initialize();

// loader.setPropertyValue("Filename", "HB2A_exp0231_scan0001.dat");
loader.setProperty("InputWorkspace", datatablews);
loader.setProperty("ParentWorkspace", parentlogws);
loader.setProperty("Instrument", "HB2A");
Expand All @@ -123,11 +126,25 @@ class LoadHFIRPDDataTest : public CxxTest::TestSuite {
IMDIterator *mditer = mdws->createIterator();
TS_ASSERT_EQUALS(mditer->getNumEvents(), 44 * 61);

double y0 = mditer->getInnerSignal(0);
double yl = mditer->getInnerSignal(44 * 61-1);

uint16_t run0 = mditer->getInnerRunIndex(0);


// Detector position
/// TODO - Explain more on this test
Mantid::coord_t lastx = mditer->getInnerPosition(44 * 61 - 1, 0);
TS_ASSERT_DELTA(lastx, 1.57956, 0.0001);

// Experiment infor???
ExperimentInfo_const_sptr expinfo = mdws->getExperimentInfo(0);
TS_ASSERT(expinfo);

/// TODO : how to deal with it? Choose some sample logs?

/// TODO :: Is there any good test for time?

}
};

Expand Down
11 changes: 11 additions & 0 deletions Code/Mantid/docs/source/algorithms/LoadHFIRPDData-v1.rst
Expand Up @@ -46,6 +46,17 @@ One MDEventWorkspace stores the detectors' counts;
and the other one stores the monitor counts.


Sample Logs
###########

** TODO : Add this section about how the algorithm treats **

Temporary MD File
#################

** TODO : write how the MD file is build and read in **


Workflow
--------

Expand Down

0 comments on commit 7c78975

Please sign in to comment.