# -*- coding: utf-8 -*- """ Created on Wed Jul 24 11:17:18 2019 @author: rgarcia1 """ import deepdish as dd import numpy as np import matplotlib.pyplot as plt import math def set_box_color(bp, color): plt.setp(bp['boxes'], color=color) plt.setp(bp['whiskers'], color=color) plt.setp(bp['caps'], color=color) #%% Load Data from 10 probes, one of them is discarded because of conection problems during characterization plt.close('all') GmAll, IrmsAll, UrmsAll, Ids = dd.io.load('GmIrmsUrmsIds10Probe_2.h5') #%% #plot histogram Gm = np.array([]) BestProbes = ['B12784O18-T3',] #select 3 best probes for specific analysis for keyProbe in GmAll.keys(): if keyProbe in BestProbes: for keyTrt in GmAll[keyProbe].keys(): Gm = np.append(Gm,np.max(GmAll[keyProbe][keyTrt][:-1])) hist, vect = np.histogram(Gm*1000/0.1, bins=22 , range = (1.3,3.3)) plt.figure(1) plt.hist(Gm*1000/0.1, bins =22, range = (1.3,3.3), color = 'firebrick', label = '192 g-SGFETs from 3 probes') xbin = np.linspace(1.2,3.5,100) Gm = np.sort(Gm)[1:] plt.plot(xbin, 14*np.exp(-(xbin-np.mean(Gm)*10000)**2/(2*(np.std(Gm)*10000)**2)),'k',label = 'Gaussian, $\mu$ = '+'{} - '.format(round(np.mean(Gm)*10000),1)+'$\sigma$ = '+'{}'.format(round(np.std(Gm)*10000),1) + '[mS/V]') plt.xlabel('G$_m$ (mS/V)') plt.ylabel('# counts') plt.legend() Urms = np.array([]) for keyProbe in UrmsAll.keys(): for keyTrt in UrmsAll[keyProbe].keys(): if keyProbe in BestProbes: Urms = np.append(Urms,np.min(UrmsAll[keyProbe][keyTrt][:-1])) hist, vect = np.histogram(np.log10(Urms*1e6), bins=50 , range = (0,2)) xbin = np.linspace(0,3.5,1000) plt.figure(2) plt.hist(np.log10(Urms*1e6), bins =50, range = (0,2),color= 'blue',label = '192 g-SGFETs from 3 probes') Urms = np.sort(Urms)[:-8] plt.plot(xbin, 15*np.exp(-(xbin-np.mean(np.log10(Urms*1e6)))**2/(2*(np.std(np.log10(Urms*1e6)))**2)),'k',label = 'Gaussian, $\mu$ = '+'{} - '.format(round(np.mean(Gm)*10000),1)+'$\sigma$ = '+'{}'.format(round(np.std(Gm)*10000),1) + '[mS/V]') plt.xlabel('log(U$_{gs-rms}$)') plt.ylabel('# counts') plt.legend() #%% plot boxplots GM = [] for keyProbe in GmAll.keys(): if keyProbe == 'B12142O37-T4': #probe discarded due to wrong characterization continue Gm = np.array([]) for keyTrt in GmAll[keyProbe].keys(): Gm = np.append(Gm,np.max(GmAll[keyProbe][keyTrt][:-1])) Gm = Gm*10000 Gm = np.ndarray.tolist(Gm) GM.append(Gm) URMS = [] for keyProbe in UrmsAll.keys(): if keyProbe == 'B12142O37-T4': continue Urms = np.array([]) for keyTrt in UrmsAll[keyProbe].keys(): va = np.min(UrmsAll[keyProbe][keyTrt][:-1]) if math.isnan(va): Urms = 1e-3 #sets Nan to an extremely bad sensitivity else: Urms = np.append(Urms,va) Urms = Urms*1e6 Urms = np.ndarray.tolist(Urms) URMS.append(Urms) Fig, ax = plt.subplots() bpr = ax.boxplot(GM,flierprops={'markeredgecolor': 'firebrick'}) ax.set_ylabel('G$_m$ (mS/V)') set_box_color(bpr, 'firebrick') plt.xlabel('Device number') Fig, ax2 = plt.subplots() bpr2 = ax2.boxplot(URMS,positions=[2,6,3,5,1,4,7,8,9],flierprops={'markeredgecolor': 'blue'}) set_box_color(bpr2, 'blue') ax2.set_ylabel('U$_{gs-rms}$ ($\mu$V)') ax2.set_yscale('log') plt.xlabel('Device number')