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

Fix issues reported from users and prototype manual reduction #41

Merged
merged 114 commits into from
Apr 26, 2019

Conversation

wdzhou
Copy link
Collaborator

@wdzhou wdzhou commented Nov 4, 2018

In this PR, multiple issues reported from users will be fixed. Minor improvements will be implemented according to user's suggestion. And prototype on manual reduction will be made.

Tests (Criteria)

  • 1. Loading data and instrument
    • (1) Rotated vs Non-rotated images (Reading XRAY raw TIFF #51)
    • (2) Pixels IDs (Mantid vs. PyRS-instrument, document)
      • Prototype: verify_pyrs_reduction.sh 1
      • Documentation
    • (3) Instrument view (document)
    • (4) Loading instrument speed comparison
    • (5) Unit test: instrument pixel positions comparison (Mantid vs PyRS-instrument)
      • various shifts on the geometry parameters (simulating calibration) ~ 10^-15
    • (6) Unit test: calculating 2theta value of each pixel
      • various shifts on the geometry parameters (simulating calibration) ~ 10^-15
  • 2. Masks
    • (1) Generating masks for 7 solid angles
    • (2) Examining masks by Mantid instrument view
  • 3. Reducing data
    • (1) Reduce data using Mantid algorithm
      • Document
      • Masks
      • Computation speed
    • (2) Reduce data using PyRS-reduction algorithm
      • Document
      • Masks
      • Computation speed
      • issue: ResampleX does not work with 2theta data converted 2D detector
    • (3) Mantid/PyRS comparison test
      • (a) Reduced data on 35 degree (no mask)
      • (b) Reduced data on 35 degree (Mask 0)
      • (c) Reduced data on 35 degree (Mask +10)
      • (d) Reduced data on 35 degree (Mask +20)
      • (e) Reduced data on 35 degree (Mask +30)
      • (f) Reduced data on 35 degree (Mask -10)
      • (g) Reduced data on 35 degree (Mask -20)
      • (h) Reduced data on 35 degree (Mask -30)

Fixes and Mentions
It mentions #37, #40, #38, #42, #45, #47 and #48.

verify_pyrs_reduction.sh 1

wdzhou added 14 commits October 29, 2018 17:05
1. Make the pyrscore for each interface instance unique.
2. Add a 'Save' button to peak fit interface to save fit result.

In mplgraphicspolar.py

To-do:
1. Test pole figure plotting.
2. Do a general test to launch multiple
pyrs/core/mantid_fit_peak.py:249:        # TODO - 20181101 - Need to
expand this method such that all fitted parameters will be added to
output
pyrs/interface/ui/diffdataviews.py:113:        # TODO - 20181101 -
Enable after auto_scale is fixed: self.auto_rescale()
pyrs/interface/ui/mplgraphicsview1d.py:287:        # TODO FIXME -
20181101 - This is a broken method.  Fix it!
pyrs/core/strain_stress_calculator.py:497:    # TODO FIXME - 20181001 -
Temporarily disabled in order to clean up for the new workflow
pyrs/core/strain_stress_calculator.py:1417:        # TODO - 20181010 -
check whether all the raw files (e11/e22/e33) are ready for next!
pyrs/interface/strainstresscalwindow.py:388:        # TODO - 20181010 -
Refactor!
pyrs/interface/strainstresscalwindow.py:872:            # TODO -
20181011 - Implement (from cleaning old codes)
pyrs/interface/strainstresscalwindow.py:873:            # TODO - ASAP -
20181011 - Continue from here!
pyrs/interface/strainstresscalwindow.py:1056:        # # TODO - 20181010
- Consider how to integrate method plot_peak_parameter()
pyrs/interface/manualreductionwindow.py:140:        # TODO - 20181009 -
Need to refine
pyrs/interface/manualreductionwindow.py:207:        # TODO - 20181006 -
Implement ASAP
pyrs/interface/manualreductionwindow.py:297:        # TODO - 20181008 -
ASAP
tests/unittest/straincalculationtest.py:75:    # TODO FIXME - 20181001 -
Make an individual method for ....  ---> New workflow!
tests/unittest/straincalculationtest.py:77:        # TODO FIXME -
20181001 - This is a new suite of methods to analyze the sample grids
Also including
1. improved UI for reduced data view and detector view;
And options to show fitting error.
1. Implemented more codes on reduction including auto reduction script;
2. Started to develop a new widget containing 2 subplots for data/mode and residual respectively.
@wdzhou
Copy link
Collaborator Author

wdzhou commented Nov 26, 2018

2018.11.26

A bug (in development) to fix:

[DB...BAT] Data key: 16-1_TD.cor_Log.hdf5_44 is of type <type 'str'>
Traceback (most recent call last):
  File "build/scripts-2.7/peakfitgui_test.py", line 61, in <module>
    test_window = test_main()
  File "build/scripts-2.7/peakfitgui_test.py", line 30, in test_main
    fit_window.do_load_scans()
  File "/home/wzz/Projects/PyRS/pyrs/interface/fitpeakswindow.py", line 257, in do_load_scans
    self.do_fit_peaks()
  File "/home/wzz/Projects/PyRS/pyrs/interface/fitpeakswindow.py", line 287, in do_fit_peaks
    self._core.fit_peaks(data_key, scan_log_index, peak_function, bkgd_function, fit_range)
  File "/home/wzz/Projects/PyRS/pyrs/core/pyrscore.py", line 332, in fit_peaks
    peak_optimizer.calculate_peak_position_d(wave_length_vec=wave_length_vec)
  File "/home/wzz/Projects/PyRS/pyrs/core/mantid_fit_peak.py", line 95, in calculate_peak_position_d
    centre_vec = self.get_fitted_params(param_name='centre')
  File "/home/wzz/Projects/PyRS/pyrs/core/mantid_fit_peak.py", line 380, in get_fitted_params
    raise KeyError(err_msg)
KeyError: "Function parameter centre does not exist. Supported parameters are ['wsindex', 'peakindex', 'LorentzAmp', 'LorentzPos', 'LorentzFWHM', 'GaussianFWHM', 'A0', 'A1', 'chi2']"

@wdzhou
Copy link
Collaborator Author

wdzhou commented Dec 4, 2018

pyrs/core/polefigurecalculator.py:560:    # TODO - 20181204 - Implement head #36 - ASAP(3)
pyrs/core/reductionengine.py:63:        # TODO - 20181204 - Refer to "WANDPowderReduction" - ASAP(0)
pyrs/interface/textureanalysiswindow.py:503:        # TODO - 20181204 - Replace getSaveFileName by a self-extended method to be fine with both Qt4 and Qt5 ASAP(1)

wdzhou added 21 commits April 1, 2019 23:22
Next: Find out the difference of pixel positions of shifted detector
panel.  It is important to locate the source of discrepancy.
Nex step: add normalization by number of data points in a bin.
Note: need to take care of zero data point in a bin.
Next step:
1. complete tests/unittest/reduction_study.py
2. wait for a modified version of ResampleX which can accept same X.
Next step:
1. Make "reduction_study" work (verify with
compare_reduction_engines_test
2. VecE will be used for pixel IDs
3. Find a cycle from dip to dip from reduced data
4. After SoftXAxis examine this cycles by printing out all the 2theta,
count, pixel IDs
5. Create a normalization workspace (sorted 2theta as (4), then a vector of
1).
6. After ResampleX, check intensity/counts vs number of bins
@wdzhou
Copy link
Collaborator Author

wdzhou commented Apr 25, 2019

2019.04.26

Finished work include

  1. Verified that Mantid Resamplex and numpy.histogram can render very close result
    • compare unsorted 2theta between PyRS and Mantid engine
    • use reduction_study to compare 2 histogram methods: ResampleX and numpy.histogram
  2. An insight how the patterned dips are formed

@wdzhou wdzhou merged commit f149e4e into master Apr 26, 2019
@peterfpeterson peterfpeterson deleted the prototype_manual_reduction_032 branch October 3, 2019 20:18
@wdzhou wdzhou restored the prototype_manual_reduction_032 branch October 11, 2019 16:09
@peterfpeterson peterfpeterson deleted the prototype_manual_reduction_032 branch November 6, 2019 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working framework Generate work High Level High level issue convering a series atomic issues In progress in progress major enhancement New features or requests that involve non-trivial development minor enhancement New feature or request that will not require new module or code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant