Exemple #1
0
def save_s_peaks_image(s):
    s_peaks = am.get_feature_separation(s, separation_range=(2, 20))
    s_peaks.plot()
    s_peaks._plot.signal_plot.figure.savefig(os.path.join(
        my_path, 'peak_finding_1a.png'),
                                             overwrite=True)
    s_peaks._plot.navigator_plot.figure.savefig(os.path.join(
        my_path, 'peak_finding_1b.png'),
                                                overwrite=True)
    s_peaks.axes_manager.indices = (5, )
    s_peaks._plot.signal_plot.figure.savefig(os.path.join(
        my_path, 'peak_finding_2a.png'),
                                             overwrite=True)
    s_peaks._plot.navigator_plot.figure.savefig(os.path.join(
        my_path, 'peak_finding_2b.png'),
                                                overwrite=True)
    s_peaks.axes_manager.indices = (10, )
    s_peaks._plot.signal_plot.figure.savefig(os.path.join(
        my_path, 'peak_finding_3a.png'),
                                             overwrite=True)
    s_peaks._plot.navigator_plot.figure.savefig(os.path.join(
        my_path, 'peak_finding_3b.png'),
                                                overwrite=True)
import temul.api as tml
''' This file will find the sublattices in your image. Check out Atomap.org
    for lots of information on how to use atomap.

Note: this file is not guaranteed to find what you want. It varies from image
to image. Check out the other "2_Find_Sublattices..." files for different
types of materials.
'''
''' Get the Pixel separation between the atoms in your first sublattice

Note: If you have used the image filter file, then replace "image" with
"image_ifft" or whatever you called your filtered file.
'''

# look at the different pixel separations available, this can take some time.
feat = am.get_feature_separation(image, separation_range=(5, 20), pca=True)
feat.plot()
''' If you're happy with one of the pixel separations, then set it below. If
    you're not, you may need to change your separation_range or filter your
    image with the "1b_Filter_Data.py" file.

Note: If you have used the image filter file, then replace "image" with
"image_ifft" or whatever you called your filtered file.    
'''

sep = 9  # just an example
atom_positions1 = am.get_atom_positions(image, separation=sep, pca=True)

# save these original sub1 positions!
np.save('atom_positions1.npy', arr=atom_positions1)
Exemple #3
0
import os
import numpy as np
import atomap.api as am
import atomap.initial_position_finding as ipf

my_path = os.path.join(os.path.dirname(__file__), 'makedumbbelllattice')
if not os.path.exists(my_path):
    os.makedirs(my_path)

#####
s = am.dummy_data.get_dumbbell_heterostructure_signal()
s.plot()
s._plot.signal_plot.figure.savefig(os.path.join(my_path, 'dummy_data.png'))

#####
s_peaks = am.get_feature_separation(s, separation_range=(2, 6))
s_peaks.plot()
s_peaks._plot.signal_plot.figure.savefig(os.path.join(my_path, 'feature_separation_all_atoms.png'))

#####
atom_positions = am.get_atom_positions(s, separation=2)
dumbbell_vector = ipf.find_dumbbell_vector(atom_positions)

#####
s_peaks = am.get_feature_separation(s, separation_range=(5, 20))
s_peaks.axes_manager.indices = (3,)
s_peaks.plot()
s_peaks._plot.signal_plot.figure.savefig(os.path.join(my_path, 'feature_separation_dumbbell.png'))

#####
dumbbell_positions = am.get_atom_positions(s, separation=8)
# ...

######## Model Creation Example - Au NP ########

s = tml.example_data.load_example_Au_nanoparticle()
s.plot()

cropping_area = am.add_atoms_with_gui(s.data)

s_crop = tml.crop_image_hs(image=s,
                           cropping_area=cropping_area,
                           save_image=True,
                           save_variables=True,
                           scalebar_true=True)

am.get_feature_separation(signal=s_crop, separation_range=(10, 15),
                          pca=True).plot()

atom_positions = am.get_atom_positions(s_crop, separation=12, pca=True)
atom_positions = am.add_atoms_with_gui(image=s_crop, atom_list=atom_positions)
# np.save("Au_NP_atom_positions", atom_positions)
# atom_positions = np.load("Au_NP_atom_positions.npy")

sublattice = am.Sublattice(atom_position_list=atom_positions, image=s_crop)
sublattice.plot()

atom_lattice = am.Atom_Lattice(image=s_crop,
                               name="Au_NP_1",
                               sublattice_list=[sublattice])
atom_lattice.save(filename="Au_NP_Atom_Lattice.hdf5", overwrite=True)

######## Model Creation Example ########