aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-03-18 15:46:32 +0100
committerThomas White <taw@physics.org>2016-03-18 15:46:32 +0100
commite207734a6b50831c8d6a5ebe4b36c64720871fab (patch)
treea40b662a863c9b5bcac8f2d6b65d0e142cbf0055 /scripts
parent3f523fdbaa6e8f77d30dee3d893de661ce856337 (diff)
Add scripts/gaincal-to-saturation-map
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gaincal-to-saturation-map17
1 files changed, 17 insertions, 0 deletions
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()
+