Giter VIP home page Giter VIP logo

pyrs's People

Contributors

bretteiffert avatar earnestdl avatar fahima-islam avatar fanchercm avatar jeanbilheux avatar jmborr avatar kedokudo avatar mdoucet avatar peterfpeterson avatar quantumsteve avatar rosswhitfield avatar smithrwornl avatar walshmm avatar wdzhou avatar williamfgc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyrs's Issues

Export pole figure to mtex format

Ullich format.

  1. Free format separated by tab
  2. File posfix is ".jul"
  3. Header:
Sample Name
alpha\tbeta\tintensity
1.23\t5.64\t2.49\n
... ...
  1. alpha and beta shall be in degree but not radius

Save the reduced intensities to PyRS proect file

  1. Save to /reduced/[sub-run]/2theta/ or /reduced/[sub-run]/dspacing/
  2. Project file may contain the meta data such as min, max, step (no necessary)
  3. reduce_HB2B/reduce_engine can reduce all the sub-runs, i.e.,
    _reduced_data_dict 
    
    considers all the sun-runs in the structure
  4. Implement a one-time script to convert testing data (old HB2B runs in h5) to new project file for pole figure, peak fitting and strain/stress tests.

Refactor StrainStressCalculator due to new use cases (meeting 09/21)

Refactor and enhance StrainStressCalculator

Tasks
1. Add a process progress tracker including ‘load’, ‘align’, ‘calculate’ and etc
2. Well organize the data structure for load data, grid alignment, calculated strain/stress
3. A better copy from one strain/stress type to strain type
4. Find a list of grids that are matched among E11/E22/E33

Use cases to support

  1. New use case 1
    1. Load data to E11/E22/E33
    2. Check alignment and realize it shall be plane stress
    3. Reset to plane stress
    4. Calculate strain/stress

  2. New use case 2
    1. Load data to E11/E22 (plane strain or stress)
    2. Check alignment and realize it shall be plane stress
    3. Reset to unconstrained strain/stress
    4. Load data to E33
    5. Align and calculate

Strain/stress : new request

  1. use the finest grid as the default plot grid.

  2. bug found in use case: change model from plane strain/stress to unconstrained (solved in #30)

  3. make 1D slice working in 2D slice plot

Initialize pole figure plot with NaN

Initialize pole figure matrix/array with all NaNs. It is because that as matplotlib interpolate data points for contour plot, those NaNs will be ignored. Thus, NaN is a good representation for not-measured data points.

This is a request from users during meeting on Nov 1st.

Export the pole figure results

  1. After pole figure is calculated, it shall plot pole figure automatically;

  2. MTEX file's postfix shall be .jul

  3. MTEX file format
    L 1 |NRSF2
    L 2 |alpha beta intensity

Reading XRAY raw TIFF

File: LaB6_10kev_35deg-00004.tif ....

Traceback (most recent call last):
  File "./tests/Quick_Calibration_v2.py", line 167, in <module>
    engine, pyrs_reducer, mantid_reducer = create_instrument(hb2b_file_name, False, 2048)
  File "./tests/Quick_Calibration_v2.py", line 128, in create_instrument
    target_dimension=pixel_number, load_to_workspace=True)
  File "/home/wzz/Projects/PyRS/build/lib.linux-x86_64-2.7/pyrs/core/reductionengine.py", line 91, in load_data
    load_to_workspace=load_to_workspace)
  File "/home/wzz/Projects/PyRS/build/lib.linux-x86_64-2.7/pyrs/core/reductionengine.py", line 184, in _load_tif_image
    ''.format(image_2d_data.shape))
RuntimeError: Current algorithm can only handle 2048 x 2048 TIFF but not of size (4, 2048, 2048)

Improve peak fitting module by suggestions from demo (Part 1)

Requests form demo on May 8, 2018:

  1. Auto-load data from index 1 when HDF5 data are loaded

  2. Add difference plot between fitted and experimental data when displaying fit results

  3. Add functionality to trim the 2theta range for the data fit
    a. Option to pull the data range from the view range of the data display

Extra:

  • Fix the issue about plotting log vs log

  • Show contour plot on loaded data

Improve strain/stress module for user experience

According to the demo on 09.07, the following modification shall be made:

  1. Plot button on the main UI shall be removed. Instead, a new figure shall be plot atomically with the change of parameters.
  2. Save strain/stress to csv file
  3. Save strain/stress to ParaView format
  4. Experiment VTK with strain/stress module
  5. Keep aspect ratio between delta X and delta Y to 1:1 in slice view (2D)
  6. Make colour space stable

Calibrate HZB data set

Find out an approach and cost function to calibrate HZB diffractometer including all the data.

Define grid position sample log name into strain/stress UI

In strain and stress module, not all the sample logs can be used for grid sample position. There are very limited possibilities. Filter the sample log names and add to combo box. Possible names are

vx, vy, vz, Delta Weld, Delta Thickness, Delta Length, Cuboid *

Prototype detector geometry calibration algorithm

Note
This is the first in a series issues for developing algorithms and UI for HB2B's calibration.

Tasks

  • 1. Generate and verify detector masks files at 7 solid angles: 0, +/- 10, +/- 20 and +/- 30.
  • 2. Calibration GUI (test)
    • loads 7 masks
    • reduce with masks
    • optionally but as default normalize reduced data by vanadium
    • optionally convert to dspacing
    • compare the convert to dspacing: from a virtual single pixel detector or from 2D detector
  • 3. Calibration algorithm prototype
    • fit peaks and present the result
    • evaluate the calibration result
    • refactor Chris' prototype (Quick..v2.py) by using PyRS-reducer
  • 4. Implement an algorithm to mask detectors (ROI in fact) by solid angle.

Calibration algorithms

  • GSAS: GSASIIimage.py.ImageCalibrate: decided not to use.
  • Adopted: Separate detector into N zones by solid angle, reduce data and align peaks.

Auto calibration file suggestion

Tag:

  1. run start time;
  2. monochormator setup;

Location:
/HFIR/HB2B/shared/CALIBRATION/Si422

Including: (same as from DAS log)

  • Si422
  • Si220
  • Si311
  • Si331AF
  • Si511
  • Si400

Create region of interest by solid angles and 2theta

For every 5 degree,

  1. calculate solid angles for each pixels
  2. group pixels together by their solid angles (0, +/-10, ...)
  3. check the change of ROI's boundaries along with 2theta to determine whether resolution of 5 degree in 2theta for ROI is not too coarse.
  4. create an HDF file to contain a set of solid angle ROI/mask for future usage.

Improve file save/load user experience for peak fitting module

According to meeting on Nov. 1st:

  1. Need more buttons for saving fitting result
  2. New use case: if user loads a HDF5 and entry ‘peak fit’ is found, user will be prompted whether he wants to fit the peaks again
  3. Peak fitting result shall be saved to HDF5 (input file) automatically (with flag)

PyRS Status Demo 2019 June

Demo must include

  1. HB2B project file
    • convert old HB2B data to new project file format
  2. Re-reduction data (HZB) - #58, #60.
  3. Peak fitting (Old HB2B) - #47.
  4. Pole figure calculation (old HB2B + Chris's contribution)
  5. Strain/stress calculation and mapping (old HB2B)

Tasks coming from demo

During demo, a list of issues that are exposed including

  • PyQt4 and PyQt5 conflict: #63.

  • Fails to fit PseudoVoigt:

  • HB2B project file shall be completed:

Create IDF for HZB diffractometry and load TIFF

  1. Inside mantidproject.geometry, complete the branch to create IDF for HB2B (HZB), HB3A and Zebra.
  2. Generate the IDF (Mantid and PyRS) for HZB.
  3. Load TIFF, convert to standard HDF
  4. Verify by Mantid (oritientation)
  5. Compare geometry from Mantid and PyRS

Reduce HZB data without calibration

Reduce HZB data from 40 degree to 90 degree.

By visualization of all the reduced data, a decision will be made whether the prototyped calibration approach working with X-ray data can work with neutron data due to the difference in resolution.

Peak fitting module: minor UI improvement and bug fixe from meeting 9/21

  1. Browse and load data

    • Move push button Load to first line with IPTS
    • Add a checkbox to load data automatically if push button Browse is clicked
  2. Bug fix: if data is reloaded, upper-right corner plot shall be cleared and reset to original status

  3. Bug fix: upper right corner plot’s parameter selection list gets new parameters added to the combobox while the old ones are still remained there.

  4. Remove Lorentzian from the supported peak list because it is not a peak shape for HB2B

  5. (previous 6) Bug fix: handle the case if user input a scan log index out of range to plot

== Note ==
Item 5 is taken out and will be resolved in an individual issue.
5. Output peak parameter ‘mixing’ in the fitted peak parameters

Make peak fitting smarter

  1. Advanced fitting setup allowing to fit with a set of peak profiles instead one;
  2. Fit result can be exported to a movie and PNGs with previous setup;
  3. A report can be made (in table) to nail down the bad fits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.