Demonstrate httm image transformations.
To start, we will import matplotlib and increase the figure size so we can reasonably see artifacts in various FITS images we are going to be looking at.
In [1]:
%matplotlib inline
%config InlineBackend.figure_format = 'png'
In [2]:
import matplotlib
matplotlib.rcParams['figure.figsize'] = (8, 8)
In [3]:
!make -C fits_data raw_fits/spot50_raw.fits
In [4]:
import numpy
from httm.fits_utilities.raw_fits import raw_converter_from_fits
raw_data = raw_converter_from_fits('fits_data/raw_fits/spot50_raw.fits')
In [5]:
matplotlib.pyplot.imshow(numpy.log10(raw_data.slices[0].pixels-5099), clim=(0,4),interpolation='none')
matplotlib.pyplot.gca().invert_yaxis()
In [6]:
from httm.transformations.raw_converters_to_calibrated import convert_adu_to_electrons
In [7]:
electrons = convert_adu_to_electrons(raw_data)
In [8]:
matplotlib.pyplot.imshow(numpy.log10(electrons.slices[0].pixels-32800), clim=(0,7),interpolation='none')
matplotlib.pyplot.gca().invert_yaxis()
In [9]:
from httm.transformations.raw_converters_to_calibrated import remove_baseline, remove_undershoot, remove_smear, remove_start_of_line_ringing
In [10]:
baseless = remove_baseline(electrons)
In [11]:
matplotlib.pyplot.imshow(numpy.log10(baseless.slices[0].pixels+150), clim=(0,8),interpolation='none')
matplotlib.pyplot.gca().invert_yaxis()
In [12]:
no_under = remove_undershoot(baseless)
In [13]:
matplotlib.pyplot.imshow(numpy.log10(no_under.slices[0].pixels+40), clim=(0,8),interpolation='none')
matplotlib.pyplot.gca().invert_yaxis()
In [14]:
no_smear=remove_smear(no_under)
In [15]:
matplotlib.pyplot.imshow(numpy.log10(no_smear.slices[0].pixels+40), clim=(0,8),interpolation='none')
matplotlib.pyplot.gca().invert_yaxis()
In [16]:
no_solr = remove_start_of_line_ringing(no_under)
In [25]:
matplotlib.pyplot.imshow(numpy.log10(no_solr.slices[0].pixels+700), clim=(0,8),interpolation='none')
matplotlib.pyplot.gca().invert_yaxis()
In [ ]: