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

feat: multiple-scan / cross-scan loading in SST1RSoXSDB #38

Open
pbeaucage opened this issue Jul 24, 2022 · 1 comment
Open

feat: multiple-scan / cross-scan loading in SST1RSoXSDB #38

pbeaucage opened this issue Jul 24, 2022 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@pbeaucage
Copy link
Collaborator

A fairly common complaint about the Databroker loader is that it's difficult to load multiple scans and compare across them. For example, two polarizations on the same sample, or two samples with the same scan type.

There are valid memory-related reasons to not do this. But it is definitely needed.

I'm adding a new method to SST1RSoXSDB,

def loadSeries(self,run_list,meta_dim,loadrun_kwargs={},):
        '''
        Loads a series of runs into a single xarray object, stacking along meta_dim.
        
        Useful for a set of samples, or a set of polarizations, etc., taken in different scans.
        
        Args:
        
            run_list (list): list of scan ids to load
            
            meta_dim (str): dimension to stack along.  must be a valid attribute/metadata value, such as polarization or sample_name
            
        Returns:
            raw: xarray.Dataset with all scans stacked
        
        '''

example usage:

test = load.loadSeries([42598,42595,42654,42652],'sample_name')
test_integ = integ.integrateImageStack(test)
test_integ.unstack('system').mean('chi').sel(energy=284.25).plot(hue='sample_name')
pbeaucage added a commit that referenced this issue Jul 24, 2022
@pbeaucage pbeaucage added documentation Improvements or additions to documentation good first issue Good for newcomers labels Sep 14, 2022
@PriyankaKetkarBNL
Copy link
Collaborator

Assigning to myself. Will do so formally when I figure out how to add my NIST email to my account.

@PriyankaKetkarBNL PriyankaKetkarBNL self-assigned this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants