usnistgov / PyHyperScattering

Tools for hyperspectral x-ray and neutron scattering data loading, reduction, slicing, and visualization.
Other
7 stars 9 forks source link

test how import works with energy and polarization/angle within a single bluesky run #63

Closed EliotGann closed 1 year ago

EliotGann commented 1 year ago

SST1's new acquisition scheme will allow for multiple energy scans in a single run. how these will import into pyhyper will be important to rigorously test

pbeaucage commented 1 year ago

do you have an example scan id?

EliotGann commented 1 year ago

I solved this for my Igor browser. it's slightly painful, but my logic is 1.) check if axis exists, if it exists, check if the maximum and minimum are more than 0.1 apart. if so, add that as an axis. if not, just make it a variable

EliotGann commented 1 year ago

48815 -> energy and polarization 48813 ->polarization 48812 -> angle and polarization (also sample x and y, but in such cases angle is the main one)

EliotGann commented 1 year ago

energy could be an added axis in either of those last two (it's just one value in these cases)

cbishop4 commented 1 year ago

Working on this issue - to clarify, for scan 48815, it has been taken at several energies (typical) and also multiple (I'm assuming 2) polarizations (new)? 48813 was taken at multiple polarizations, with no other changes - i.e., was taken at a single energy? And 48812 was taken at a single energy, but with multiple angles and polarizations?

EliotGann commented 1 year ago

That's what I meant, yes. Energy can be an axis in most scans, then extra axes that have been added immediately are polarization and angle (which also moves X and Y). then we need to also handle Spiral scans, where X and Y are changed but there is only one energy, polarization, and angle. I can link to where I handle this in the Igor reader if that helps with the logic.

EliotGann commented 1 year ago

https://github.com/NSLS-II-SST/TiledRSoXS/blob/33f1d34056bbb849c0db6f0482367158585f95ce/TiledRSoXS.ipf#L849-L894 is where I do the logic of naming the images based on if each of the axes exist, and if they deviate more than 0.1.

EliotGann commented 1 year ago

https://github.com/NSLS-II-SST/TiledRSoXS/blob/33f1d34056bbb849c0db6f0482367158585f95ce/TiledRSoXS.ipf#L878-L893 is the specific part where I do the logic of choosing which to make axis labels - using x and y only if angle hasn't moved etc

cbishop4 commented 1 year ago

live_analysis branch has been updated to load data from current runs. It is backwards-compatible with old scans with different metadata, at least back to 2022 beamtimes. Example notebook added in tutorial of the live_analysis branch.

pbeaucage commented 1 year ago

I'm going to leave this open for a critical issue: we should really have unit tests in the code of all these odd loading scenarios, even if we have to mark them skipped until public Tiled server is available.

pbeaucage commented 1 year ago

@cbishop4 and @EliotGann - scan 48815 is a NEXAFS scan. Is there an equivalent RSoXS scan for testing?

pbeaucage commented 1 year ago

This is now completed in PR #65. Seems to work well.