Skip to content

Instantly share code, notes, and snippets.

View astroboxio's full-sized avatar

astrobox.io astroboxio

View GitHub Profile
@astroboxio
astroboxio / coincidence_loss_corr.pro
Created February 15, 2016 16:28
Recipe for the coincidence loss correction from Poole et al. (2008)
;compute the size of the images (you can also do this manually rather than calling these keywords from the header)
nxpix_uw1_ext1 = sxpar(hima_sk_uw1_ext1,'NAXIS1')
nypix_uw1_ext1 = sxpar(hima_sk_uw1_ext1,'NAXIS2')
;make a new image file to save the correction factors
coicorr_uw1_ext1 = fltarr(nxpix_uw1_ext1,nypix_uw1_ext1)
;make a new image file to save the corrected image
ima_sk_coicorr_uw1_ext1 = fltarr(nxpix_uw1_ext1,nypix_uw1_ext1)
;define the variables from Poole et al. 2008
@astroboxio
astroboxio / fftransform.py
Created November 13, 2012 00:51
Fast Fourier Transforms #Python
import numpy as np
try:
# use scipy if available: it's faster
from scipy.fftpack import fft, ifft, fftshift, ifftshift
except:
from numpy.fft import fft, ifft, fftshift, ifftshift
def FT_continuous(t, h, axis=-1, method=1):