Created
September 17, 2012 13:40
-
-
Save Cadair/3737327 to your computer and use it in GitHub Desktop.
Bicubic vs Spline interpolation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
:Created on: Fri Sep 14 15:03:51 2012 | |
:author: Stuart Mumford | |
Test scipy's spline rotation against sunpy's bicubic rotation. | |
""" | |
import numpy as np | |
import sunpy | |
import matplotlib.pyplot as plt | |
aiamap = sunpy.make_map("aia.lev1.193A_2012-06-10T13:00:07.84Z.image_lev1.fits") | |
cubicrotate = aiamap.rotate(np.pi/2.,interpolation='bicubic',interp_param=-0.5) | |
splinerotate = aiamap.rotate(np.pi/2.,interpolation='spline',interp_param=3) | |
sdoaia193 = sunpy.cm.get_cmap('sdoaia193') | |
plt.figure(figsize=(10,10)) | |
plt.subplot(221) | |
plt.title("bicubic rotated $interp\_param=-0.5$") | |
plt.imshow(cubicrotate,origin='lower',cmap=sdoaia193) | |
plt.colorbar() | |
plt.subplot(222) | |
plt.title("Sunpy Rotated cubic spline") | |
plt.imshow(splinerotate,origin='lower',cmap=sdoaia193) | |
plt.colorbar() | |
plt.subplot(223) | |
plt.title("Difference between spline\n and cubic rotate") | |
plt.imshow(splinerotate-cubicrotate,origin='lower') | |
plt.colorbar() | |
plt.show() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment