Skip to content

Instantly share code, notes, and snippets.

@tjlane
tjlane / GI_Errors.ipynb
Created October 8, 2019 10:04
per-pixel GI errors
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tjlane
tjlane / multiplex_sensing_simulations.ipynb
Last active July 29, 2019 01:42
Simple simulations showing the performance of different sensing matrices, using and not using sparsity
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tjlane
tjlane / xtcav_roi.py
Created July 17, 2018 21:25
pull the processed ROI from the XTCAV OPAL
import psana
from xtcav2.LasingOnCharacterization import *
import numpy as np
from matplotlib import pyplot as plt
data_source = psana.DataSource("exp=amox23616:run=74")
XTCAVRetrieval = LasingOnCharacterization()
for evt in data_source.events():
@tjlane
tjlane / scratch.ipynb
Created April 25, 2018 05:08
Code Development for Gainmap Translator
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tjlane
tjlane / iota_filter_pickles_THz.py
Created November 4, 2017 17:55
Hekstra beamtime analysis code: PICKLE version
"""
This rather nasty little script was copied from the CCTBX release and
modified to work.
I swapped the event code fetching to work with psana.SmallData's most
recent EVR format, and also replaced the filter on event code 92
(which had been employed with the HV pulse generator) with event code
90, which is the THz laser trigger.
@tjlane
tjlane / hdf5_to_tiff.py
Created November 4, 2017 17:38
Hekstra beamtime analysis code: TIFF version
"""
convert HDF5 files with images into sorted on/off TIFF sets
"""
import sys
import os
import struct
import h5py
import numpy as np
@tjlane
tjlane / compute_tt_delay.py
Last active July 24, 2017 16:31
Draft Timetool Processing Improvements for psana
#!/usr/bin/env python
import psana
import numpy as np
from skimage import measure
from scipy import signal
from ttanalyzer import TTAnalyzer
def relative_time(edge_position):
"""
@tjlane
tjlane / fft_correlation.ipynb
Created March 28, 2017 20:43
find the coins!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tjlane
tjlane / epix_analysis.py
Created March 14, 2017 16:59
updated epix analysis script
#!/usr/bin/env python
"""
Creates an hdf5 file with the photon histograms and the average image
for one of the epix detectors and for a given number of shots
TJL Change Log 3/14/17
----------------------
1. Made "good shots" a per-event data
2. Used smldata.sum() to make sure the summed image is computed using MPI