-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Power vs. Nitrogen Pressure Mapping Scripts
Added "Mapping Data - Median.py" for the generation of a test/mapping data set that is used to produce a PAMBE processing space of two axes: one of RF plasma power and the other of substrate temperature. The other script, "Random Forest - Median.py" is used to train a random forest on the GaN Lattice Disorder S^2 training data CSV file and then makes predictions using the testing/mapping data previously produced by the "Mapping Data - Median.py" file.
- Loading branch information
1 parent
955ad37
commit df81935
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
Code/Python/Gallium Nitride/Lattice Disorder/Mapping Data - Median.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Andrew S. Messecar | ||
import csv | ||
|
||
# Median Substrate Temperature = 770 | ||
N2_Pressure = 0.00001 | ||
Gallium_Temperature = 960 | ||
# Median RF Power = 150 | ||
# Median Growth Time = 180 | ||
|
||
header = ['Substrate Temperature', 'RF Power', 'Ga Temperature', 'N2 Pressure'] | ||
|
||
with open('/home/garibasen/Documents/Data/WMU/Dropbox/S-squared/Mapping Data/Mapping_Data_Median.csv', 'w', encoding='UTF8', newline='') as f: | ||
writer = csv.writer(f) | ||
writer.writerow(header) | ||
|
||
for i in range(550): | ||
|
||
for j in range(1000): | ||
|
||
data = [j, 550 - i, Gallium_Temperature, N2_Pressure] | ||
|
||
writer.writerow(data) |
47 changes: 47 additions & 0 deletions
47
Code/Python/Gallium Nitride/Lattice Disorder/Random Forest - Median.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Andrew Messecar | ||
|
||
from sklearn.ensemble import RandomForestRegressor | ||
from sklearn.preprocessing import MinMaxScaler | ||
# from sklearn.preprocessing import StandardScaler | ||
from numpy import array, empty, reshape, arange | ||
import pandas as pd | ||
import seaborn as sb | ||
from pylab import title, show, xlabel, ylabel, savefig, figure, yticks, xticks | ||
|
||
Epitaxy = pd.read_csv(r'/home/garibasen/Documents/Data/WMU/Dropbox/S-squared/GaN_S2.csv') | ||
|
||
Test_Inputs = pd.read_csv(r'/home/garibasen/Documents/Data/WMU/Dropbox/S-squared/Mapping Data/Mapping_Data_Median.csv') | ||
|
||
Training_Data = pd.DataFrame(Epitaxy, columns=['Substrate Temperature', 'RF Power', 'Ga Temperature', 'N2 Pressure', 'S2']) | ||
|
||
Map_Space = pd.DataFrame(Test_Inputs, columns=['Substrate Temperature', 'RF Power', 'Ga Temperature', 'N2 Pressure']) | ||
|
||
|
||
Training_Inputs = Training_Data.loc[:, ['Substrate Temperature', 'RF Power', 'Ga Temperature', 'N2 Pressure']] | ||
|
||
Training_Outputs = Training_Data.loc[:, 'S2'] | ||
|
||
scaler = MinMaxScaler() | ||
scaler.fit(Training_Inputs) | ||
Training_Inputs = scaler.transform(Training_Inputs) | ||
Map_Space = scaler.transform(Map_Space) | ||
|
||
Predictor = RandomForestRegressor(max_features=5, random_state=42, n_estimators=245) | ||
|
||
Predictor.fit(Training_Inputs, Training_Outputs) | ||
|
||
# Map = empty([550 , 1000]) | ||
|
||
# Parameter_Space = Map_Space.to_numpy() | ||
|
||
Map = Predictor.predict(Map_Space) | ||
|
||
figure(dpi=1200) | ||
sb.heatmap(Map.reshape(550, 1000)) | ||
yticks(arange(-0.01, 550, step=50), ['550', '500', '450', '400', '350', '300', '250', '200', '150', '100', '50', '0']) | ||
xticks(arange(-0.01, 1000, step=100), ['0' , '100', '200', '300', '400', '500', '600', '700', '800', '900', '1000'],rotation=0) | ||
# title("Predicted S^2 in GaN Thin Film Crystal") | ||
xlabel("Substrate Temperature (Celsius)") | ||
ylabel("Plasma Source Power (Watts)") | ||
|
||
show() |