apeck12 / sfx_utils Goto Github PK
View Code? Open in Web Editor NEWMiscellaneous functions for aiding calibration during SFX experiments at LCLS.
Miscellaneous functions for aiding calibration during SFX experiments at LCLS.
(I know you already are working on it Ariana, just thought I'd put this here for my own records)
We'd like to be able to:
I believe they are in keV in the assembled image, would be nice to check what they are otherwise - and document it somewhere.
If indeed in keV, it would be nice to document how to convert into "photons" and vice-versa.
sfx_utils/sfx_utils/geom_opt.py
Line 33 in 0f45dc6
geom_opt.opt_distance(plot=True, n_images=40000)
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
/tmp/ipykernel_25483/1338048410.py in <module>
----> 1 geom_opt.opt_distance(plot=True, n_images=40000)
~/sfx_utils/sfx_utils/geom_opt.py in opt_distance(self, sample, n_images, center, plot)
61 """
62 if self.powder is None:
---> 63 self.powder = self.compute_powder(n_images)
64
65 if sample == 'AgBehenate':
~/sfx_utils/sfx_utils/geom_opt.py in compute_powder(self, n_images, ptype)
31 """
32 if ptype == 'max':
---> 33 self.powder = np.amax(self.psi.get_images(n_images), axis=0)
34 elif ptype == 'mean':
35 self.powder = np.mean(self.psi.get_images(n_images), axis=0)
~/sfx_utils/sfx_utils/psana_interface.py in get_images(self, num_images, assemble)
65 images = np.zeros((num_images,
66 self.det.image_xaxis(self.run).shape[0],
---> 67 self.det.image_yaxis(self.run).shape[0]))
68 else:
69 images = np.zeros((num_images,) + self.det.shape())
MemoryError: Unable to allocate 826. GiB for an array with shape (40000, 1666, 1664) and data type float64
Add information on how to get the ssh key, get started with the jupyter hub and use the right kernel
We'd like to pull out the following statistics per event and plot their trajectory over the course of a given run:
To enable this, we need to write a function that performs the reverse of correct_panel
here:
https://github.com/cctbx/cctbx_project/blob/master/xfel/util/jungfrau.py
so that the reshaped mask matches the unassembled psana shape.
Add a page in the wiki on what nodes are accessible from outside SLAC (pslogin, psexport), what nodes have access to the data, etc.
It might be useful to add an option to set n_images
here so that it goes over all images in the run: https://github.com/apeck12/sfx_utils/blob/main/sfx_utils/geom_opt.py#L41
Maybe n_images=-1
?
Let's discuss here what would be the most convenient way to do this?
First mentioned in PR #27. Provide a histogram of the image values so that the user has more information for choosing the threshold values used during masking.
In addition to information about intensity statistics during a run, it would be helpful to get a visual display of how intensity is distributed in range and in time. This would allow to quickly identify calibration issues, and to identify regime changes during collection that would help for example pinpoint events where the detector could have been at risk of being damaged.
An idea could be to populate an array for each run intensity_distribution(n_events, n_intensity_bins)
that could be displayed in the form of a colored table as sketched below.
Considerations on binning:
plt.hexbin()
).Random extra thought: a similar plot for the whole experiment (with runs on the X-axis) might also be very useful for experiment summaries.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.