Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing usability issues for reducing HFIR data from SPICE file #370

Merged
merged 5 commits into from Mar 18, 2015

Conversation

wdzhou
Copy link
Collaborator

@wdzhou wdzhou commented Mar 9, 2015

1. LoadSpiceAscii has date time format with default to SPICE's current
standard
2. ConvertCWPDMDToSpectra is explained in the sumary;
3. Binning parameters can accept bin size only in
ConvertCWPDMDToSpectra.  Xmin and Xmax will be searched automatically.

	- modified:   ../Mantid/Framework/DataHandling/src/LoadSpiceAscii.cpp
	- modified:   ../Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWPDMDToSpectra.h
	- modified:   ../Mantid/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp
	- modified:   ../Mantid/Framework/MDAlgorithms/test/ConvertCWPDMDToSpectraTest.h
And added unit test for it.

Fixed a bug about MomentumTransfer in ConvertCWPDMDToSpectra.

Use Degrees for output workspace if target unit is 2theta for
ConvertCWPDMDToSpectra.
@AndreiSavici AndreiSavici added this to the Release 3.4 milestone Mar 9, 2015
@FedeMPouzols
Copy link
Contributor

Jenkins, retest this please

@FedeMPouzols FedeMPouzols added the Diffraction Issues and pull requests related to diffraction label Mar 10, 2015
@FedeMPouzols
Copy link
Contributor

Jenkins, retest this please

@wdzhou
Copy link
Collaborator Author

wdzhou commented Mar 10, 2015

Retest please.

@wdzhou
Copy link
Collaborator Author

wdzhou commented Mar 10, 2015

Jenkins, retest this please

@wdzhou
Copy link
Collaborator Author

wdzhou commented Mar 16, 2015

Tester:

Here is the list of item that you can check against the requests for this ticket:

  1. LoadSpiceAscii should not require date time format:
  • A default value is set to property DateAndTimeLog. The default value is of current HFIR's standard;
  1. ConvertSpiceDataToRealSpace creates an MD workspace with Y min and max limits both 0:
    • This issue will be resolved in ticket #11288.
  2. ConvertCWPDMDToSpectra is a weird name. It should at least be explained in the documentation:
    • Check the documentation and this algorithm's summary. The issue is addressed
      4.Binning parameters must contain 3 numbers. People might be used to Rebin, that can also use one value. Minimum and maximum can be calculated:
    • Minimum value and maximum value can be determined automatically. To test, you can run the script attached in the next comment. The difference between the diffraction pattern with min/max given or not should have very small difference.
  3. There is a weird warning message "Unable to set unit to an Unit::Empty object." The reason is that the "Degrees" unit is not registered:
    • 'Degree' is added. You can check unit test and the result in the script next.

@wdzhou
Copy link
Collaborator Author

wdzhou commented Mar 16, 2015

Test script: test file 'HB2A_exp0231_scan0001.dat' can be found in unit test.

LoadSpiceAscii(Filename='HB2A_exp0231_scan0001.dat', DateAndTimeLog='date,MM/DD/YYYY,time,HH:MM:SS AM', OutputWorkspace='HB2A_exp0231_scan0001_DataTable', RunInfoWorkspace='HB2A_exp0231_scan0001_Log')

ConvertSpiceDataToRealSpace(InputWorkspace='HB2A_exp0231_scan0001_DataTable', RunInfoWorkspace='HB2A_exp0231_scan0001_Log', OutputWorkspace='HB2A_exp0231_scan0001_DataMD', OutputMonitorWorkspace='HB2A_exp0231_scan0001_MonitorMD')

ConvertCWPDMDToSpectra(InputWorkspace='HB2A_exp0231_scan0001_DataMD', InputMonitorWorkspace='HB2A_exp0231_scan0001_MonitorMD',
BinningParams='5,0.1,150', OutputWorkspace='TTheta', NeutronWaveLength=2.4100000000000001)

ConvertCWPDMDToSpectra(InputWorkspace='HB2A_exp0231_scan0001_DataMD', InputMonitorWorkspace='HB2A_exp0231_scan0001_MonitorMD',
BinningParams='0.1', OutputWorkspace='TTheta2', NeutronWaveLength=2.4100000000000001)

ConvertCWPDMDToSpectra(InputWorkspace='HB2A_exp0231_scan0001_DataMD', InputMonitorWorkspace='HB2A_exp0231_scan0001_MonitorMD',
BinningParams='0.5,0.01, 30.0', OutputWorkspace='Dspace', NeutronWaveLength=2.4100000000000001, UnitOutput='dSpacing')

ConvertCWPDMDToSpectra(InputWorkspace='HB2A_exp0231_scan0001_DataMD', InputMonitorWorkspace='HB2A_exp0231_scan0001_MonitorMD',
BinningParams='0.01', OutputWorkspace='Dspace2', NeutronWaveLength=2.4100000000000001, UnitOutput='dSpacing')

ConvertCWPDMDToSpectra(InputWorkspace='HB2A_exp0231_scan0001_DataMD', InputMonitorWorkspace='HB2A_exp0231_scan0001_MonitorMD',
BinningParams='0.5,0.01, 30.0', OutputWorkspace='Q', NeutronWaveLength=2.4100000000000001, UnitOutput='Momentum Transfer (Q)')

ConvertCWPDMDToSpectra(InputWorkspace='HB2A_exp0231_scan0001_DataMD', InputMonitorWorkspace='HB2A_exp0231_scan0001_MonitorMD',
BinningParams='0.01', OutputWorkspace='Q2', NeutronWaveLength=2.4100000000000001, UnitOutput='Momentum Transfer (Q)')

@wdzhou wdzhou assigned wdzhou and AndreiSavici and unassigned wdzhou Mar 16, 2015
@wdzhou
Copy link
Collaborator Author

wdzhou commented Mar 16, 2015

Retest this please.

@AndreiSavici
Copy link
Member

The code is very complicated. It reimplements Rebin, InterpolatingRebin, Scale. It can be reduced by at least a factor of 3, and made more readable. I have created ticket #11399 to deal with this issue

AndreiSavici added a commit that referenced this pull request Mar 18, 2015
Fixing usability issues for reducing HFIR data from SPICE file
@AndreiSavici AndreiSavici merged commit f946f7f into master Mar 18, 2015
@AndreiSavici AndreiSavici deleted the feature/11282_spice_issues branch March 18, 2015 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Diffraction Issues and pull requests related to diffraction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants