Comments (6)
Will look into this right away after making sure we can load HDF5 files with kp.load()
.
from kikuchipy.
- ii. Solution that seems to work is:
if (omd.deadpixels_corrected and omd.deadpixels.any() and
omd.deadvalue.any()):
- iii. Also, a runtime error is encountered in the rescale:
RuntimeWarning: overflow encountered in byte_scalars
scale = float(omax / (pattern.max() - imin))
from kikuchipy.
i. Raising an error is the correct response since no background image is provided, however the error message could be clearer. I changed from except ValueError:
to except (ValueError, AttributeError):
so that the custom error message "No background image provided" is printed also when the original_metadata
has no General.original_filepath
parameter. Note that this error message will be raised when this is the case, regardless of which loading function (HyperSpy's or KikuchiPy's) is used.
ii. As you say, changing to omd.deadpixels.any()
fixes the problem! There is no need to add it to a string though, i.e. omd.deadvalue
.
iii. Pretty sure the problem is a too narrow data type (np.int8
, [-128, 127]). If so, this warning is raised when the subtraction of a static background from a pattern yields some pixels with negative values below -128. This is prevented by setting both patterns data types to np.int16
, [-32 768, 32 767], in kikuchipy/utils/expt_utils.py
here:
def correct_background([...]):
[...]
if static:
# Change data types to avoid negative intensities in subtraction
dtype = np.int16
pattern = pattern.astype(dtype)
bg = bg.astype(dtype)
[...]
Could you see if this fixes the problem? I cannot remember if correct_background()
leaks much memory, I think not, but if so raising to 16-bit will make thinks worse... Will check this myself if this solves the problem.
from kikuchipy.
I see that the comment explaining the code (# Change data types...
) is wrong, will remove this when pushing fixes to the problems.
from kikuchipy.
Have you checked my solution to problem iii?
from kikuchipy.
Solved in PR #28.
from kikuchipy.
Related Issues (20)
- Test suite failure in custom Dask chunking functions HOT 2
- PyVista/pythreejs backend does not display anything in a Jupyter notebook HOT 1
- Errors when plotting interactively in notebooks via nbsphinx with PyVista/pythreejs HOT 2
- ValueError when removing static background HOT 10
- Cannot read Oxford's binary .ebsp files with version 4 HOT 9
- ValueError from Dask in EBSD.refine_orientation() in develop branch HOT 1
- Minor 0.8 release coming up HOT 2
- Integration test suite failure HOT 5
- Keeping not_indexed dummy phase after orientation refinement HOT 5
- Lazy and Dask Improvements HOT 2
- Build documentation on Windows (without PyVista frame buffer)
- Segmentation fault HOT 4
- Merging crystal maps with not_indexed points results in removal of phase HOT 1
- Support Python 3.11 HOT 1
- Support HyperSpy 2.0 HOT 10
- Error with `kikuchipy.data.si_wafer` HOT 1
- kikuchipy v0.9.0 HOT 1
- `TestKikuchipyH5EBSD.test_load_with_padding` test failure HOT 1
- Reading of master patterns generated with EDAX HOT 4
- Post-process and index raw diffraction patterns in a .tif format HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kikuchipy.