From e207734a6b50831c8d6a5ebe4b36c64720871fab Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 18 Mar 2016 15:46:32 +0100 Subject: Add scripts/gaincal-to-saturation-map --- Makefile.am | 3 ++- scripts/gaincal-to-saturation-map | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 scripts/gaincal-to-saturation-map diff --git a/Makefile.am b/Makefile.am index 799fab27..b1a477c4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -180,7 +180,8 @@ script_DATA = scripts/alternate-stream scripts/cell-please \ scripts/find-pairs scripts/plot-cc-and-scale.R \ scripts/ave-resolution scripts/crystal-frame-number \ scripts/plot-radius-resolution \ - scripts/detector-shift scripts/turbo-index + scripts/detector-shift scripts/turbo-index \ + scripts/gaincal-to-saturation-map EXTRA_DIST += $(script_DATA) diff --git a/scripts/gaincal-to-saturation-map b/scripts/gaincal-to-saturation-map new file mode 100644 index 00000000..8a803526 --- /dev/null +++ b/scripts/gaincal-to-saturation-map @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +import numpy as np +import h5py +import sys + +fh = h5py.File(sys.argv[1], 'r') +gains = fh['/data/data'].value +fh.close() + +satns = np.ones_like(gains) * 13000 +satns[gains > 4] = 60000 + +fh = h5py.File('saturation_map.h5', 'w') +fh.create_dataset('/data/data', data=satns) +fh.close() + -- cgit v1.2.3