Browse Source

The first working version

joschka_dev
Jianshun Gao 1 year ago
parent
commit
2026a599ce
  1. 4
      Analyser/ImagingAnalyser.py
  2. 2801
      Example.ipynb
  3. 31
      ToolFunction/ToolFunction.py
  4. 177
      test.ipynb

4
Analyser/ImagingAnalyser.py

@ -101,8 +101,8 @@ class ImageAnalyser():
else:
return imageOD
def get_Ncount(self, imageOD):
return np.sum(imageOD)
def get_Ncount(self, dataSet, dim=['x', 'y'], **kwargs):
return dataSet.sum(dim=['x', 'y'], **kwargs)
def get_absorption_images(self, dataSet, dask='allowed', keep_attrs=True, **kwargs):

2801
Example.ipynb
File diff suppressed because one or more lines are too long
View File

31
ToolFunction/ToolFunction.py

@ -76,4 +76,33 @@ def seperate_uncertainty(data, dask='parallelized', **kwargs):
}
)
return xr.apply_ufunc(_seperate_uncertainty, data, **kwargs)
return xr.apply_ufunc(_seperate_uncertainty, data, **kwargs)
def get_scanAxis(dataSet):
res = dataSet.scanAxis
if len(res) == 0:
res = [None, None]
elif len(res) == 1:
res = [res[0], None]
elif len(res) == 2 and res[0] == 'runs':
res = [res[1], res[0]]
return res
def print_scanAxis(dataSet):
scanAxis = dataSet.scanAxis
scan = {}
for key in scanAxis:
scanValue = np.array(dataSet[key])
scanValue, indices = np.unique(scanValue, return_index=True)
scan.update(
{
key: scanValue[indices]
}
)
print("The detected scaning axes and values are: /n")
print(scan)

177
test.ipynb
File diff suppressed because one or more lines are too long
View File

Loading…
Cancel
Save