The first working version

This commit is contained in:
Jianshun Gao 2023-05-07 23:41:31 +02:00
parent 2b2606afc4
commit 2026a599ce
4 changed files with 2893 additions and 120 deletions

View File

@ -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 Normal file

File diff suppressed because one or more lines are too long

View File

@ -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)

File diff suppressed because one or more lines are too long