Skip to content

Commit

Permalink
add new GMOS-N QE splines
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-simpson committed Sep 23, 2020
1 parent 031bea6 commit 1e9e9b1
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions geminidr/gmos/primitives_gmos_spect.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,25 @@ def qeModel(ext):
"EEV_9273-16-03": [9.883090E-1, -1.390254E-5, 5.282149E-7, -6.847360E-10],
"EEV_9273-20-03": [9.699E-1, 1.330E-4, -2.082E-7, 1.206E-10],
# GMOS-N Hamamatsu CCD1 and 3
#"BI13-20-4k-1": {"order": 3,
# "knots": [358.0, 380.0, 428.0, 468.0, 576.0, 648.0, 798.0, 932.0, 966.0, 994.0, 1010.0, 1028.0, 1044.0, 1076.0],
# "coeffs": [0.014629039930259876, 0.10133317072093591, 0.2384728514854233, 0.0778544705196136,
# -0.06232251896695778, -0.0671226704286497, 0.0017962888751030116, 0.02399802448657926,
# 0.06062000896013293, 0.04661836594286457, 0.05694058456700794, 0.020108979328507717,
# 0.00719658389760285, 0.029938578274652766, 0.05265151968369216, 0.04654560999567498]},
#"BI13-18-4k-2": {"order": 3,
# "knots": [358.0, 432.0, 476.0, 520.0, 602.0, 640.0, 678.0, 752.0, 914.0, 1002.0, 1040.0, 1076.0],
# "coeffs": [0.02206208508099143, 0.2834094598715138, 0.07132646057310524, -0.01980030661665999,
# -0.05201598712929662, -0.06777120754328926, -0.012413172958416104, -0.015591358664326838,
# 0.03433933272643748, 0.04127142803163095, 0.06235368833554948, -0.008691968589858072,
# 0.06049075935311075, 0.0484080146014316]},
"BI13-20-4k-1": {"order": 3,
"knots": [366.5, 413.500044, 435.500048, 465.000052, 478.500054,
507.500058, 693.000014, 1062.000039],
"coeffs": [1.20848283, 1.59132929, 1.58317142, 1.25123198, 1.14410563,
0.98095206, 0.83416436, 1.03247587, 1.15355675, 1.10176507]},
"BI13-18-4k-2": {"order": 3,
"knots": [341.750054, 389.500062, 414.000067, 447.500006, 493.000079,
592.000013, 694.500021, 1057.000048],
"coeffs": [0.90570141, 0.99834392, 1.6311227 , 1.47271364, 1.13843214,
0.91170917, 0.88454097, 1.06456595, 1.16684561, 1.10476059]},
# IRAF coefficients
"BI13-20-4k-1": [-2.45481760e+03, 3.24130657e+01, -1.87380500e-01,
6.23494400e-04, -1.31713482e-06, 1.83308885e-09,
-1.68145852e-12, 9.80603592e-16, -3.30016761e-19,
4.88466076e-23],
"BI13-18-4k-2": [3.48333720e+03, -5.27904605e+01, 3.48210500e-01,
-1.31286828e-03, 3.12154994e-06, -4.85949692e-09,
4.95886638e-12, -3.20198283e-15, 1.18833302e-18,
-1.93303639e-22],
#"BI13-20-4k-1": [-2.45481760e+03, 3.24130657e+01, -1.87380500e-01,
# 6.23494400e-04, -1.31713482e-06, 1.83308885e-09,
# -1.68145852e-12, 9.80603592e-16, -3.30016761e-19,
# 4.88466076e-23],
#"BI13-18-4k-2": [3.48333720e+03, -5.27904605e+01, 3.48210500e-01,
# -1.31286828e-03, 3.12154994e-06, -4.85949692e-09,
# 4.95886638e-12, -3.20198283e-15, 1.18833302e-18,
# -1.93303639e-22],
# GMOS-S EEV CCD1 and 3
"EEV_2037-06-03": {"1900-01-01": [2.8197, -8.101e-3, 1.147e-5, -5.270e-9],
"2006-08-31": [2.225037, -4.441856E-3, 5.216792E-6, -1.977506E-9]},
Expand Down Expand Up @@ -107,7 +105,7 @@ def qeModel(ext):
use_data = data[k]
data = use_data

# data is either a dict defining a spline that defines log10(QE)
# data is either a dict defining a spline that defines QE
# or a list of polynomial coefficients that define QE
if 'knots' in data:
# Duplicate the knots at either end for the correct format
Expand All @@ -117,7 +115,7 @@ def qeModel(ext):
knots.extend(knots[-1:] * order)
coeffs = data["coeffs"] + [0] * (order+1)
spline = UnivariateSpline._from_tck((knots, coeffs, order))
return lambda x: 10 ** spline(x)
return spline
else:
model_params = {'c{}'.format(i): c for i, c in enumerate(data)}
model = models.Polynomial1D(degree=len(data)-1, **model_params)
Expand Down

0 comments on commit 1e9e9b1

Please sign in to comment.