From 0d41f4dac20cc75881a69fcbc21b00af290213bf Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Mon, 15 Jun 2020 23:08:48 +0200 Subject: Adapt Jakob and Hanika's interpolation code --- jakob_hanika.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'jakob_hanika.py') diff --git a/jakob_hanika.py b/jakob_hanika.py index af55c94..22b87fc 100644 --- a/jakob_hanika.py +++ b/jakob_hanika.py @@ -15,10 +15,11 @@ def model(wvlp, ccp): return 1 / 2 + yy / (2 * np.sqrt(1 + yy ** 2)) # Create a SpectralDistribution using given coefficients -def model_sd(ccp): +def model_sd(ccp, primed=True): # FIXME: don't hardcode the wavelength grid; there should be a way # of creating a SpectralDistribution from the function alone - return SpectralDistribution(model(wvlp, ccp), wvl, name="Model") + grid = wvlp if primed else wvl + return SpectralDistribution(model(grid, ccp), wvl, name="Model") # The goal is to minimize the color difference between a given distrbution # and the one computed from the model above. -- cgit