Skip to content

Instantly share code, notes, and snippets.

View christinahedges's full-sized avatar

Christina Hedges christinahedges

View GitHub Profile
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.
@christinahedges
christinahedges / make_psf_fits.py
Created October 4, 2022 15:22
Makes a PSF fits file from LLNL psf matlab file
from astropy.io import fits
from astropy.table import Table
d = loadmat('/Users/chedges/Downloads/pandora_vis_20220506.mat')
# Bin down the PSF, it's too big a file...
nbin = 2
PSF = np.asarray([[d['PSF'][idx::nbin, jdx::nbin] for idx in range(nbin)] for jdx in range(nbin)]).mean(axis=(0, 1))
PSF = PSF.reshape((*PSF.shape[:2], 9, 9, 5))
sub_pixel_size = nbin * d['dx'][0][0] * u.micron/u.pix
pixel_size = 6.5 * u.micron/u.pix
x = d['x'][0].reshape((9, 9, 5)) * u.mm
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.