Skip to content

Commit

Permalink
Merge pull request #229 from shanosborne/distortion
Browse files Browse the repository at this point in the history
Shift distorted PSFs back to correct detector position
  • Loading branch information
mperrin authored Oct 23, 2018
2 parents 9f5358d + 0c79dd3 commit b5c9a31
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions webbpsf/distortion.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import copy

import astropy.convolution
import astropy.io.fits as fits
import copy
import numpy as np
import poppy
import pysiaf
from scipy.interpolate import griddata
from scipy.ndimage.interpolation import rotate

import poppy


def _get_default_siaf(instrument, aper_name):
""" Store the default SIAF values for distortion and rotation """
Expand Down Expand Up @@ -98,6 +96,10 @@ def apply_distortion(hdulist_or_filename=None, fill_value=0):
# Going from Idl to Sci this way allows us to add in the distortion
xsci, ysci = aper.idl_to_sci(xidl, yidl)

# 6) Shift the sci indices so they match the PSF's position again (moved slightly off from pysiaf calculation)
xsci += xpix_center - np.median(xsci)
ysci += ypix_center - np.median(ysci)

# ###############################################
# Create an array of indices (in pixels) that the final data will be interpolated on to
# 1) Set up blank indices (in pixels)
Expand Down

0 comments on commit b5c9a31

Please sign in to comment.