diff --git a/harnessed_jobs/absolute_height_offline/v0/validator_absolute_height_offline.py b/harnessed_jobs/absolute_height_offline/v0/validator_absolute_height_offline.py index 3aa6908..6bc9132 100755 --- a/harnessed_jobs/absolute_height_offline/v0/validator_absolute_height_offline.py +++ b/harnessed_jobs/absolute_height_offline/v0/validator_absolute_height_offline.py @@ -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()) diff --git a/harnessed_jobs/flatness_offline/v0/validator_flatness_offline.py b/harnessed_jobs/flatness_offline/v0/validator_flatness_offline.py index 3a4e7c9..136f6b2 100755 --- a/harnessed_jobs/flatness_offline/v0/validator_flatness_offline.py +++ b/harnessed_jobs/flatness_offline/v0/validator_flatness_offline.py @@ -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()) diff --git a/schemas/abs_height_sensor.schema b/schemas/abs_height_sensor.schema new file mode 100644 index 0000000..4ec5b4a --- /dev/null +++ b/schemas/abs_height_sensor.schema @@ -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 +} diff --git a/schemas/flatness_sensor.schema b/schemas/flatness_sensor.schema new file mode 100644 index 0000000..912641f --- /dev/null +++ b/schemas/flatness_sensor.schema @@ -0,0 +1,7 @@ +# -*- python -*- +{ + 'schema_name' : 'flatness_sensor', + 'schema_version' : 0, + 'peak_valley_95' : float, + 'flatnesshalfband_95' : float +}