landau.c = landau.c_calc(freqData, plot=1) compensatedData, landau.pr = landau.c_compensation(cCompData) hd.hyst_plot([cCompData, compensatedData], ['Before', 'After'], plot_e=False) freqCompData = list(map(lambda x: landau.c_compensation(x)[0], freqData)) landau.rho_calc(freqData) freqDataLkgComp = hd.list_read(freqfiles, templkgfiles, thickness=t, area=a) cCompDataLkgComp = freqDataLkgComp[1] hd.hyst_plot([cCompData, cCompDataLkgComp], ["With Leakage", "Without Leakage"], plot_e=False) ### FORC Calculation landau_forc = hd.HysteresisData(thickness=t, area=a) landau_forc.tsv_read(forcFile) landau_forc.hyst_plot(plot_e=1) e, er, probs = landau_forc.forc_calc(plot=True) domains = landau.domain_gen(e, er, probs, n=100, plot=False) elimit = 1.1 * max(cCompData.voltage) / t esweep = np.linspace(-elimit, elimit, num=1000) esweep = np.append(esweep, esweep[::-1]) res = landau.calc_efe_preisach(esweep, domains, c_add=True, plot=0) # Plots FORC results vs actual hysteresis measurement ## fig = plt.figure() fig.clf()
hfo2.rho_calc(freqdata) tempdir = join(sampledir, 'H9_x9y4_1e4_S3_temps') tempfiles = hd.dir_read(tempdir) tempdata = hd.list_read(tempfiles) templkgdir = join(sampledir, 'H9_x9y4_1e4_S3_tempslkg') templkgfiles = hd.dir_read(templkgdir) hfo2.a0 = hfo2.a0_calc(tempdata) # Following code plots a series of diff freq hystdata files on same plot hyst_data = [] legend = [] for f in freqfiles: data = hd.HysteresisData() data.tsv_read(f) # data.dvdt_plot() # plots dvdt for analysis - unrelated to freq hyst_plot hyst_data.append(data) legend.append(int(data.freq)) legend = sorted(legend) hyst_data = sorted(hyst_data, key=lambda data: int(data.freq)) legend = [str(x) + ' Hz' for x in legend] hd.hyst_plot(hyst_data, legend) # Following code plots a series of diff temp hystdata files on same plot hyst_data = [] legend = []
#!/usr/bin/env python3 """ Created on Mon Jun 26 17:47:18 2017 @author: Jackson """ import matplotlib.pyplot as plt from os.path import join, dirname, realpath from context import models as lf from context import data as hd plt.close('all') testdatadir = join(dirname(dirname(realpath(__file__))), "tests", "testData") forcFile1 = join(testdatadir, 'RTWhiteB', 'RTWhiteB_FORC', 'RTWhiteB 0Hz 5V 1Average Table1.tsv') forcFile2 = join(testdatadir, 'RTWhiteB', 'RTWhiteB_FORC', 'RTWhiteB 0Hz 5V 1Average Table3.tsv') t = 255E-7 a = 1E-4 # mask defined area that was used in measurement forc1 = hd.HysteresisData(thickness=t, area=a) forc1.tsv_read(forcFile1) forc1.hyst_plot(plot_e=1) forc1.forc_calc(plot=True) forc2 = hd.HysteresisData(thickness=t, area=a) forc2.tsv_read(forcFile2) forc2.hyst_plot(plot_e=1) forc2.forc_calc(plot=True)
hfo2.c = hfo2.c_calc(freqData, plot=1) compensatedData, hfo2.pr = hfo2.c_compensation(cCompData) compensatedData.hyst_plot(plot_e=True) hfo2.rho_calc(freqData) hfo2.a0 = hfo2.a0_calc(tempData) freqDataLkgComp = hd.list_read(freqfiles, templkgfiles) cCompDataLkgComp = freqDataLkgComp[0] hd.hyst_plot([cCompData, cCompDataLkgComp], ["With Leakage", "Without Leakage"], plot_e=1) ### FORC Calculation hfo2_forc = hd.HysteresisData(area=6579E-8, thickness=13E-7) hfo2_forc.tsv_read(forcFile) hfo2_forc.hyst_plot(plot_e=1) e, er, probs = hfo2_forc.forc_calc(plot=False) domains = hfo2.domain_gen(e, er, probs, n=100, plot=False) esweep = np.linspace(-4.5E6, 4.5E6, num=1000) esweep = np.append(esweep, esweep[::-1]) hfo2.calc_efe_preisach(esweep, domains, plot=1) # Following code plots a series of diff freq hystdata files on same plot hystData = [] legend = [] for f in freqfiles:
import matplotlib.pyplot as plt import numpy as np from os.path import join, dirname, realpath from context import models as lf from context import data as hd plt.close('all') sampledir = join(dirname(realpath(__file__)), 'testData', 'RT WhiteA') RTfreqDir = join(sampledir, 'RTWhiteAFreq') RTfreqFiles = hd.dir_read(RTfreqDir) RTfreqData = hd.list_read(RTfreqFiles) RTfreq100hz = join(RTfreqDir, 'RT WhiteA 100Hz 8V 1Average Table1.tsv') RT100data = hd.HysteresisData() RT100data.tsv_read(RTfreq100hz) RT100data.hyst_plot() RTWhiteFilm = lf.LandauSimple(thickness=255E-7, area=1E-4) RTWhiteFilm.c = RTWhiteFilm.c_calc(RTfreqData) RT100compensated, RTWhiteFilm.pr = RTWhiteFilm.c_compensation(RT100data) RT100compensated.hyst_plot() forc_file = join(sampledir, 'RTWhiteAFORC', 'RT WhiteA 0Hz 7V 1Average Table7.tsv') RTWhiteAFORC = hd.HysteresisData(area=1E-4, thickness=255E-7) RTWhiteAFORC.tsv_read(forc_file) RTWhiteAFORC.hyst_plot(plot_e=1) RTWhiteAFORC.time_plot()