热度 1
2023-10-23 10:26
90 次阅读|
0 个评论
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt #plot module def Ecdfplot (CP_para_to_plot , x_num , y_num , CP_Para_colName , hue , raw_data , X_para , hue_number): ecf_color = 'brg' f = plt.figure() i= 1 for para_name in CP_para_to_plot: ax = f.add_subplot(x_num , y_num , i) ax.set_title(para_name) raw_ecdf = raw_data == para_name] sns.ecdfplot( x =X_para , data =raw_ecdf , hue =hue , palette =sns.color_palette(ecf_color , hue_number , as_cmap = True )) i = i+ 1 return None def Mapplot (CP_Para , wnl , raw_data , CP_Para_colName , x_num , y_num , Wafer_colName , die_x , die_y , values): for cp_para in CP_Para: f =plt.figure(cp_para) f.suptitle(cp_para) raw_map = raw_data ==cp_para] n = 1 for i in wnl: ax = f.add_subplot(x_num , y_num , n) ax.set_title(i) raw_map2=raw_map ==i] Map_tables = raw_map2.pivot_table( index =die_y , columns =die_x , values =values) sns.heatmap(Map_tables) ax.xaxis.label.set_visible( False ) ax.yaxis.label.set_visible( False ) ax.axes.yaxis.set_ticks( ) n= n+ 1 return None def Boxplot (CP_para_to_plot , x_num , y_num , Wafer_colName , CP_Para_colName , raw_data , values): f = plt.figure() i= 1 for para_name in CP_para_to_plot: ax = f.add_subplot(x_num , y_num , i) ax.set_title(para_name) raw_BOX = raw_data == para_name] sns.boxplot( x =raw_BOX , y =raw_BOX ) i = i+ 1 return None #yield module def caculate_CP_bin (rawdata , split , key , bin): if rawdata == key) & (rawdata == bin)] is not None : bin_rate = rawdata == key) & (rawdata == bin)] .size/rawdata == key] .size else : bin_rate = 0 return bin_rate #data column name definition file_path = r"D:\200W DATA.csv" CP_Para_colName = 'PARAMETER' Wafer_colName = 'WAFER_NO' #ecdfplot para definition Value_para_ColName = 'VALUE' X_para = 'VALUE' map_x = "DIE_X" map_y = 'DIE_Y' #Read raw data raw = pd.read_csv(file_path , encoding = 'utf-8' ) #Raw data treatment Module CP_Para_List = raw .unique() #plot draw para definition wafer_num = raw .unique() number_of_wafer = len (wafer_num) #Boxplot(CP_para_to_plot= ,x_num=2,y_num=2,Wafer_colName=Wafer_colName,CP_Para_colName=CP_Para_colName,raw_data=raw,values=Value_para_ColName) #Ecdfplot(CP_para_to_plot= ,x_num=2,y_num=2,hue = Wafer_colName,CP_Para_colName=CP_Para_colName, raw_data=raw,X_para= X_para,hue_number = number_of_wafer) Mapplot( CP_Para = , wnl =wafer_num , raw_data =raw , CP_Para_colName =CP_Para_colName , x_num = 1 , y_num = 2 , Wafer_colName =Wafer_colName , die_x =map_x , die_y =map_y , values =Value_para_ColName) plt.show()