From 31d911023e783620588c5ea06e92ea88eae8c59f Mon Sep 17 00:00:00 2001
From: Phoebe Pearce
Date: Fri, 1 Sep 2023 14:28:31 +1000
Subject: [PATCH] fix unit error in LightSource custom spectrum setting
---
solcore/light_source/light_source.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/solcore/light_source/light_source.py b/solcore/light_source/light_source.py
index 6a4278af..40eaeed3 100755
--- a/solcore/light_source/light_source.py
+++ b/solcore/light_source/light_source.py
@@ -405,10 +405,10 @@ def _get_custom_spectrum(self, options):
wl = x_data
spectrum = y_data * (c * h * 1e9 / wl)
elif units == "power_density_per_m":
- wl = x_data * 1e-9
+ wl = x_data * 1e9
spectrum = y_data * 1e-9
elif units == "photon_flux_per_m":
- wl = x_data * 1e-9
+ wl = x_data * 1e9
spectrum = y_data * (c * h / wl)
elif units == "power_density_per_eV":
wl, spectrum = spectral_conversion_nm_ev(x_data, y_data)