Skip to content

Commit

Permalink
minor updates mostly text
Browse files Browse the repository at this point in the history
bugfix
  • Loading branch information
sosey committed Oct 4, 2018
1 parent 3fccab4 commit 27a8851
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
8 changes: 5 additions & 3 deletions imexam/imexamine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,8 @@ def radial_profile(self, x, y, data=None, form=None,
centerx = x
icenterx = int(centerx)
icentery = int(centery)

# fractional center
xfrac = centerx - icenterx
yfrac = centery - icentery

Expand All @@ -1018,8 +1020,8 @@ def radial_profile(self, x, y, data=None, form=None,
icenterx - datasize:icenterx + datasize]

y, x = np.indices(data_chunk.shape) # index of all pixels
y = np.abs(y - datasize) + xfrac
x = np.abs(x - datasize) + yfrac
y = np.abs(y - datasize) - 0.5 + np.abs(0.5 - yfrac)
x = np.abs(x - datasize) - 0.5 + np.abs(0.5 - xfrac)
x[datasize, datasize] = 0
y[datasize, datasize] = 0

Expand Down Expand Up @@ -1083,7 +1085,7 @@ def radial_profile(self, x, y, data=None, form=None,
sigma_factor=sig_factor,
center_at=0,
weighted=True)
self.log.info(fitted)

fwhmx, fwhmy = math_helper.gfwhm(fitted.stddev_0.value)
legend = ("Max. pix. flux = {0:9.3f}\n"
"amp = {1:9.3f}\n"
Expand Down
15 changes: 12 additions & 3 deletions imexam/tests/test_imexamine.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ def test_gauss_center():


def test_radial_profile():
"""Test the radial profile function without background subtraction"""
"""Test the radial profile function
No background subtraction
Cummulive pixels used
"""
from astropy.convolution import Gaussian2DKernel
data = Gaussian2DKernel(1.5, x_size=25, y_size=25)
xx, yy = np.meshgrid(np.arange(25), np.arange(25))
Expand All @@ -146,6 +149,7 @@ def test_radial_profile():

plots = Imexamine()
plots.set_data(data.array)

# check the binned results
plots.radial_profile_pars['pixels'][0] = False
plots.radial_profile_pars['background'][0] = False
Expand All @@ -163,7 +167,9 @@ def test_radial_profile():

@pytest.mark.skipif('not HAS_PHOTUTILS')
def test_radial_profile_background():
"""Test the radial profile function with background subtraction"""
"""Test the radial profile function
With background subtraction
Cummulative pixels """
from astropy.convolution import Gaussian2DKernel
data = Gaussian2DKernel(1.5, x_size=25, y_size=25)
xx, yy = np.meshgrid(np.arange(25), np.arange(25))
Expand Down Expand Up @@ -195,7 +201,10 @@ def test_radial_profile_background():


def test_radial_profile_pixels():
"""Test the radial profile function without background subtraction"""
"""Test the radial profile function
without background subtraction
with each pixel unsummed
"""
from astropy.convolution import Gaussian2DKernel
data = Gaussian2DKernel(1.5, x_size=25, y_size=25)
xx, yy = np.meshgrid(np.arange(25), np.arange(25))
Expand Down
6 changes: 3 additions & 3 deletions imexam/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pytest

import numpy as np
from numpy.testing import assert_equal
from astropy.io import fits
Expand All @@ -15,7 +15,7 @@


def test_invalid_simple_fits():
"""Test for an invalid FITS hdu with no data in
"""Test for an invalid simple FITS hdu with no data in
the primary HDU."""

simple_fits_hdu = fits.PrimaryHDU()
Expand Down Expand Up @@ -59,7 +59,7 @@ def test_image_and_table_extensions():
mef_fits_hdu = fits.HDUList()
mef_fits_hdu.append(fits.PrimaryHDU())
extension = fits.PrimaryHDU()

mef_fits_hdu.append(tbhdu)
mef_fits_hdu.append(fits.ImageHDU(test_data_zeros,
header=extension.header,
Expand Down

0 comments on commit 27a8851

Please sign in to comment.