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

Streamfile creator for profiles #2

Open
DavidDierickx opened this issue Nov 11, 2022 · 0 comments
Open

Streamfile creator for profiles #2

DavidDierickx opened this issue Nov 11, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@DavidDierickx
Copy link
Contributor

New function for creating stream files out of numpy arrays.

import numpy as np

def streamfile(filename, profile, n_passes, sputter_rate, dwell_time_base):
# Dwell time base = 100ns
# Sputter rate = ?

profile = profile / (n_passes * sputter_rate * dwell_time_base)

# create a list of lists
profile_list = []
for i in range(profile.shape[0]):
    for j in range(profile.shape[1]):
        profile_list.append([profile[i,j], i, j])
# write the header
np.random.shuffle(profile_list)

with open(filename, "w") as f:
    f.write("s\n")
    f.write(str(n_passes)+"\n")
    f.write(str(profile.shape[0]*profile.shape[1])+"\n")

# write the profile
with open(filename, "a") as f:
    for i in range(len(profile_list)):
        f.write(str(profile_list[i][0])+" "+str(profile_list[i][1])+" "+str(profile_list[i][2])+"\n")
@DavidDierickx DavidDierickx added the enhancement New feature or request label Nov 11, 2022
@patrickcleeve2 patrickcleeve2 self-assigned this Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants