예제 #1
0
def plot_hist(circuit_id, mode, sing_id, width, width2):
    data = {"w0": [], "q": []}
    
    sns.set_style("whitegrid")
    for i in range(muestras):
        tf = conseguir_tf(
            ra1=disp(RA1[circuit_id], res_tol),
            ra2=disp(RA2[circuit_id], res_tol),
            r41=disp(R41[circuit_id], res_tol),
            r42=disp(R42[circuit_id], res_tol),
            r1=disp(R1[circuit_id], res_tol),
            rb=disp(RB[circuit_id], res_tol),
            c3=disp(C3[circuit_id], cap_tol),
            c21=disp(C21[circuit_id], cap_tol),
            c22=disp(C22[circuit_id], cap_tol)
        )

        if mode == "poles":
            info = tf.poles[sing_id]
        else:
            info = tf.zeros[sing_id]
        w0 = sqrt(info.real**2 + info.imag ** 2)
        data["w0"].append(2*pi*w0)
        data["q"].append(- w0 / (2 * info.real))

    # g = sns.jointplot("w0", "q", data=data, kind="reg",
    #                   color="m", height=7)

    # plt.xlabel("Fo (Hz)")
    #
    # plt.ylabel("Q")
    if str(mode) == "poles":
        textmode = "Polo"
    else:
        textmode = "Cero"
    plt.title(textmode + " " + str(sing_id+1) + ", etapa "+str(circuit_id+1))
    
    make_histogram(variable="Fo",
                   unidad="Hz",
                   data=data["w0"],
                   filename="histograma_w0_"+str(mode)+"_"+str(sing_id) + str(circuit_id) +".png",
                   bar_width=width)

    plt.title(textmode + " " + str(sing_id+1) + ", etapa "+str(circuit_id+1))
    
    make_histogram(variable="Q",
                   unidad="adimensional",
                   data=data["q"],
                   filename="histograma_q_" + str(mode) + "_" + str(sing_id) + str(circuit_id) + ".png",
                   bar_width=width2)
예제 #2
0
def process_files(fnames):
    for fname in fnames:
        snap = Snapshot.read_snapshot(fname)

        count = snap.get_bin_statistic("n")
        percent = snap.get_species_statistic("percentage")
        count[count == 0] = 1.0
        energy_scale = 6.24150974e18 / count

        make_histogram(snap, "temperature")
        make_histogram(snap, "max_temperature")
        make_histogram(snap, "ionization")
        make_histogram(snap, "kinetic_energy", scalar=energy_scale)
        make_histogram(snap,
                       "percentage",
                       scalar=snap.get_bin_statistic("density"))
import sys

from snapshot import Snapshot
from make_histogram import make_histogram

for fname in sys.argv[1:]:
    snap = Snapshot.read_snapshot(fname)
    make_histogram(snap, "temperature", fname)
    make_histogram(snap, "max_temperature", fname)
    make_histogram(snap, "ionization", fname)
    make_histogram(snap, "kinetic_energy", fname, scalar=6.24150974e18)

import sys

from snapshot import Snapshot
from make_histogram import make_histogram

for fname in sys.argv[1:]:
    snap = Snapshot.read_snapshot(fname)
    make_histogram(snap, "temperature")
    make_histogram(snap, "max_temperature")
    make_histogram(snap, "ionization")
    make_histogram(snap, "kinetic_energy", scalar=6.24150974e18)

예제 #5
0
data = read_file_spice("montecarlo.txt")

arr = {"notch_f": [], "min": [], "bw": []}

for i in range(len(data)):
    info = computar_notch(data[i])

    arr["notch_f"].append(info["notch_f"])
    arr["min"].append(info["min"])
    arr["bw"].append(info["f2"]-info["f1"])

#print(arr)

make_histogram(variable="Notch frecuency",
               unidad="Hz",
               data=arr["notch_f"],
               filename="histograma1.png",
               bar_width=50741-50225)

make_histogram(variable="Notch depth",
               unidad="dB",
               data=arr["min"],
               filename="histograma_martu_notch_depth.png",
               bar_width=6)

make_histogram(variable="Notch bandwidth",
               unidad="Hz",
               data=arr["bw"],
               filename="histograma_martu_notch_bw.png",
               bar_width=40169-39783)
예제 #6
0
import seaborn as sns
import matplotlib.pyplot as plt
from make_histogram import make_histogram
from computar_maximos import computar_maximos_bp

data = read_file_spice("montecarlo.txt")

arr = []
for i in range(len(data)):
    act = conseguir_fp(data[i], -3)

    arr.append(act)

make_histogram(variable="Frecuencia de corte",
               unidad="Hz",
               data=arr,
               filename="histograma_marce_ej1_bessel.png",
               bar_width=570.619 - 548.393)

data = read_file_spice(
    "EJ1/Circuito con Legendre/Simulacion/BodeMontecarlo.txt")

arr = []

for i in range(len(data)):
    act = conseguir_fp(data[i], -3)
    arr.append(act)

make_histogram(variable="Frecuencia de corte",
               unidad="Hz",
               data=arr,