Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cms giwaxs support version 1 #100

Merged
merged 127 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
e50136b
create initial CMS files
andrewjlevin Jul 5, 2023
ab094c2
add CMSGIWAXSLoader to loader.py
andrewjlevin Jul 5, 2023
2260022
first attempt at loadSingleImage
andrewjlevin Jul 5, 2023
8d7847e
add loadMd method
andrewjlevin Jul 6, 2023
c3b78db
parameter fix
andrewjlevin Jul 6, 2023
d31f1af
wrote loadSeries method
andrewjlevin Jul 6, 2023
02cca42
syntax fix
andrewjlevin Jul 6, 2023
bb2c510
add coordinates & minor tweaks
andrewjlevin Jul 6, 2023
60874b9
syntax
andrewjlevin Jul 6, 2023
a4071cc
syntax
andrewjlevin Jul 6, 2023
9af942e
round exposure time to 1 decimal
andrewjlevin Jul 6, 2023
a2ca96d
change default naming scheme from None to []
andrewjlevin Jul 7, 2023
cf6c619
silence draw.load print statements
andrewjlevin Jul 7, 2023
7bbba85
remove np.flipud and create pg_convert function in GIWAXS.py
andrewjlevin Jul 8, 2023
c60d4d1
add GIWAXS.py to util.py
andrewjlevin Jul 8, 2023
6d944ef
time coordinate shows ending time, included in pg_convert output
andrewjlevin Jul 8, 2023
c968f11
syntax fix
andrewjlevin Jul 8, 2023
d1de032
array shaping fix
andrewjlevin Jul 8, 2023
db57990
array shaping fix
andrewjlevin Jul 8, 2023
84d19b8
added pg_convert_series fxn
andrewjlevin Jul 8, 2023
fd83f08
changed how time dim is handled & added coordinate units
andrewjlevin Jul 8, 2023
4dbd307
fix typo & sortby time
andrewjlevin Jul 8, 2023
2a74072
sortby series number too
andrewjlevin Jul 8, 2023
2e2c81b
syntax
andrewjlevin Jul 8, 2023
2059af8
series loader fix
andrewjlevin Jul 8, 2023
5ce76ed
add time units
andrewjlevin Jul 8, 2023
05951d0
undo time unit
andrewjlevin Jul 8, 2023
a38231e
updated util GIWAXS import sytnax
andrewjlevin Jul 13, 2023
54c4324
undoing previous commit
andrewjlevin Jul 13, 2023
1babde7
minor QoL drawmask tweaks
andrewjlevin Jul 13, 2023
8339e37
fixes on previous commit
andrewjlevin Jul 13, 2023
aba83f7
more adjustments to drawmask
andrewjlevin Jul 13, 2023
ba87343
more drawmask
andrewjlevin Jul 13, 2023
80617e6
fix ui to not swap axes, messes up mask arr
andrewjlevin Jul 13, 2023
52e20be
added option to load iterables into loadSeries
andrewjlevin Jul 14, 2023
62cbee0
syntax fix
andrewjlevin Jul 14, 2023
551d13c
another fix, make for iterables
andrewjlevin Jul 14, 2023
2dc065e
added tqdm progress bar
andrewjlevin Jul 14, 2023
4d90c6f
do not flip masks in pg_convert
andrewjlevin Jul 14, 2023
95e4454
make Transform class for pg functions
andrewjlevin Jul 15, 2023
867836f
add Transform to util
andrewjlevin Jul 15, 2023
de931e3
updated the Transform class method to accept both .edf and .json files
Jul 17, 2023
1de6171
cms-giwaxs-in_situ_processing notebooks
Jul 18, 2023
41b7631
cms-giwaxs-in_situ_processing notebooks take2
Jul 18, 2023
546ce65
adding comments, error handling and delim method variable to loadMd()
kewh5868 Jul 18, 2023
a8f71f8
refactored GIWAXS.py Transform class to include generalized load_mask…
kewh5868 Jul 18, 2023
f306a83
added createSampleDictionary() and selectSampleandSeries() methods to…
kewh5868 Jul 18, 2023
5329278
updating module imports in cmsgiwaxsloader() class to include correct…
kewh5868 Jul 18, 2023
5070201
adding save_as_zarr method to the Transform() object, and adding a Pr…
kewh5868 Jul 18, 2023
1cbff90
update the Process() class to ProcessData(), and removing inheritance…
kewh5868 Jul 18, 2023
41135a8
remove corrections module usage
kewh5868 Jul 18, 2023
de34434
adding error handling for selectsampleandseries and createSampleDicti…
kewh5868 Jul 18, 2023
4735e0f
moving return statement
kewh5868 Jul 18, 2023
629198a
updating selectSampleAndSeries(self) to include quit sequence. updati…
kewh5868 Jul 18, 2023
771a32d
removed "add_time_coord" method as it was broken. only the raw DA con…
andrewjlevin Jul 18, 2023
bf9af0a
Merge branch 'cms-giwaxs-support' of https://github.com/ToneyGroupCU/…
andrewjlevin Jul 18, 2023
a71baff
adding cell on multiple data set loading to the cms-giwaxs_process.ip…
kewh5868 Jul 18, 2023
a38ac73
added tqdm descriptions for loadSeries & pg_convert_series methods
andrewjlevin Jul 18, 2023
324c5c3
added custom energy parameter to Transform
andrewjlevin Jul 20, 2023
13657de
remove FileLoader inheritance of CMSGIWAXSLoader
andrewjlevin Jul 22, 2023
7e3a14f
Merge branch 'usnistgov:main' into cms-giwaxs-support
andrewjlevin Jul 25, 2023
3424894
added new function "single_images_to_dataset" inside GIWAXS.py, added…
andrewjlevin Jul 26, 2023
96659e1
Merge branches 'cms-giwaxs-support' and 'cms-giwaxs-support' of https…
andrewjlevin Jul 26, 2023
d1d3942
add interpolation correction to aforementioned function
andrewjlevin Jul 26, 2023
b9331f4
fix save_zarrs option in aforementioned function
andrewjlevin Jul 26, 2023
66a55f1
minor tweak to single_images_to_dataset function zarr saving lines
andrewjlevin Jul 26, 2023
e401a38
typo fixes
andrewjlevin Jul 26, 2023
efb043c
refined example notebooks & added brief readme.txt to CMS tutorial fo…
Jul 26, 2023
e4f48f9
slight typo fix
andrewjlevin Aug 9, 2023
222b349
Merge branch 'usnistgov:main' into cms-giwaxs-support
andrewjlevin Aug 9, 2023
a1d7189
allow maskPath to be a literal numpy ndarray
andrewjlevin Aug 15, 2023
6553b20
transformer init fix
andrewjlevin Aug 15, 2023
de572d2
Tidy up code in PFGeneralIntegrator
pbeaucage Apr 15, 2024
73b6ef0
Add zarr saving to fileio
pbeaucage Apr 15, 2024
465f1b9
Change sigma output to unified code that copies dims/coords
pbeaucage Apr 15, 2024
4b165b4
Add ponifile loading to PFGE
pbeaucage Apr 15, 2024
3acbe51
Add edf mask loading to PFGE
pbeaucage Apr 15, 2024
9ae38e6
Add missed import
pbeaucage Apr 15, 2024
4d947c2
Rewrite Transform to use PFGeneralIntegrator machinery
pbeaucage Apr 15, 2024
312d7d3
Rename GIWAXS to PGGeneralIntegrator
pbeaucage Apr 15, 2024
cef3f21
loader: raise error if 'files' is not pathlib.Path or iterable
andrewjlevin Apr 15, 2024
d2bfb2a
loader: commit 9 suggestions from code review
andrewjlevin Apr 15, 2024
782b139
Merge pull request #2 from pbeaucage/pr/100
andrewjlevin Apr 15, 2024
d9c22d6
fix indentation error
andrewjlevin Apr 23, 2024
3790a8b
remove Union syntax in saveZarr function (avoid NameError)
andrewjlevin Apr 23, 2024
79c758b
remove legacy giwaxs import in util.py
andrewjlevin Apr 23, 2024
f2ff5cd
small naming/syntax fixes caught in linting/github test runs
andrewjlevin Apr 23, 2024
4cb0aa3
add PGGeneralIntegrator to integrate.py
andrewjlevin Apr 23, 2024
250f77e
fix naming error for loading pyhyper mask
andrewjlevin Apr 23, 2024
b86f46a
remove maskpath argument, so that it only exists in kwargs
andrewjlevin Apr 23, 2024
007566b
pyfai needs ponifile path input to be a string
andrewjlevin Apr 23, 2024
28c1a07
update if statement in ponifile loader
andrewjlevin Apr 23, 2024
d9a7685
add template_xr to ponifile loader for empty masks
andrewjlevin Apr 23, 2024
6bd207c
add filename as attribute if no md scheme is provided. add unused arg…
andrewjlevin Apr 24, 2024
f1341a9
change value comparison to check if img is None in loadFileSeries
andrewjlevin Apr 24, 2024
929b242
add pygix to requirements
andrewjlevin Apr 24, 2024
d681a5b
add file_filter pathlib glob filtering
andrewjlevin Apr 24, 2024
a4c763f
file needs to be a string?
andrewjlevin Apr 24, 2024
fe9d936
updating, file should be a str of just the filename
andrewjlevin Apr 24, 2024
d8257a0
update to how the existing stacking dimension is preserved in integra…
andrewjlevin Apr 24, 2024
7c5f1c0
more syntax rearranging to preserve stacking dimension
andrewjlevin Apr 24, 2024
f07661a
consistenty fix, should let loadFileSeries work without needing a fil…
andrewjlevin Apr 24, 2024
e13219b
update single_images_to_dataset function
andrewjlevin Apr 24, 2024
379ce48
update single_image_to_ds function to update incident angle for each …
andrewjlevin Apr 24, 2024
eb93a0b
Merge remote-tracking branch 'nist/main' into cms-giwaxs-support
andrewjlevin Apr 24, 2024
8f9356a
updated time series processing notebook for new branch update
Apr 25, 2024
05ef956
Update main.yml
andrewjlevin Apr 25, 2024
0384c34
Update main.yml
andrewjlevin Apr 25, 2024
e87aea4
remove filetoload argument from a couple mask loaders, already using …
andrewjlevin Apr 25, 2024
958fe5a
Update requirements.txt; specify version of silx for pygix to work
andrewjlevin Apr 25, 2024
00731f5
update nika mask test
andrewjlevin Apr 25, 2024
b67461a
Merge branch 'cms-giwaxs-support' of https://github.com/ToneyGroupCU/…
andrewjlevin Apr 25, 2024
f714632
logic fix; add single_imgs_to_ds function to a new CMSGIWAXS class in…
andrewjlevin Apr 25, 2024
fc299f3
fix missing tqdm import
andrewjlevin Apr 25, 2024
5bc3e52
rearrange order of functions / methods. add more documentation across…
andrewjlevin Apr 26, 2024
fe57679
updated cms giwaxs tutorials to reflected updated cms-giwaxs-support
Apr 26, 2024
ae3f057
Update requirements.txt: add comment for silx specification
andrewjlevin Apr 26, 2024
66a17d5
add main.yml wgets & test_CMSLoader.py; also CMS Loader init docstr…
andrewjlevin Apr 28, 2024
d6d80ec
cmsgiwaxsloader: tidy imports & switch from PIL to fabio for image lo…
andrewjlevin Apr 30, 2024
05c9650
uncomment cmsloader test lines
andrewjlevin May 1, 2024
c34babc
fix: add naming scheme to test loader and correct attribute dim from…
andrewjlevin May 1, 2024
8b7e6eb
cmsloader: use PIL for tiffs (avoid fabio warning), fabio for anythin…
andrewjlevin May 1, 2024
7907e5f
add optional filename md scheme check before making cmsgiwaxsloaders
May 1, 2024
21c691f
move empty template_xr mask creation to __init__, minor dosctring cha…
andrewjlevin May 2, 2024
740b2cb
remote init empty mask creation, it's already in pygix integrateSingl…
andrewjlevin May 2, 2024
b6818be
fix: add empty mask back to calibrationFromTemplateXRParams
andrewjlevin May 2, 2024
d70681d
update tutorial processing notebooks to not used template_xr for inte…
May 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os}}
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10','3.11']
python-version: ['3.10','3.11']
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand Down Expand Up @@ -58,6 +58,8 @@ jobs:
unzip PSS300nm_C_ccd100.zip
wget https://github.com/usnistgov/PyHyperScattering/releases/download/0.0.0-example-data/smi_example.zip
unzip smi_example.zip
wget https://github.com/usnistgov/PyHyperScattering/releases/download/0.0.0-example-data/CMS_giwaxs_series.zip
unzip CMS_giwaxs_series.zip
- name: Fetch and unzip example data (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
Expand All @@ -71,6 +73,8 @@ jobs:
unzip PSS300nm_C_ccd100.zip
C:\msys64\usr\bin\wget.exe https://github.com/usnistgov/PyHyperScattering/releases/download/0.0.0-example-data/smi_example.zip
unzip smi_example.zip
C:\msys64\usr\bin\wget.exe https://github.com/usnistgov/PyHyperScattering/releases/download/0.0.0-example-data/CMS_giwaxs_series.zip
unzip CMS_giwaxs_series.zip
- name: Test with pytest
run: |
#pytest -v
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ venv/*
OrientationRunDec2019/**
**/*.p
**/.*
**/*.ipynb
*.png
*.h5
*.nxs
.ipynb_checkpoints
Example/**
example-data/**
src/__pycache__
*.egg-info
src/PyHyperScattering/__pycache__
src/PyHyperScattering/.ipynb_checkpoints/*
dist
docs/_build/*
dcs/_build/*
docs/_build/html/*
*.pyc
example_data/11012/Dark_56367-AI.txt
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ h5py
nodejs
numpy
pandas
# pygix fails to improt if silx > 2.0.0
silx==2.0.0
pyfai
pygix
pbeaucage marked this conversation as resolved.
Show resolved Hide resolved
scikit-image
scipy
pillow
Expand Down
319 changes: 319 additions & 0 deletions src/PyHyperScattering/CMSGIWAXSLoader.py

Large diffs are not rendered by default.

20 changes: 19 additions & 1 deletion src/PyHyperScattering/FileIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,25 @@ def __init__(self,xr_obj):
def savePickle(self,filename):
with open(filename, 'wb') as file:
pickle.dump(self._obj, file)



# - This was copied from the Toney group contribution for GIWAXS.
def saveZarr(self, filename, mode: str = 'w'):
"""
Save the DataArray as a .zarr file in a specific path, with a file name constructed from a prefix and suffix.

Parameters:
da (xr.DataArray): The DataArray to be saved.
base_path (Union[str, pathlib.Path]): The base path to save the .zarr file.
prefix (str): The prefix to use for the file name.
suffix (str): The suffix to use for the file name.
mode (str): The mode to use when saving the file. Default is 'w'.
"""
da = self._obj
ds = da.to_dataset(name='DA')
file_path = pathlib.Path(filename)
ds.to_zarr(file_path, mode=mode)

def saveNexus(self,fileName,compression=5):
data = self._obj
timestamp = datetime.datetime.now()
Expand Down
52 changes: 36 additions & 16 deletions src/PyHyperScattering/FileLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ class FileLoader():
Abstract class defining a generic scattering file loader. Input is a (or multiple) filename/s and output is a
xarray I(pix_x,pix_y,dims,coords) where dims and coords are loaded by user request.


Difference: all coords are dims but not all dims are coords. Dims can also be auto-hinted using the following
standard names: energy,exposure,pos_x,pos_y,pos_z,theta.
Difference: all coords are dims but not all dims are coords. Dims can also be auto-hinted using the following
standard names: energy,exposure,pos_x,pos_y,pos_z,theta.

Individual loaders can try searching metadata for other dim names but this is not guaranteed.
Coords can be used to provide a list of values for a dimension when that dimension cannot be hinted, e.g. where vals
come from external data.
Individual loaders can try searching metadata for other dim names but this is not guaranteed.
Coords can be used to provide a list of values for a dimension when that dimension cannot be hinted, e.g. where vals
come from external data.
'''
file_ext = '' # file extension to be used to filter files from this instrument
md_loading_is_quick = False
Expand All @@ -32,20 +31,35 @@ def loadSingleImage(self,filepath,coords=None,return_q=None,**kwargs):

def peekAtMd(self,filepath):
return self.loadSingleImage(filepath,{})



def loadFileSeries(self,basepath,dims,coords={},file_filter=None,file_filter_regex=None,file_skip=None,md_filter={},quiet=True,output_qxy=False,dest_qx=None,dest_qy=None,output_raw=False,image_slice=None):
def loadFileSeries(self,
basepath,
dims,
coords={},
file_filter=None,
file_filter_regex=None,
file_skip=None,
md_filter={},
quiet=True,
output_qxy=False,
dest_qx=None,
dest_qy=None,
output_raw=False,
image_slice=None):
'''
Load a series into a single xarray.

* = not implemented yet

Args:
basepath (str or Path): path to the directory to load
dims (list): dimensions of the resulting xarray, as list of str
dims (list): dimensions of the resulting xarray (excluding 'pix_x' and 'pix_y'), as list of str
coords (dict): dictionary of any dims that are *not* present in metadata
file_filter (str): string that must be in each file name
file_filer_regex(str): regex string that must match in each file name
file_skip (str): string that, if present in file name, means file should be skipped.

*file_filer_regex(str): regex string that must match in each file name
*file_skip (str): string that, if present in file name, means file should be skipped.

md_filter (dict): dict of *required* metadata values; points without these metadata values will be dropped
md_filter_regex (dict): dict of *required* metadata regex; points without these metadata values will be dropped
quiet (bool): skip printing most intermediate output if true.
Expand All @@ -61,14 +75,20 @@ def loadFileSeries(self,basepath,dims,coords={},file_filter=None,file_filter_reg
nfiles = len(os.listdir(basepath))
nprocessed = 0
nloaded = 0
print(f'Found {str(nfiles)} files.')
print(f'Found {str(nfiles)} total files.')
data_rows = []
qnew = None
dest_coords = defaultdict(list)
if file_filter_regex is not None:
file_filter_regex = re.compile(file_filter_regex)

for file in tqdm(sorted(os.listdir(basepath))):
if file_filter is not None:
filepaths = sorted(basepath.glob(f'*{file_filter}*'))
files = [f.name for f in filepaths]
else:
files = sorted(os.listdir(basepath))
print(f"Found {str(len(files))} files after applying 'file_filter'.")

for file in tqdm(files):
nprocessed += 1

if re.match(self.file_ext,file) is None:
Expand Down Expand Up @@ -102,7 +122,7 @@ def loadFileSeries(self,basepath,dims,coords={},file_filter=None,file_filter_reg
if not quiet:
print(f'Not loading {file}, expected {key} to be {val} but it was {md[key]}')
if load_this_image:
if img == None:
if img is None:
if not quiet:
print(f'Loading {file}')
img = self.loadSingleImage(basepath/file,coords=local_coords, return_q = output_qxy,image_slice=image_slice,use_cached_md=False)
Expand Down
85 changes: 70 additions & 15 deletions src/PyHyperScattering/IntegrationUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import xarray as xr
import numpy as np
import math
from tqdm.auto import tqdm

try:
import holoviews as hv
Expand Down Expand Up @@ -98,6 +99,8 @@ def checkAll(integrator,img,img_min=1,img_max=10000,img_scaling='log',alpha=1,d_
ax.add_patch(guide1)
ax.add_patch(guide2)
ax.imshow(integrator.mask,origin='lower',alpha=alpha)


class DrawMask:
'''
Utility class for interactively drawing a mask in a Jupyter notebook.
Expand All @@ -114,21 +117,22 @@ class DrawMask:

'''

def __init__(self,frame):
def __init__(self,frame, cmap='viridis', clim=(5e0, 5e3), width=800, height=700):
'''
Construct a DrawMask object

Args:
frame (xarray): a single data frame with pix_x and pix_y axes


'''

if len(frame.shape) > 2:
warnings.warn('This tool needs a single frame, not a stack! .sel down to a single frame before starting!',stacklevel=2)

self.frame=frame
self.frame = frame

self.fig = frame.hvplot(cmap='terrain',clim=(5,5000),logz=True,data_aspect=1)
self.fig = frame.hvplot(cmap=cmap, clim=clim, logz=True, data_aspect=1,
width=width, height=height)

self.poly = hv.Polygons([])
self.path_annotator = hv.annotate.instance()
Expand All @@ -140,17 +144,13 @@ def ui(self):

Returns: the holoviews object



'''
print('Usage: click the "PolyAnnotator" tool at top right. DOUBLE CLICK to start drawing a masked object, SINGLE CLICK to add a vertex, then DOUBLE CLICK to finish. Click/drag individual vertex to adjust.')
return self.path_annotator(
self.fig * self.poly.opts(
width=self.frame.shape[0],
height=self.frame.shape[1],
responsive=False),
annotations=['Label'],
vertex_annotations=['Value'])
annotator_plot = self.path_annotator(
self.fig * self.poly.opts(responsive=False),
annotations=['Label'],
vertex_annotations=['Value'])
return annotator_plot.opts(toolbar='left')


def save(self,fname):
Expand Down Expand Up @@ -178,11 +178,11 @@ def load(self,fname):
'''
with open(fname,'r') as f:
strlist = json.load(f)
print(strlist)
# print(strlist)
dflist = []
for item in strlist:
dflist.append(pd.read_json(item))
print(dflist)
# print(dflist)
self.poly = hv.Polygons(dflist)

self.path_annotator(
Expand All @@ -204,3 +204,58 @@ def mask(self):
mask |= skimage.draw.polygon2mask(self.frame.shape,self.path_annotator.annotated.iloc[i].dframe(['x','y']))

return mask


class CMSGIWAXS:
"""For streamlined loading for CMS data"""
def __init__(self, files, loader, integrator):
"""
Inputs: files: indexable object str or pathlib.Path filepaths to
raw GIWAXS data
loader: custom PyHyperScattering CMSGIWAXSLoader object, must
return DataArray with attributes metadata
integrator: instance of PGGeneralIntegrator object
"""
self.files = files
self.loader = loader
self.integrator = integrator

def single_images_to_dataset(self):
"""
Method that takes a subscriptable object of filepaths corresponding to raw GIWAXS
beamline data, loads the raw data into an xarray DataArray, generates pygix-transformed
cartesian and polar DataArrays, and creates 3 corresponding xarray Datasets
containing a DataArray per sample.
The raw dataarrays must contain the attributes 'scan_id' and 'incident_angle'

Outputs: 2 Datasets: raw & reciprocal space (cartesian or polar based on integrator object)
"""
# Select the first element of the sorted set outside of the for loop to initialize the xr.DataSet
DA = self.loader.loadSingleImage(self.files[0])
assert 'scan_id' in DA.attrs.keys(), "'scan_id' is a required attribute to use this function"

# Update incident angle per sample:
assert 'incident_angle' in DA.attrs.keys(), "'incident_angle' is a required attribute to use this function"
self.integrator.incident_angle = float(DA.incident_angle[2:])

# Integrate single image
integ_DA = self.integrator.integrateSingleImage(DA)

# Save coordinates for interpolating other dataarrays
integ_coords = integ_DA.coords

# Create a DataSet, each DataArray will be named according to it's scan id
raw_DS = DA.to_dataset(name=DA.scan_id)
integ_DS = integ_DA.to_dataset(name=DA.scan_id)

# Populate the DataSet with
for filepath in tqdm(self.files[1:], desc=f'Transforming Raw Data'):
DA = self.loader.loadSingleImage(filepath)
integ_DA = self.integrator.integrateSingleImage(DA)

integ_DA = integ_DA.interp(integ_coords)

raw_DS[f'{DA.scan_id}'] = DA
integ_DS[f'{DA.scan_id}'] = integ_DA

return raw_DS, integ_DS
Loading
Loading