Skip to content

Commit

Permalink
Merge pull request #15 from lsst-camera-dh/LSSTTD-1038
Browse files Browse the repository at this point in the history
LSSTTD-1038
  • Loading branch information
jchiang87 authored Sep 16, 2017
2 parents bc6b094 + c186cae commit a3b8ed7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,26 @@
z_median_m_13 = np.median(sensorData.sensor.z) - 13000.
z_quantile_0025 = sensorData.quantiles['0.025']
z_quantile_0975 = sensorData.quantiles['0.975']
results.append(lcatr.schema.valid(lcatr.schema.get('sensor_abs_height'),

zvalues, quantiles = [], []
for key in sensorData.quantiles:
quantiles.append(float(key))
zvalues.append(sensorData.quantiles[key])

zvalues.sort()
quantiles.sort()

znom = 12.992 # for ITL
zbounds = (-0.009, 0.009) # from CCD-030
quant_low = np.interp(znom - zbounds[0], zvalues, quantiles)
quant_high = np.interp(znom - zbounds[1], zvalues, quantiles)
frac_outside = 1. - (quant_high - quant_low)

results.append(lcatr.schema.valid(lcatr.schema.get('abs_height_sensor'),
z_median_m_13=z_median_m_13,
z_quantile_0025=z_quantile_0025,
z_quantile_0975=z_quantile_0975))
z_quantile_0975=z_quantile_0975,
frac_outside=frac_outside))

results.extend(siteUtils.packageVersions())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@

sensorData = md_factory.load('flatness.pickle')
peak_valley_95 = sensorData.quantiles['0.975'] - sensorData.quantiles['0.025']
results.append(lcatr.schema.valid(lcatr.schema.get('sensor_flatness'),
peak_valley_95=peak_valley_95))
flatnesshalfband_95 = peak_valley_95/2.

results.append(lcatr.schema.valid(lcatr.schema.get('flatness_sensor'),
peak_valley_95=peak_valley_95,
flatnesshalfband_95=flatnesshalfband_95))

results.extend(siteUtils.packageVersions())

Expand Down
9 changes: 9 additions & 0 deletions schemas/abs_height_sensor.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- python -*-
{
'schema_name' : 'abs_height_sensor',
'schema_version' : 0,
'z_median_m_13' : float,
'z_quantile_0975' : float,
'z_quantile_0025' : float,
'frac_outside' : float
}
7 changes: 7 additions & 0 deletions schemas/flatness_sensor.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- python -*-
{
'schema_name' : 'flatness_sensor',
'schema_version' : 0,
'peak_valley_95' : float,
'flatnesshalfband_95' : float
}

0 comments on commit a3b8ed7

Please sign in to comment.