-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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")
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request