diff --git a/README.md b/README.md index 62e616d..5524e48 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ EdgeML for Fusion Energy Science project This work was supported by the Department of Energy, Office of Fusion Energy Science under Field Work Proposal 100636 "Machine Learning for Real-time Fusion Plasma Behavior Prediction and Manipulation." This material is based upon work supported by the U.S. Department of Energy, Office of Science, Office of Fusion Energy Sciences, using the DIII-D National Fusion Facility, a DOE Office of Science user facility, under Award DE-FC02-04ER54698. +# Super-resolution +Connect with Raffi Nazikian with the Thomas Feurer paper on time-domain ptychography. +Also run a test of using random incommensurate sampling in time to recover higher frequency information from across channels of diagnostics. How low of sampling can we do if we do stochastic distribution of sample times? + # Example filenames in sdf filesystem accessed via s3df Each file is aobut 80% of a GB. Counting 158-187k of them at 1GB each would gives a max of 29 thousand of 1GB files would be 29 TB. I believe there is heavy duplication in the "time" variable that I will check for future reference. diff --git a/src/ParaClass.py b/src/ParaClass.py index df7ed24..c6a49ba 100644 --- a/src/ParaClass.py +++ b/src/ParaClass.py @@ -83,7 +83,7 @@ def initTimesChans(self,f): # updated for Finn ecebes_######.h5 input files. def fillData(self,f): # updated for Finn ecebes_######.h5 input files. for dk,d in self.dets.items(): - self.data[dk] = [(f[d][c][()]*(1<<10)).astype(np.int16) for c in self.chans[dk]] + self.data[dk] = [(f[d][c][()]).astype(np.float16) for c in self.chans[dk]] return self def setMethod(self,x='fft'): @@ -180,11 +180,11 @@ def processFFT(self,h5out): ELMX = X*self.elm_filt[detkey] elm_back = irfft(ELMX,norm='forward') Params.setElm(h5out,detkey,chan,data=elm_back[:self.nsamples[detkey],:]) - S = utils.saturate_uint(np.abs(X).real,self.satbits).astype(np.uint16) + S = utils.saturate_float(np.abs(X).real,np.float16(self.nsamples[detkey]<<3)).astype(np.float16) Params.setSpect(h5out,detkey,chan,data=S) Q = rfft(np.concatenate((S.astype(float),np.flip(S.astype(float),axis=0)),axis=0),axis=0) - Sback = utils.saturate_uint(irfft(Q*self.q_filt[detkey],axis=0).real,self.satbits).astype(np.uint16) - dSback = utils.saturate_int(irfft(Q*1j*self.dq_filt[detkey],axis=0).real.astype(int)>>6,self.satbits).astype(np.int16) + Sback = utils.saturate_float(irfft(Q*self.q_filt[detkey],axis=0).real,np.float16(self.nsamples[detkey])).astype(np.float16) + dSback = utils.saturate_float(irfft(Q*1j*self.dq_filt[detkey],axis=0).real.astype(np.float16),np.float16(self.nsamples[detkey])**2).astype(np.float16) logic = dSback[offset:self.nsamples[detkey],:] print(np.max(logic),np.min(logic)) Params.setLogic(h5out,detkey,chan,data=logic) diff --git a/src/__pycache__/ParaClass.cpython-39.pyc b/src/__pycache__/ParaClass.cpython-39.pyc index eb556aa..8260e07 100644 Binary files a/src/__pycache__/ParaClass.cpython-39.pyc and b/src/__pycache__/ParaClass.cpython-39.pyc differ diff --git a/src/__pycache__/analysis.cpython-39.pyc b/src/__pycache__/analysis.cpython-39.pyc index 003698c..8c6d71d 100644 Binary files a/src/__pycache__/analysis.cpython-39.pyc and b/src/__pycache__/analysis.cpython-39.pyc differ diff --git a/src/__pycache__/utils.cpython-39.pyc b/src/__pycache__/utils.cpython-39.pyc index 5754008..1fb4400 100644 Binary files a/src/__pycache__/utils.cpython-39.pyc and b/src/__pycache__/utils.cpython-39.pyc differ diff --git a/src/utils.py b/src/utils.py index b60b781..1289297 100644 --- a/src/utils.py +++ b/src/utils.py @@ -27,6 +27,9 @@ def selectchanwin(d,c1,c2): def soft_saturate(x,limit=10): return limit*np.tanh(x/limit) +def saturate_float(x,limit=10): + return limit*np.tanh(x/limit) + def saturate_uint(x,bits): inds = np.where(x>((1<