NameError: name 'thetas' is not defined
< /code>
In Zeile 12 des folgenden Programms < /p>
import matplotlib.pyplot as plt
import numpy as np
import numpy.matlib
import math
lmin = 2.0 # source min wavelength
lmax = 5.0 # source max wavelength
fmin = 1/lmax # source min frequency
fmax = 1/lmin # source max frequency
fcen = 0.5*(fmin+fmax)
thetas = np.append(thetas, range(0,35,5))
kx = [fcen*math.sin(t) for t in [math.radians(float(t)) for t in thetas]]
Refl = np.empty((50,thetas.size))
Abs = np.empty((50,thetas.size))
theta_out = np.empty((50,thetas.size))
for k in range(thetas.size):
f0 = np.genfromtxt("flux0_a4.3_theta{}.dat".format(thetas[k]), delimiter=",")
f = np.genfromtxt("flux_a4.3_r1.72_theta{}.dat".format(thetas[k]), delimiter=",")
Refl[:,k] = -f[:,1]/f0[:,1]
theta_out[:,k] = np.asarray([math.degrees(math.asin(kx[k]/f0[j,0])) for j in range(50)])
Abs[:,k] = np.asarray([(1-Refl[j,k])*math.cos(math.radians(theta_out[j,k])) for j in range(50)])
Abs[Abs
Ich versuche, das Ergebnis von Projekt 5 in http://www.simpetus.com/projects.html#meep_thermal_radiation zu zeichnen, aber erhalten Sie eine EN -Fehlermeldung [code]NameError: name 'thetas' is not defined < /code> In Zeile 12 des folgenden Programms < /p> import matplotlib.pyplot as plt import numpy as np import numpy.matlib import math
lmin = 2.0 # source min wavelength lmax = 5.0 # source max wavelength fmin = 1/lmax # source min frequency fmax = 1/lmin # source max frequency fcen = 0.5*(fmin+fmax)
thetas = np.append(thetas, range(0,35,5)) kx = [fcen*math.sin(t) for t in [math.radians(float(t)) for t in thetas]] Refl = np.empty((50,thetas.size)) Abs = np.empty((50,thetas.size)) theta_out = np.empty((50,thetas.size))
for k in range(thetas.size): f0 = np.genfromtxt("flux0_a4.3_theta{}.dat".format(thetas[k]), delimiter=",") f = np.genfromtxt("flux_a4.3_r1.72_theta{}.dat".format(thetas[k]), delimiter=",") Refl[:,k] = -f[:,1]/f0[:,1] theta_out[:,k] = np.asarray([math.degrees(math.asin(kx[k]/f0[j,0])) for j in range(50)]) Abs[:,k] = np.asarray([(1-Refl[j,k])*math.cos(math.radians(theta_out[j,k])) for j in range(50)])
Ich versuche die Bytebuddy -Bibliothek zu erkunden und zu verstehen, um Ratschläge für eine der Methoden zu erstellen. Aber ich begegne eine Ausnahme im Voraus, wie sie unten etwas seltsam erscheint,...
Mein System wurde neu gestartet, während ich ein Projekt geöffnet hatte, und jetzt erhalte ich diese Fehlermeldung. Alles, was ich dazu finde, befasst sich mit XAML, das ist kein XAML. Ich habe ein...
Ich verfolge einige Tutorials und habe den folgenden Code in Google Colab:
!pip install matplotlib==3.7.3
!git clone
!pip -q install -r FastSAM/requirements.txt