Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
307 commits
Select commit Hold shift + click to select a range
7bd2e24
Merge pull request #39 from donald-e-boyce/imageseries-deb
joelvbernier May 4, 2016
888daa3
merge of jvb master onto imageseries, with important bugfixes
Aug 16, 2016
a49ccaa
Merge branch 'imageseries'
Sep 7, 2016
795fb07
Update meta.yaml
joelvbernier Sep 8, 2016
040a92a
Adding new scripts and a few matrix utilities.
Oct 4, 2016
10b4466
Bug fixes in virtual difffraction scripts for outputing frame caches.
Oct 10, 2016
3806d70
added multiprocessing to fiber generation (tested)
Oct 15, 2016
c7dfe26
Merge pull request #43 from darrencpagan/master
joelvbernier Oct 18, 2016
d66f1b8
fixed omega-edges to expect omegas to be nframes x 2; handled case in…
Oct 19, 2016
5a304c9
saves eta-omega maps in compressed format
Oct 19, 2016
c6a29d0
added new adapter for imagefiles type of imageseries, including a yam…
Oct 20, 2016
e70e78d
Merge pull request #44 from donald-e-boyce/joel-fork-dev
joelvbernier Oct 20, 2016
a9b67df
Merge pull request #45 from donald-e-boyce/joel-fork-imagefiles
joelvbernier Oct 20, 2016
875cd66
added file omega.py for handling omega data; currently has OmegaWedge…
Oct 20, 2016
59dd46b
added new OmegaImageSeries class and modified config files to deliver…
Oct 22, 2016
d878cb2
added imageseries processing to config file
Oct 23, 2016
1e19bfa
Merge pull request #46 from donald-e-boyce/joel-fork-imagefiles
joelvbernier Oct 24, 2016
60e0e08
corrections in refactored ReadGE.read()
Oct 27, 2016
981cbe3
fixed bug in imageseries processing for dark files in config file
Dec 6, 2016
5927217
added comment about last commit
Dec 6, 2016
e52a60f
added default pk func kwarg
Aug 15, 2016
b07ee8a
fixed relative path issues in imageseries loading and metadata
Dec 7, 2016
08cef1e
added wedge determination to omega series and fixed relative path iss…
Dec 11, 2016
e306a36
Merge remote-tracking branch 'joel/master' into joel-fork-imagefiles
Dec 13, 2016
dabefe0
added instrument module
Jan 23, 2017
0c8293d
merged in v0.3.x changes, fixed whitespaces
Jan 23, 2017
e94f9b0
Merge branch 'master' into master
joelvbernier Jan 23, 2017
f26dab3
Merge pull request #47 from donald-e-boyce/master
joelvbernier Jan 23, 2017
4af6e4b
fix branch spec in conda recipe
Jan 23, 2017
07cba2c
merged master back in
Jan 23, 2017
18c7e7c
Merge pull request #48 from donald-e-boyce/joel-fork-imagefiles
joelvbernier Jan 24, 2017
cb04b8e
Update hdf5.py
joelvbernier Jan 25, 2017
64cbc9d
fixed shape property on processed imageseries
Jan 26, 2017
0912954
added omega_to_frame and omega_ranges_to_frames methods
Jan 26, 2017
678712e
added angles_in_ranges() function intended to replace validateAngleRa…
Jan 26, 2017
16ba306
Fixes to image browser behavior
joelvbernier Jan 27, 2017
be027c2
Merge branch 'master' of github.com:joelvbernier/hexrd
Jan 27, 2017
06cf8c8
added Dexela preprocessing files to share
Jan 27, 2017
891ca03
Merge remote-tracking branch 'joel/master' into joel-fork-imagefiles
Jan 27, 2017
9ac3b02
fixed frame-cache write (cache filename in yaml file); cleaned up pp_…
Jan 27, 2017
34fd2c9
added average to imageseries.stats
Jan 27, 2017
200190f
Merge pull request #49 from donald-e-boyce/joel-fork-imagefiles
joelvbernier Jan 27, 2017
869b08e
Update instrument.py
joelvbernier Jan 29, 2017
3709327
Added powder ring integration script.
joelvbernier Jan 29, 2017
09f6c44
tweaks to imageseries for pre-processing
Jan 30, 2017
e82c5af
Update omega.py
joelvbernier Mar 20, 2017
b0e11de
added pull_spots to instrument
Mar 21, 2017
b2603e4
Merge branch 'master' into instrument
Mar 21, 2017
e417237
added line extraction and tth range plotting opt
Mar 22, 2017
9a52b8f
default pixel buffer
Mar 23, 2017
c96ac61
fixed way frame-cache writes numpy array metadata
Mar 23, 2017
61ec2a2
Merge branch 'instrument' of github.com:joelvbernier/hexrd into instr…
Mar 23, 2017
74e1842
Merge pull request #52 from donald-e-boyce/instrument
joelvbernier Mar 23, 2017
5179077
added rotation series simulator at panel level
Mar 26, 2017
7fb572b
Merge branch 'instrument' of https://github.com/joelvbernier/hexrd in…
Mar 26, 2017
46fcb27
changes related to implementing serial multipanel fit_grains
Mar 28, 2017
f05733e
sparseness check on frame-cache and casting for median
Mar 28, 2017
3457644
added max-file-frames and max-total-frames to imagefiles imageseries …
Apr 1, 2017
2acc178
Merge pull request #53 from donald-e-boyce/instrument
joelvbernier Apr 4, 2017
457518e
changes to enable mutliwedge fitting
Apr 7, 2017
9b1c669
added first pass at multipanel eta-omega generation
Apr 11, 2017
72b03f2
more fixes for multipanel indexing
Apr 13, 2017
548bfad
fixed non-int index in gui
Apr 13, 2017
01491b4
minor fixes
joelvbernier Apr 14, 2017
018ad5c
added polygon testing to pull_spots
joelvbernier Apr 14, 2017
98a9af0
catch for cse of empty panel data
joelvbernier Apr 15, 2017
79c1b35
added HDF5 patch dump, start for including pixel size in refactored d…
Apr 18, 2017
5e553e2
fixed omega windows in pull_spots
Apr 20, 2017
04e34b1
more changes to frame-cache I/O
Apr 22, 2017
0f823e2
fixes to get multipanel paintGrid working (non-numba)
Apr 29, 2017
0a0a625
Merge branch 'instrument' of https://github.com/joelvbernier/hexrd in…
May 3, 2017
ce3f146
fix to image looping in line position extractor method
May 18, 2017
8173b62
replaced dstack with tile
May 18, 2017
00ffb21
framecache load munging
Jun 8, 2017
b768078
added numba as build req
Jun 9, 2017
73e22f0
Added storage of raw patch data in pull_spots
joelvbernier Jun 15, 2017
4e76204
versioning fix in conda recipe
Jul 14, 2017
15025af
conda-build 3.0 compatibility
joelvbernier Jul 21, 2017
907ff67
another fix for conda-build 3; minor instrument tweak
Aug 3, 2017
efe4903
another fix for conda-build 3
Aug 3, 2017
942f92e
another fix for conda-build, reverting to v2 for now
Aug 3, 2017
430c333
added 'nearest' interpolation mode
Sep 14, 2017
fdeed78
fixed meta.yml conflict
Sep 14, 2017
9f858fd
changed default tth width
joelvbernier Sep 14, 2017
f7caf04
added method for converting angles to cartesian (x,y)
joelvbernier Sep 14, 2017
dc7a29a
fixed array contiguity in CAPI function
joelvbernier Sep 16, 2017
92c2593
fixed misuse of 'is' in pull_spots
joelvbernier Sep 16, 2017
2164566
Update instrument.py
joelvbernier Oct 13, 2017
4b853ac
Update xrdutil.py
joelvbernier Oct 13, 2017
3c3e93f
cleanup of pull_spots
joelvbernier Oct 14, 2017
d7fae3b
pull_spots bugs
joelvbernier Oct 14, 2017
aa78aa5
fix to pull_spots interpolation
joelvbernier Oct 14, 2017
63733d0
fix to interpolation
joelvbernier Oct 16, 2017
e6a845a
Update meta.yaml
joelvbernier Oct 31, 2017
56deda4
changes enabling refit
joelvbernier Nov 1, 2017
f668c75
fix transposing of cw90 and ccw90 flip options.
joelvbernier Dec 14, 2017
ab99111
add masking, fix fitting
Jan 6, 2018
2ac922d
fixed processed imageseries dtype
Mar 26, 2018
8c87af7
added unittests for shape & dtype in processed imageseries; disabled …
Mar 27, 2018
565d7af
fixed unit tests to match recent bugfix on flips
Mar 28, 2018
a976359
added laue simulation
Mar 28, 2018
6986783
removed lambda function
Mar 28, 2018
c7984aa
fixes to laue simulation and beam angles calc
Mar 30, 2018
d11fc22
change to HDF5 output
Apr 23, 2018
1cc10d2
remove numba hack in indexer, cleanup hdf5 output
Apr 23, 2018
0d52747
roi addition to PlanarDetector
Apr 24, 2018
e08d273
arg typo
joelvbernier Apr 25, 2018
bee37d6
running fix for versioning badness under conda-build>=3
joelvbernier Apr 25, 2018
dc37c57
reconcile CAPI transforms to v0.3.x
Apr 27, 2018
7ebd8e8
Create build.rst
joelvbernier May 1, 2018
8fa7865
change default buffer value
May 1, 2018
0c78fe6
Merge branch 'master' of https://github.com/joelvbernier/hexrd
May 2, 2018
b95d506
changes for debugging vs v0.3.x
May 3, 2018
e07aedc
reconcile xrdutil with v0.3.x updates
May 4, 2018
0803afe
Pin wxpython to version 3
joelvbernier May 7, 2018
2ae0932
updated transforms doc
May 7, 2018
3d938ae
Merge branch 'master' of https://github.com/joelvbernier/hexrd
May 7, 2018
b111f90
cleanup
May 11, 2018
3fc6f55
Merge pull request #63 from donald-e-boyce/issue-61
joelvbernier May 15, 2018
97fdc70
fix patch building bug
May 16, 2018
03304a5
indexer input casting, grain output formatting
May 16, 2018
3510973
added predicted xy output, formatting cleanup
May 16, 2018
a65a4d5
spots output formatting error None
May 16, 2018
0bf2059
added calibration params to instrument
May 21, 2018
fd1c2fd
Drop default compression level to 1 and use byte shuffling for better…
seibert May 22, 2018
b2cc668
compression level change in HDF5 output
May 23, 2018
b669ba1
fix to clip_to_panel, distortion bug uncovered
May 23, 2018
b137925
added shuffle option for hdf5 imageseries and reset default compressi…
May 24, 2018
1af9981
cleaned up prints in imageseries.stats.percentile
May 24, 2018
56dc68b
Merge pull request #64 from seibert/hdf5_speed
joelvbernier May 24, 2018
4dcfecc
Merge pull request #65 from donald-e-boyce/imageseries-hdf5-shuffle
joelvbernier May 24, 2018
c87a7e4
exports raw data on patches containing no signal'
May 24, 2018
0d4a9eb
Merge branch 'master' of https://github.com/joelvbernier/hexrd
May 24, 2018
0e16a19
list casting in instrument parameter output
May 26, 2018
5917a31
Merge branch 'master' of https://github.com/joelvbernier/hexrd
May 26, 2018
8d3f72c
added euler functions to rotations; recipe cleanup
Jun 8, 2018
52bee5c
Merge branch 'master' of https://github.com/joelvbernier/hexrd
Jun 14, 2018
71c2ff9
fix on omega edges in maps
Jun 14, 2018
926d222
parallelize overlaps, None bug in fitting
Jun 21, 2018
d5b2fbf
changed HDF write behavior
joelvbernier Jun 22, 2018
4a8c4e4
first port of NF utils
Jun 23, 2018
c7cab72
port of grainmap from v0.3.x
joelvbernier Jun 23, 2018
1f7d4ce
more nf mods
joelvbernier Jun 23, 2018
df357d7
cleanup of powder ring utils
Jun 29, 2018
595e388
changed tilt spec to exp map
Jul 23, 2018
5e9e2af
broken kwarg bug fix
Jul 31, 2018
f3d75e3
Adding multipeak fitting to the fitting package.
Sep 6, 2018
6130e7a
fixed image loading issues in nfutil and tomoutil for future scipy up…
Sep 14, 2018
5dcd569
Merge pull request #67 from darrencpagan/hexrd_0526_mp
joelvbernier Sep 26, 2018
a73e26b
improved performance for writing frame caches and loading imagefiles
Oct 10, 2018
dc72ef9
changed tilt spec to exp map
Jul 23, 2018
ea7df25
Merge branch 'new_tilt' of https://github.com/joelvbernier/hexrd into…
Oct 11, 2018
b66641b
Edited the extract_line_postitions routine to take a list of tth valu…
Oct 24, 2018
3d94c6c
Merge pull request #71 from darrencpagan/hexrd_0526_mp
joelvbernier Oct 25, 2018
2069661
Merge pull request #69 from donald-e-boyce/fabio-open
joelvbernier Oct 25, 2018
80719a2
fix reshape for split_pvoigt in _mpeak_1d_no_bg
Oct 30, 2018
2528a91
Merge pull request #72 from rachelelim/master
joelvbernier Nov 1, 2018
3650753
fixed non-numba ValueError in distortion
Nov 13, 2018
ad2282f
switch imageio to skimage.io
Nov 14, 2018
7546e9c
removed imageio dep in favor of skimage
Nov 14, 2018
4778931
check on data dimension
joelvbernier Nov 30, 2018
1b894b0
update build docs and example
joelvbernier Jan 3, 2019
ac3debb
Merge branch 'v0.5.x' into new_tilt
joelvbernier Jan 10, 2019
9fedef9
more cleanup for new tilt/cfg spec
joelvbernier Jan 23, 2019
396dccb
Merge branch 'v0.5.x' of https://github.com/joelvbernier/hexrd into v…
joelvbernier Jan 23, 2019
2c90d1b
increase stats buffer, frame-cache updates
Feb 8, 2019
cefa048
added numba helper for frame cache write
Feb 8, 2019
59c6b6a
smaller dtype for index vectors
Feb 8, 2019
248d2fe
cleanup on frame-cache
Feb 8, 2019
91d3c08
playing with STATS_BUFFER in imageseries
Feb 8, 2019
d23f222
speedup to histogramming in eta-ome map generation
Feb 9, 2019
6d8721c
more fixes to eta-ome map gen
Feb 10, 2019
9a5c3d1
roi and fake planeData edits
joelvbernier Feb 11, 2019
1e06b89
some speedups via numba and fast_histogram
joelvbernier Feb 27, 2019
ea2c4fe
fix to branch cut mapping
joelvbernier Feb 27, 2019
e3ef4df
improvements to peak fitting initial guess, config updates
joelvbernier Mar 18, 2019
b102b25
merge in recent updates to v0.5.x
joelvbernier Mar 20, 2019
2b0dd69
enhancements to fitting parameter estimation
joelvbernier Apr 2, 2019
b1581d4
added 'dtype' override in image-files adaptor
joelvbernier Apr 2, 2019
8acde3e
Merge branch 'new_tilt' into v0.5.x
joelvbernier Apr 2, 2019
df0fd0b
Update fitpeak.py
joelvbernier Apr 10, 2019
d686d35
Update build.rst
joelvbernier Apr 17, 2019
b5ab401
minor bugfix for check on float image types
joelvbernier May 7, 2019
e799d8f
fixed rmat_s handling
joelvbernier May 22, 2019
1b56abc
DeprecationWarning fixes
Aug 7, 2019
4224e33
minor change to use capi function
Aug 8, 2019
b315297
FIX: keep hdf5 file open for the whole life of imageseries.
ovillellas Aug 23, 2019
11f5aa7
Merge pull request #74 from ovillellas/v0.6.x
joelvbernier Aug 23, 2019
3b472e9
Update instrument.py
joelvbernier Sep 19, 2019
d0f301a
udpates for wxpython v4
joelvbernier Sep 26, 2019
67f17e6
Add files via upload
joelvbernier Oct 30, 2019
e794ac2
Update build.rst
joelvbernier Oct 30, 2019
4be88da
Update build.rst
joelvbernier Oct 30, 2019
bbad529
Update build.rst
joelvbernier Oct 30, 2019
8aa8846
Indexing fix
joelvbernier Feb 4, 2020
f5388e9
Merge branch 'v0.6.x' of https://github.com/joelvbernier/hexrd into v…
joelvbernier Feb 4, 2020
86cda25
fix recipe
joelvbernier Feb 4, 2020
a769281
added blob detection; fixed python version spec
joelvbernier Feb 4, 2020
7eaa0a0
indexing typo
joelvbernier Feb 4, 2020
7982e02
added blob_dog option
joelvbernier Feb 4, 2020
0fcf1ee
fixes to package dependencies
joelvbernier Feb 19, 2020
ecaeeea
added blob finding to fiber generation
Feb 21, 2020
943fb17
updates for wxpython 4 compatability
joelvbernier Feb 21, 2020
34ca77a
force 2d output
joelvbernier Feb 21, 2020
f21c523
merge local changes
joelvbernier Feb 21, 2020
1d7a534
auto sizing for imageseries stats buffer
joelvbernier Mar 10, 2020
a2c9fde
change to calibration parameter I/O
joelvbernier Mar 12, 2020
edebfc1
more fixes to calibration param I/O
joelvbernier Mar 13, 2020
47f3bf4
splash screen badness
joelvbernier Mar 19, 2020
e9d9273
modify setup.py for pip install; wxpython 4 updates
joelvbernier Mar 30, 2020
47c8d62
updated hedm config and instrument init
joelvbernier Apr 9, 2020
e31d93b
moved panel buffer to instrument spec
joelvbernier Apr 9, 2020
af9f3c5
fix to panel buffer handling; added field to config
joelvbernier Apr 9, 2020
272e3d4
cleanup to function API
joelvbernier Apr 9, 2020
efbd26c
added logging output
joelvbernier Apr 9, 2020
4a9a451
changed kwarg to addres np.load error
joelvbernier Apr 9, 2020
fcc1c68
added instr config filename to RootConfig
Apr 11, 2020
e01a501
force detector to always write sat_level and buffer
Apr 11, 2020
10f8b07
updates to config dict behavior
joelvbernier Apr 14, 2020
0eab5c2
fix for rings not on a particular detector
joelvbernier Apr 20, 2020
95e0c41
insert gridutil with correction
joelvbernier Apr 22, 2020
16c32bf
Add files via upload
kenygren May 2, 2020
62c0197
Add files via upload
kenygren May 2, 2020
2528413
Merge pull request #77 from kenygren/v0.6.x
joelvbernier May 6, 2020
fa45909
fix to eta edges
joelvbernier May 7, 2020
ec217df
fixed grain ID handling with NF misorientation
May 13, 2020
9b172e7
fixing my dumb mistakes of a commit
May 13, 2020
eac6d5b
fixed grain ID handling when reconstruction NF with misorientation
May 13, 2020
bba9c0d
fixed the grainID handling for no misorientation that broke when fixi…
May 14, 2020
c625540
whitespace cleanup
joelvbernier May 21, 2020
d32c3d3
correction to bin centers
joelvbernier May 27, 2020
f9b8691
Merge branch 'v0.6.x' of https://github.com/joelvbernier/hexrd into v…
joelvbernier May 27, 2020
02e1078
fixed error when single processing NF maps
May 28, 2020
c7292d5
restore cli for find-orientations
joelvbernier May 28, 2020
06ae56e
fixed logger typo
joelvbernier May 28, 2020
3d4801c
fit-grains CLI implementation
joelvbernier Jun 1, 2020
6bff745
hedm CLI restored
joelvbernier Jun 1, 2020
7b92419
fix to bilinear interpolation
joelvbernier Jun 9, 2020
e3c945c
line position cleanup
joelvbernier Jun 10, 2020
99663e8
Merge pull request #78 from rachelelim/master
joelvbernier Jun 10, 2020
1d437e9
import typo
joelvbernier Jun 11, 2020
18ef56d
Update README.md
joelvbernier Jun 11, 2020
bb27a1d
Update README.md
joelvbernier Jun 11, 2020
bb6046c
Update README.md
joelvbernier Jun 11, 2020
983a617
Update README.md
joelvbernier Jun 11, 2020
8f8f2c3
Merge branch 'v0.6.x' of https://github.com/joelvbernier/hexrd into v…
joelvbernier Jun 11, 2020
a05864f
Update README.md
joelvbernier Aug 12, 2020
99a3d0b
fixed unused threshold kwarg
joelvbernier Mar 17, 2021
4447367
moving inside loop to not blow up memory
joelvbernier Mar 17, 2021
f55f78f
use keVToAngstrom
joelvbernier Mar 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ hexrd.egg-info
*.so
*.*~
*#
.#*
55 changes: 51 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,51 @@
HEXRD provides a collection of resources for analysis of x-ray diffraction
data, especially high-energy x-ray diffraction. HEXRD is comprised of a
library and API for writing scripts, a command line interface, and an
interactive graphical user interface.
HEXRD
=====

HEXRD provides a collection of resources for analysis of X-ray diffraction
data, including powder diffraction, Laue diffraction, and monochromatic rotation series (_i.e._, 3DXRD/HEDM).
HEXRD is comprised of a library and API for writing scripts, a command line interface, and an
interactive graphical user interface (though this is not up to date in python2.7).

Note that this is a _legacy_ repo with minimal maintenance; the canonical HEXRD repos can now be found at https://github.com/HEXRD/hexrd.

It is recomended that you use the conda package manager for your python environment (available from either [here](https://docs.conda.io/en/latest/miniconda.html) or [here](https://www.anaconda.com/products/individual), with the former being a smaller, more barebones install).

Building
--------
You can skip this if you find a build of the desired version at my [my anaconda cloud](https://anaconda.org/joelvbernier/hexrd) page, which I update periodically. Otherwise, the recommended method is via `conda-build`. If you installed Miniconda, you will have to first install `conda-build` in your base env: `conda install conda-build`. Otherwise, using conda 4.8.3 (from Miniconda3 or Anaconda3) the best procedure is as follows:
- go to wherever you keep your git repos, _e.g._, `cd ~/Documents/GitHub`
- if you have the repo all ready, update it with a fetch and pull `fit fetch -av; git pull'
- otherwise, clone the hexrd repo: `git clone https://github.com/joelvbernier/hexrd.git`
- `cd hexrd`
- checkout the v0.6.x branch: `git checkout v0.6.x`
- make an empty env with python2.7 and numpy: `conda create --name hexrd_0.6 -c anaconda -c conda-forge python=2 numpy`
- activate your new env: `conda activate hexrd_0.6`
- install fabio from [here](https://github.com/joelvbernier/fabio.git)
- cd into wherever you keep your git repos, _e.g._, `cd ~/Documents/GitHub`
- clone repo: `git clone https://github.com/joelvbernier/fabio.git`
- grab the python 2.7 compatible branch: `git checkout py27_compat`
- `cd fabio`
- `pip install ./`
- build hexrd from the conda recipe: `conda build conda.recipe/ --python=2 -c anaconda -c conda-forge`

Installing
----------
You can check [my anaconda cloud](https://anaconda.org/joelvbernier/hexrd) for prebuillt versions; if you ffind one for your platform, then simply execute
- `conda install hexrd=0.6 -c joelvbernier`

Otherwise, you can install from a local build as follows:
- `conda install hexrd=0.6 --use-local -c anaconda -c conda-forge`

Running
-------
The function libraries lend themselves to scripts for your vaired purposes, but there is a CLI for the ff-HEDM workflow, namely indexing, `hexrd find-orientations`, and grain parameter refinement, `hexrd fit-grains`. More documentation to come.

Additional Packages
-------------------
It is highly recommended to install the `fast-histogram` package for the indexing:

- `pip install fast-histogram`

And is you want spyder, the default channel is broken for python2.7. Use the following:

- `conda install spyder=3 jupyter_client=5.3.4 -c anaconda -c conda-forge`
5 changes: 3 additions & 2 deletions conda.recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
git describe --tags --dirty > %SRC_DIR%/__conda_version__.txt
%PYTHON% %RECIPE_DIR%/format_version.py %SRC_DIR%/__conda_version__.txt
REM !!! need to replace for proper versioning under setuptools???
REM git describe --tags --dirty > %SRC_DIR%/__conda_version__.txt
REM %PYTHON% %RECIPE_DIR%/format_version.py %SRC_DIR%/__conda_version__.txt

rmdir build /s /q

Expand Down
5 changes: 3 additions & 2 deletions conda.recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
git describe --tags --dirty > $SRC_DIR/__conda_version__.txt
$PYTHON $RECIPE_DIR/format_version.py $SRC_DIR/__conda_version__.txt
# !!! need to replace for proper versioning under setuptools???
#git describe --tags --dirty > $SRC_DIR/__conda_version__.txt
#$PYTHON $RECIPE_DIR/format_version.py $SRC_DIR/__conda_version__.txt

rm -rf build

Expand Down
40 changes: 21 additions & 19 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package:
name: hexrd
version: master
version: {{ environ.get('GIT_DESCRIBE_TAG', '')[1:] }}

source:
git_url: https://github.com/joelvbernier/hexrd.git
git_tag: master # edit to point to specific branch or tag
# git_url: https://github.com/joelvbernier/hexrd.git
# git_tag: v0.6.x
git_url: ../

build:
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
detect_binary_files_with_prefix: true
osx_is_app: yes
entry_points:
Expand All @@ -18,39 +20,39 @@ app:

requirements:
build:
# - nomkl # in case MKL is broken on Linux
- numba
- numpy
- python
- setuptools
run:
- dill
- h5py
- matplotlib
# - nomkl # in case MKL is broken on Linux
- numba
- numpy
- progressbar >=2.3
- psutil
- progressbar
- python
- python.app # [osx]
- pyyaml
- qtconsole
- scikit-image
- scikit-learn
- scipy
- wxpython

test:
imports:
- hexrd
commands:
- hexrd -V
- hexrd -h
- hexrd help
- hexrd find-orientations -h
- hexrd help find-orientations
- hexrd fit-grains -h
- hexrd help fit-grains
- hexrd gui -h
- hexrd help gui
- hexrd test
# commands:
# - hexrd -V
# - hexrd -h
# - hexrd help
# - hexrd find-orientations -h
# - hexrd help find-orientations
# - hexrd fit-grains -h
# - hexrd help fit-grains
# - hexrd gui -h
# - hexrd help gui
# - hexrd test

about:
license: LGPL
Expand Down
112 changes: 112 additions & 0 deletions docs/build.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
HEXRD Build Instructions
------------------------

The preferred method for building the HEXRD package is via the conda
recipe located in ``<hexrd root>/conda.recipe``

Requirements
------------
The following tools are needed to build the package::

conda
conda-build

With `Anaconda <https://store.continuum.io/cshop/anaconda/>`_-based Python
environments, you should be able to run::

conda build conda.recipe/

Building
--------

First, the dependencies for building an environment to run hexrd::

- cython
- fabio <pip>
- h5py
- matplotlib
- numba
- numpy
- progressbar >=2.3
- python
- pyyaml
- setuptools
- scikit-image
- scikit-learn
- scipy
- wxpython

If you will be running scripts of you own, I also strongly suggest adding spyder::

- spyder

For example, to buid an environment to run hexrd v0.6.x, do the following::

conda create --name hexrd_0.6 cython h5py matplotlib numba numpy python=2.7 pyyaml setuptools scikit-image scikit-learn scipy spyder
conda install -c anaconda --name hexrd_0.6 wxpython
conda install -c anaconda --name hexrd_0.6 progressbar
conda activate hexrd_0.6


Then install using setuptools::

python setup.py install

Note, you will have to install fabio in the same environment using ``setup.py`` as well.
The procedure for building/installing with conda-build is as follows (*this is curently broken*)

First, update conda and conda-build::

conda update conda
conda update conda-build

Second, using ``conda-build``, purge previous builds (recommended,
not strictly required)::

conda build purge

In the event that you have previously run either
``python setup.py develop`` OR ``python setup.py install``, then first run
either::

python setup.py develop --uninstall

or::

python setup.py install --record files.txt
cat files.txt | xargs rm -rf

depending on how it was installed using ``distutils``. This will
remove any old builds/links.

Note that the "nuclear option" for removing hexrd is as follows::

rm -rf <anaconda root>/lib/python2.7/site-packages/hexrd*
rm <anaconda root>/bin/hexrd*

If you have installed ``hexrd`` in a specific conda environment, then
be sure to use the proper path to ``lib/`` under the root anaconda directory.

Next, run ``conda-build``::

conda build conda.recipe/ --no-test

Note that the ``--no-test`` flag supresses running the internal tests
until they are fixed (stay tuned...)

Installation
------------

Findally, run ``conda install`` using the local package::

conda install hexrd=0.6 --use-local

Conda should echo the proper version number package in the package
install list, which includes all dependencies.

At this point, a check in a fresh terminal (outside the root hexrd
directory) and run::

hexrd --verison

It should currently read ``hexrd 0.6.5``
Binary file modified docs/source/_static/transforms.pdf
Binary file not shown.
17 changes: 17 additions & 0 deletions docs/source/dev/imageseries.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
imageseries package
===============
The *imageseries* package provides a standard API for accessing image-based data sets. The primary tool in the package is the ImageSeries class. It's interface is analagous to a list of images with associated image metadata. The number of images is given by the len() function. Properties are defined for image shape (shape), data type (dtype) and metadata (metadata). Individual images are accessed by standard subscripting (e.g. image[i]).

The package contains interfaces for loading (load) and saving (save) imageseries. Images can be loaded in three formats: 'array', 'hdf5' and 'frame-cache'. The 'array' format takes the images from a 3D numpy array. With 'hdf5', images are stored in hdf5 file and accessed on demand. The 'frame-cache' is a list of sparse matrices, useful for thresholded images. An imageseries can be saved in 'hdf5' or 'frame-cache' format.

The imageseries package also contains a module for modifying the images (process). The process module provides the ProcessedImageSeries class, which takes a given imageseries and produces a new one by modifying the images. It has certain built-in image operations including transposition, flipping, dark subtraction and restriction to a subset.


Metadata
----------------

The metadata property is generically a dictionary. The actual contents depends on the application. For common hexrd applications in which the specimen is rotated while being exposed to x-rays, the metadata has an 'omega' key with an associated value being an nx2 numpy array where n is the number of frames and the two associated values give the omega (rotation) range for that frame.

Reader Refactor
-------------
While the imageseries package is in itself indpendent of hexrd, it was used as the basis of a refactoring of the reader classes originally found in the detector module. The main reader class was ReadGE. In the refactored code, the reader classes are now in their own module, image_io, but imported into detector to preserve the interface. The image_io module contains a generic OmegaImageSeries class for working with imageseries having omega metadata. The refactored ReadGE class simply uses the OmegaImageSeries class to provide the same methods as the old class. New code should use the OmegaImageSeries (or the standard ImageSeries) class directly.
1 change: 1 addition & 0 deletions docs/source/dev/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Contents:

getting_started
releases
imageseries
27 changes: 20 additions & 7 deletions hexrd/cacheframes.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ def load_frames(reader, cfg, show_progress=False):
# TODO: this should be updated to read only the frames requested in cfg
# either the images start, step, stop, or based on omega start, step, stop
start = time.time()

n_frames = reader.getNFrames()
if cfg.image_series.images.stop is not None:
n_frames = cfg.image_series.images.stop
else:
n_frames = reader.getNFrames()
logger.info("reading %d frames of data, storing values > %.1f", n_frames, cfg.fit_grains.threshold)
if show_progress:
widgets = [Bar('>'), ' ', ETA(), ' ', ReverseBar('<')]
Expand All @@ -90,6 +92,7 @@ def load_frames(reader, cfg, show_progress=False):
return reader

def cache_frames(reader, cfg, show_progress=False, overwrite=True):
start = time.time()
cache_file = os.path.join(cfg.analysis_dir, 'frame_cache.npz')
# load the data
reader = load_frames(reader, cfg, show_progress)
Expand All @@ -101,7 +104,6 @@ def cache_frames(reader, cfg, show_progress=False, overwrite=True):
arrs['%d_data' % i] = coo.data
arrs['%d_row' % i] = coo.row
arrs['%d_col' % i] = coo.col
start = time.time()
np.savez_compressed(cache_file, **arrs)
elapsed = time.time()-start
logger.info('wrote %d frames to cache in %g seconds', len(reader[0]), elapsed)
Expand All @@ -121,12 +123,23 @@ def get_frames(reader, cfg, show_progress=False, force=False, clean=False):

# temporary catch if reader is None; i.e. raw data not here but cache is
# ...NEED TO FIX THIS WHEN AXING OLD READER CLASS!
# the stop is treated as total number of frames read, which is inconsistent with
# how the start value is used, which specifies empty frames to skip at the start
# of each image. What a fucking mess!
if reader is not None:
n_frames = reader.getNFrames()
# override
if cfg.image_series.images.stop is not None:
n_frames = cfg.image_series.images.stop
else:
n_frames = reader.getNFrames()
else:
n_frames = int( (cfg.image_series.omega.stop \
- cfg.image_series.omega.start) \
/ float(cfg.image_series.omega.step) )
# still need a fix here for when you have cache only...
if cfg.image_series.images.stop is not None:
n_frames = cfg.image_series.images.stop
else:
n_frames = int( (cfg.image_series.omega.stop \
- cfg.image_series.omega.start) \
/ float(cfg.image_series.omega.step) )
logger.info("reading %d frames from cache", n_frames)

with np.load(cache_file) as npz:
Expand Down
Loading