Page History
Table of Contents |
---|
Rough Idea
Idea: take advantage of SAXS/WAXS images all looking the same (mpeg idea) but use a constant image to subtract (perhaps with a scale factor for shot-intensity). Use the raw 16-bit data. How to handle subtraction of gain-switched pixels?
...
could make it better-but-lossy by eliminating low-ADC bits?
Test Data
Looking at det.raw(eat) it appears inter panels for xcs1008621 run 340 are in fixed-gain mode:
The first few events:
Test Script
I believe the Shannon-entropy is the number of bits of information in each 16-bit word, so we only see a 10% improvement in the compressibility of the data.
Code Block | ||
---|---|---|
| ||
from psana import *
import numpy as np
import matplotlib.pyplot as plt
from skimage.measure import shannon_entropy
import gzip
ds = DataSource('exp=xcsl1008621:run=340')
det = Detector('epix10k2M')
ref=None
for nevt,evt in enumerate(ds.events()):
raw = (det.raw(evt).astype(np.int32))&0xbfff # eliminate gain bit
img = det.image(evt)
img_med = np.median(img[612:680,663:726]) # a "normalization area"
if ref is None:
ref = raw
ref_med = img_med
residuals = (raw-(img_med/ref_med)*ref).astype(np.int16)
f = open('junk%d.dat'%nevt,'w')
residuals.tofile(f)
f.close()
#plt.hist(residuals.flatten(),bins=1000)
#plt.show()
print(shannon_entropy(residuals),shannon_entropy(det.raw(evt))
if nevt==4: break |
Output
Code Block |
---|
(ana-4.0.55-py3) python junk.py
0.0 10.892801295795591
8.99940177591452 10.57374113419068
8.881920763769553 10.716387079966387
9.244652303773888 11.009271179948547
8.73624428989834 10.868081019635044
(ana-4.0.55-py3) |
Overview
Content Tools