fix bug
This commit is contained in:
parent
0fe7c35ef2
commit
7dfbe2222f
@ -105,7 +105,7 @@ def water_refraction_index(t, wavelength):
|
||||
def sun_spectral(wavelength):
|
||||
return 1e16/(np.power(wavelength,5)*(np.exp(6.62607015e6*2.99792458/(wavelength*1.380649*(5250+273.15)))-1))
|
||||
|
||||
def modified_trace(wavelength, temp, center, r, dx, N, n_theta, d_theta, min_intensity, max_ray, max_angle):
|
||||
def modified_trace(wavelength, temp, center, r, N, n_theta, d_theta, min_intensity, max_ray, max_angle):
|
||||
n = water_refraction_index(temp, wavelength)
|
||||
disk = Disk(center, r, n)
|
||||
stack = []
|
||||
@ -150,7 +150,7 @@ def rainbow(n_theta, max_theta, temp):
|
||||
|
||||
# 使用 ThreadPoolExecutor 并行执行
|
||||
with ProcessPoolExecutor() as executor:
|
||||
futures = [executor.submit(modified_trace, wavelength, temp, center, r, dx, N, n_theta, d_theta, min_intensity, max_ray, max_theta) for wavelength in colorspace.data_wavelength]
|
||||
futures = [executor.submit(modified_trace, wavelength, temp, center, r, N, n_theta, d_theta, min_intensity, max_ray, max_theta) for wavelength in colorspace.data_wavelength]
|
||||
|
||||
for future in as_completed(futures):
|
||||
result = future.result()
|
||||
|
Loading…
Reference in New Issue
Block a user