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

Release into main version 0.14.10 #634

Merged
merged 68 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
2a80e98
Adding more papers
cophus Nov 8, 2023
53ad64b
more cites
cophus Nov 8, 2023
213808f
Merge remote-tracking branch 'cophus/dev' into dev
cophus Dec 20, 2023
cbce25c
bug fix
smribet Jan 9, 2024
d366aca
Revert "bug fix"
gvarnavi Jan 12, 2024
c109d95
Bump tj-actions/changed-files from 41 to 42
dependabot[bot] Jan 22, 2024
fc51379
Bump github/super-linter from 4 to 5
dependabot[bot] Jan 22, 2024
1598ac2
Bump actions/checkout from 3 to 4
dependabot[bot] Jan 22, 2024
f35f683
Bump actions/setup-python from 2 to 5
dependabot[bot] Jan 22, 2024
11c27fa
Merge remote-tracking branch 'origin/dev' into phase_contrast
gvarnavi Jan 25, 2024
f08049b
Merge pull request #600 from py4dstem/dependabot/github_actions/tj-ac…
bsavitzky Jan 25, 2024
6dffda1
Merge pull request #601 from py4dstem/dependabot/github_actions/githu…
bsavitzky Jan 25, 2024
c76cb1e
Merge pull request #602 from py4dstem/dependabot/github_actions/actio…
bsavitzky Jan 25, 2024
a1e3662
Merge pull request #603 from py4dstem/dependabot/github_actions/actio…
bsavitzky Jan 25, 2024
fd8ee7b
num_probes_fit_aberrations
smribet Jan 28, 2024
3ca1869
flip 180 option for read arina
smribet Jan 31, 2024
633fb01
ptycho positions offset
smribet Feb 1, 2024
e992335
Merge remote-tracking branch 'origin/dev' into dev
cophus Feb 2, 2024
15aeca1
remove 180 flip
smribet Feb 2, 2024
92cd0f7
tweaking amorphous fitting function
cophus Feb 2, 2024
7a1a167
median_filter_masked_pixels
smribet Feb 2, 2024
6f022f7
save polar aberrations instead
gvarnavi Feb 6, 2024
be2cd20
read-write compatibility
gvarnavi Feb 6, 2024
7ec0160
uncertainty viz bug
gvarnavi Feb 6, 2024
4f433f0
adding force_com_measured functionality to ptycho
gvarnavi Feb 6, 2024
314ee79
clean up force_com_measured
gvarnavi Feb 7, 2024
dde1eda
adding DP normalization progress bar
gvarnavi Feb 7, 2024
4cca38a
moving fov_mask calc to as needed
gvarnavi Feb 7, 2024
aaf957f
adding detector_fourier_mask
gvarnavi Feb 8, 2024
99c70ad
bug fix for filtering
smribet Feb 10, 2024
2eae7d8
Friedel origin finder, various FEM tools (#607)
cophus Feb 26, 2024
f419f27
Merge remote-tracking branch 'origin/dev' into dev
cophus Feb 26, 2024
dd4c6d8
Default threshold should be zero
cophus Feb 26, 2024
6b3e8af
Release memory after Bayesian optimization (#599)
sezelt Feb 28, 2024
d7e7472
remove duplicate make_fourier_coords_2D
sezelt Feb 28, 2024
d478aa1
format with black
sezelt Feb 28, 2024
d3ec3c2
Added phase_contrast warning in README (#608)
gvarnavi Feb 28, 2024
b9ac79d
Merge remote-tracking branch 'origin/dev' into phase_contrast
gvarnavi Mar 5, 2024
84bbc04
switching to non-vectorized datacube resampling
gvarnavi Mar 6, 2024
9718a98
Merge pull request #611 from sezelt/fourier_coords_dedup
bsavitzky Mar 7, 2024
f47a3b4
Merge pull request #610 from cophus/dev
bsavitzky Mar 7, 2024
963df98
fixing region_of_interest_shape flag
gvarnavi Mar 9, 2024
b772a8c
adding cross-correlation function
gvarnavi Mar 9, 2024
2d474cd
more careful array sums interpolation
gvarnavi Mar 12, 2024
0ac074d
Bump gdown to 5.1.0 (#617)
gvarnavi Mar 13, 2024
569fbc4
Merge remote-tracking branch 'origin/dev' into phase_contrast
gvarnavi Mar 13, 2024
1afa166
docstring change per Colin review
gvarnavi Mar 13, 2024
6806055
DP resampling mode to nearest
gvarnavi Mar 14, 2024
1137191
adding fourier_mask in forward mode, ie pre error calculation
gvarnavi Mar 14, 2024
b326bca
Merge pull request #616 from py4dstem/phase_contrast
cophus Mar 14, 2024
facf1e1
small bugfix, moving reset before object_type change
gvarnavi Mar 15, 2024
2d4928e
parallax odd pixel padding bugfix
gvarnavi Mar 18, 2024
e132c87
parallax upsample, fit, and correct should return self
gvarnavi Mar 18, 2024
22fc8b9
removing Wiener filter
gvarnavi Mar 18, 2024
b0bbc52
fixing depth sectioning
gvarnavi Mar 18, 2024
2ec33e2
Merge pull request #630 from py4dstem/phase_contrast
cophus Mar 18, 2024
5bd35b7
Bump tj-actions/changed-files from 42 to 43 (#629)
dependabot[bot] Mar 19, 2024
5380901
fixing aberration correction for odd radial symmetries. I think the s…
gvarnavi Mar 21, 2024
b093eaa
Merge remote-tracking branch 'origin/dev' into phase_contrast
gvarnavi Mar 21, 2024
bc8f333
ACOM module - fix for .ang file writer (#382)
cophus Mar 21, 2024
a8912ba
Merge pull request #632 from py4dstem/phase_contrast
smribet Mar 21, 2024
74ede03
Fixing projection 2D thickness (#631)
cophus Mar 21, 2024
7a0e34c
Versioning to 0.14.10
cophus Mar 21, 2024
db2b987
Merge pull request #633 from cophus/dev
cophus Mar 21, 2024
1ef52d6
Revert "Versioning to 0.14.10"
sezelt Mar 21, 2024
7ddd4f5
Merge pull request #635 from py4dstem/revert-633-dev
cophus Mar 21, 2024
c21aa51
Update pypi_upload.yml
sezelt Mar 21, 2024
ac1a498
Update pypi_upload.yml
sezelt Mar 21, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: psf/black@stable
4 changes: 2 additions & 2 deletions .github/workflows/build-flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check_install_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
# runs-on: macos-latest
# allow_failure: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install repo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check_install_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
# runs-on: macos-latest
# allow_failure: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install repo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check_install_quick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
# runs-on: macos-latest
# allow_failure: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install repo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter@v4
uses: github/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_PYTHON_FLAKE8: true
Expand Down
94 changes: 47 additions & 47 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
# pull_request:
# branches:
# - main

jobs:
update_version:
runs-on: ubuntu-latest
name: Check if version.py is changed and update if the version.py is not changed
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_ACTION_VERSION_UPDATE }}
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v43
with:
files: |
py4DSTEM/version.py
Expand All @@ -39,47 +39,47 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "bsavitzky"
git commit -a -m "Auto-update version number (GH Action)"
git push origin main
sync_with_dev:
needs: update_version
runs-on: ubuntu-latest
name: Sync main with dev
steps:
- name: Sync main with dev
uses: actions/checkout@v3
with:
ref: dev
fetch-depth: 0
token: ${{ secrets.GH_ACTION_VERSION_UPDATE }}
- run: |
# set strategy to default merge
git config pull.rebase false
git config --global user.email "[email protected]"
git config --global user.name "bsavitzky"
git pull origin main --commit --no-edit
git push origin dev
deploy:
needs: sync_with_dev
runs-on: ubuntu-latest
name: Deploy to PyPI
steps:
- uses: actions/checkout@v3
with:
ref: dev
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
git push origin
# sync_with_dev:
# needs: update_version
# runs-on: ubuntu-latest
# name: Sync main with dev
# steps:
# - name: Sync main with dev
# uses: actions/checkout@v4
# with:
# ref: dev
# fetch-depth: 0
# token: ${{ secrets.GH_ACTION_VERSION_UPDATE }}
# - run: |
# # set strategy to default merge
# git config pull.rebase false
# git config --global user.email "[email protected]"
# git config --global user.name "bsavitzky"
# git pull origin main --commit --no-edit
# git push origin dev
# deploy:
# needs: sync_with_dev
# runs-on: ubuntu-latest
# name: Deploy to PyPI
# steps:
# - uses: actions/checkout@v4
# with:
# ref: dev
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: 3.8
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install build
# - name: Build package
# run: python -m build
# - name: Publish package
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

> :warning: **py4DSTEM version 0.14 update** :warning: Warning: this is a major update and we expect some workflows to break. You can still install previous versions of py4DSTEM [as discussed here](#legacyinstall)


> :warning: **Phase retrieval refactor version 0.14.9** :warning: Warning: The phase-retrieval modules in py4DSTEM (DPC, parallax, and ptychography) underwent a major refactor in version 0.14.9 and as such older tutorial notebooks will not work as expected. Notably, class names have been pruned to remove the trailing "Reconstruction" (`DPCReconstruction` -> `DPC` etc.), and regularization functions have dropped the `_iter` suffix (and are instead specified as boolean flags). We are working on updating the tutorial notebooks to reflect these changes. In the meantime, there's some more information in the relevant pull request [here](https://github.com/py4dstem/py4DSTEM/pull/597#issuecomment-1890325568).

![py4DSTEM logo](/images/py4DSTEM_logo.png)

Expand Down
63 changes: 41 additions & 22 deletions docs/papers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,76 @@

Please email [email protected] if you have used py4DSTEM for analysis and your paper is not listed below!

### 2022 (9)
### 2023 (0)

[Correlative image learning of chemo-mechanics in phase-transforming solids](https://www.nature.com/articles/s41563-021-01191-0), Nature Materials (2022)

[Correlative analysis of structure and chemistry of LixFePO4 platelets using 4D-STEM and X-ray ptychography](https://doi.org/10.1016/j.mattod.2021.10.031), Materials Today 52, 102 (2022).

[Visualizing Grain Statistics in MOCVD WSe2 through Four-Dimensional Scanning Transmission Electron Microscopy](https://doi.org/10.1021/acs.nanolett.1c04315), Nano Letters 22, 2578 (2022).
### 2022 (16)

[Electric field control of chirality](https://doi.org/10.1126/sciadv.abj8030), Science Advances 8 (2022).

[Real-Time Interactive 4D-STEM Phase-Contrast Imaging From Electron Event Representation Data: Less computation with the right representation](https://doi.org/10.1109/MSP.2021.3120981), IEEE Signal Processing Magazine 39, 25 (2022).
[Disentangling multiple scattering with deep learning: application to strain mapping from electron diffraction patterns](https://doi.org/10.1038/s41524-022-00939-9), J Munshi*, A Rakowski*, et al., npj Computational Materials 8, 254 (2022)

[Microstructural dependence of defect formation in iron-oxide thin films](https://doi.org/10.1016/j.apsusc.2022.152844), Applied Surface Science 589, 152844 (2022).
[Flexible CO2 Sensor Architecture with Selective Nitrogen Functionalities by One-Step Laser-Induced Conversion of Versatile Organic Ink](https://doi.org/10.1002/adfm.202207406), H Wang et al., Advanced Functional Materials 32, 2207406 (2022)

[Chemical and Structural Alterations in the Amorphous Structure of Obsidian due to Nanolites](https://doi.org/10.1017/S1431927621013957), Microscopy and Microanalysis 28, 289 (2022).
[Defect Contrast with 4D-STEM: Understanding Crystalline Order with Virtual Detectors and Beam Modification](https://doi.org/10.1093/micmic/ozad045) SM Ribet et al., Microscopy and Microanalysis 29, 1087 (2023).

[Nanoscale characterization of crystalline and amorphous phases in silicon oxycarbide ceramics using 4D-STEM](https://doi.org/10.1016/j.matchar.2021.111512), Materials Characterization 181, 111512 (2021).
[Structural heterogeneity in non-crystalline TexSe1−x thin films](https://doi.org/10.1063/5.0094600), B Sari et al., Applied Physics Letters 121, 012101 (2022)

[Disentangling multiple scattering with deep learning: application to strain mapping from electron diffraction patterns](https://arxiv.org/abs/2202.00204), arXiv:2202.00204 (2022).
[Cryogenic 4D-STEM analysis of an amorphouscrystalline polymer blend: Combined nanocrystalline and amorphous phase mapping](https://doi.org/10.1016/j.isci.2022.103882), J Donohue et al., iScience 25, 103882 (2022)

[Hydrogen-assisted decohesion associated with nanosized grain boundary κ-carbides in a high-Mn lightweight steel](https://doi.org/10.1016/j.actamat.2022.118392), MN Elkot et al., Acta Materialia
241, 118392 (2022)

[4D-STEM Ptychography for Electron-Beam-Sensitive Materials](https://doi.org/10.1021/acscentsci.2c01137), G Li et al., ACS Central Science 8, 1579 (2022)

[Developing a Chemical and Structural Understanding of the Surface Oxide in a Niobium Superconducting Qubit](https://doi.org/10.1021/acsnano.2c07913), AA Murthy et al., ACS Nano 16, 17257 (2022)

[Correlative image learning of chemo-mechanics in phase-transforming solids](https://www.nature.com/articles/s41563-021-01191-0), HD Deng et al., Nature Materials (2022)

[Correlative analysis of structure and chemistry of LixFePO4 platelets using 4D-STEM and X-ray ptychography](https://doi.org/10.1016/j.mattod.2021.10.031), LA Hughes*, BH Savitzky, et al., Materials Today 52, 102 (2022)

[Visualizing Grain Statistics in MOCVD WSe2 through Four-Dimensional Scanning Transmission Electron Microscopy](https://doi.org/10.1021/acs.nanolett.1c04315), A Londoño-Calderon et al., Nano Letters 22, 2578 (2022)

[Electric field control of chirality](https://doi.org/10.1126/sciadv.abj8030), P Behera et al., Science Advances 8 (2022)

[Real-Time Interactive 4D-STEM Phase-Contrast Imaging From Electron Event Representation Data: Less computation with the right representation](https://doi.org/10.1109/MSP.2021.3120981), P Pelz et al., IEEE Signal Processing Magazine 39, 25 (2022)

[Microstructural dependence of defect formation in iron-oxide thin films](https://doi.org/10.1016/j.apsusc.2022.152844), BK Derby et al., Applied Surface Science 589, 152844 (2022)

[Chemical and Structural Alterations in the Amorphous Structure of Obsidian due to Nanolites](https://doi.org/10.1017/S1431927621013957), E Kennedy et al., Microscopy and Microanalysis 28, 289 (2022)

[Nanoscale characterization of crystalline and amorphous phases in silicon oxycarbide ceramics using 4D-STEM](https://doi.org/10.1016/j.matchar.2021.111512), Ni Yang et al., Materials Characterization 181, 111512 (2021)



### 2021 (10)

[Cryoforged nanotwinned titanium with ultrahigh strength and ductility](https://doi.org/10.1126/science.abe7252), Science 16, 373, 1363 (2021).
[Cryoforged nanotwinned titanium with ultrahigh strength and ductility](https://doi.org/10.1126/science.abe7252), Science 16, 373, 1363 (2021)

[Strain fields in twisted bilayer graphene](https://doi.org/10.1038/s41563-021-00973-w), Nature Materials 20, 956 (2021).
[Strain fields in twisted bilayer graphene](https://doi.org/10.1038/s41563-021-00973-w), Nature Materials 20, 956 (2021)

[Determination of Grain-Boundary Structure and Electrostatic Characteristics in a SrTiO3 Bicrystal by Four-Dimensional Electron Microscopy](https://doi.org/10.1021/acs.nanolett.1c02960), Nanoletters 21, 9138 (2021).
[Determination of Grain-Boundary Structure and Electrostatic Characteristics in a SrTiO3 Bicrystal by Four-Dimensional Electron Microscopy](https://doi.org/10.1021/acs.nanolett.1c02960), Nanoletters 21, 9138 (2021)

[Local Lattice Deformation of Tellurene Grain Boundaries by Four-Dimensional Electron Microscopy](https://pubs.acs.org/doi/10.1021/acs.jpcc.1c00308), Journal of Physical Chemistry C 125, 3396 (2021).

[Extreme mixing in nanoscale transition metal alloys](https://doi.org/10.1016/j.matt.2021.04.014), Matter 4, 2340 (2021).
[Extreme mixing in nanoscale transition metal alloys](https://doi.org/10.1016/j.matt.2021.04.014), Matter 4, 2340 (2021)

[Multibeam Electron Diffraction](https://doi.org/10.1017/S1431927620024770), Microscopy and Microanalysis 27, 129 (2021).
[Multibeam Electron Diffraction](https://doi.org/10.1017/S1431927620024770), Microscopy and Microanalysis 27, 129 (2021)

[A Fast Algorithm for Scanning Transmission Electron Microscopy Imaging and 4D-STEM Diffraction Simulations](https://doi.org/10.1017/S1431927621012083), Microscopy and Microanalysis 27, 835 (2021).
[A Fast Algorithm for Scanning Transmission Electron Microscopy Imaging and 4D-STEM Diffraction Simulations](https://doi.org/10.1017/S1431927621012083), Microscopy and Microanalysis 27, 835 (2021)

[Fast Grain Mapping with Sub-Nanometer Resolution Using 4D-STEM with Grain Classification by Principal Component Analysis and Non-Negative Matrix Factorization](https://doi.org/10.1017/S1431927621011946), Microscopy and Microanalysis 27, 794
[Fast Grain Mapping with Sub-Nanometer Resolution Using 4D-STEM with Grain Classification by Principal Component Analysis and Non-Negative Matrix Factorization](https://doi.org/10.1017/S1431927621011946), Microscopy and Microanalysis 27, 794 (2021)

[Prismatic 2.0 – Simulation software for scanning and high resolution transmission electron microscopy (STEM and HRTEM)](https://doi.org/10.1016/j.micron.2021.103141), Micron 151, 103141 (2021).
[Prismatic 2.0 – Simulation software for scanning and high resolution transmission electron microscopy (STEM and HRTEM)](https://doi.org/10.1016/j.micron.2021.103141), Micron 151, 103141 (2021)

[4D-STEM of Beam-Sensitive Materials](https://doi.org/10.1021/acs.accounts.1c00073), Accounts of Chemical Research 54, 2543 (2021).
[4D-STEM of Beam-Sensitive Materials](https://doi.org/10.1021/acs.accounts.1c00073), Accounts of Chemical Research 54, 2543 (2021)


### 2020 (3)

[Patterned probes for high precision 4D-STEM bragg measurements](https://doi.org/10.1063/5.0015532), Ultramicroscopy 209, 112890 (2020).

[Patterned probes for high precision 4D-STEM bragg measurements](https://doi.org/10.1063/5.0015532), Ultramicroscopy 209, 112890 (2020)

[Tilted fluctuation electron microscopy](https://doi.org/10.1063/5.0015532), Applied Physics Letters 117, 091903 (2020).
[Tilted fluctuation electron microscopy](https://doi.org/10.1063/5.0015532), Applied Physics Letters 117, 091903 (2020)

[4D-STEM elastic stress state characterisation of a TWIP steel nanotwin](https://arxiv.org/abs/2004.03982), arXiv:2004.03982

8 changes: 5 additions & 3 deletions py4DSTEM/braggvectors/diskdetection_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ def find_Bragg_disks_CUDA(
patt_idx = batch_idx * batch_size + subbatch_idx
rx, ry = np.unravel_index(patt_idx, (datacube.R_Nx, datacube.R_Ny))
batched_subcube[subbatch_idx, :, :] = cp.array(
datacube.data[rx, ry, :, :]
if filter_function is None
else filter_function(datacube.data[rx, ry, :, :]),
(
datacube.data[rx, ry, :, :]
if filter_function is None
else filter_function(datacube.data[rx, ry, :, :])
),
dtype=cp.float32,
)

Expand Down
32 changes: 27 additions & 5 deletions py4DSTEM/datacube/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ def pad_Q(self, N=None, output_size=None):
d = pad_data_diffraction(self, pad_factor=N, output_size=output_size)
return d

def resample_Q(self, N=None, output_size=None, method="bilinear"):
def resample_Q(
self, N=None, output_size=None, method="bilinear", conserve_array_sums=False
):
"""
Resamples the data in diffraction space by resampling factor N, or to match output_size,
using either 'fourier' or 'bilinear' interpolation.
Expand All @@ -418,7 +420,11 @@ def resample_Q(self, N=None, output_size=None, method="bilinear"):
from py4DSTEM.preprocess import resample_data_diffraction

d = resample_data_diffraction(
self, resampling_factor=N, output_size=output_size, method=method
self,
resampling_factor=N,
output_size=output_size,
method=method,
conserve_array_sums=conserve_array_sums,
)
return d

Expand Down Expand Up @@ -479,13 +485,29 @@ def filter_hot_pixels(self, thresh, ind_compare=1, return_mask=False):
"""
from py4DSTEM.preprocess import filter_hot_pixels

d = filter_hot_pixels(
datacube = filter_hot_pixels(
self,
thresh,
ind_compare,
return_mask,
)
return d
return datacube

def median_filter_masked_pixels(self, mask, kernel_width: int = 3):
"""
This function fixes a datacube where the same pixels are consistently
bad. It requires a mask that identifies all the bad pixels in the dataset.
Then for each diffraction pattern, a median kernel is applied around each
bad pixel with the specified width.
"""
from py4DSTEM.preprocess import median_filter_masked_pixels

datacube = median_filter_masked_pixels(
self,
mask,
kernel_width,
)
return datacube

# Probe

Expand All @@ -494,7 +516,7 @@ def get_vacuum_probe(
ROI=None,
align=True,
mask=None,
threshold=0.2,
threshold=0.0,
expansion=12,
opening=3,
verbose=False,
Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/io/importfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def import_file(
"gatan_K2_bin",
"mib",
"arina",
"abTEM"
"abTEM",
# "kitware_counted",
], "Error: filetype not recognized"

Expand Down
2 changes: 1 addition & 1 deletion py4DSTEM/io/legacy/legacy13/v13_emd_classes/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def Array_to_h5(array, group):
data = grp.create_dataset(
"data",
shape=array.data.shape,
data=array.data
data=array.data,
# dtype = type(array.data)
)
data.attrs.create(
Expand Down
Loading