profitBruteConv: Low level brute force image convolution

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/profitConvolver.R

Description

A low level direct C++ implementation of brute force convolution that takes a user supplied image and point spread function (PSF) as inputs. In most situations users should make convolutions using the higher level profitConvolvePSF provided.

Usage

1
2
profitBruteConv(image, psf, calcregion=matrix(1,1,1), docalcregion=FALSE,
 plot = FALSE, ...)

Arguments

image

The image matrix to be convolved by the point spread function (PSF).

psf

The point spread function (PSF) image matrix that ProFit will use to convolve the image (should have odd size in both dimensions to prevent the image becoming offset.

calcregion

Matrix; logical image matrix the same size as the input image matrix. If docalcregion=TRUE, then pixels in calcregion that are TRUE (or 1) will have the convolution calculated, pixels with FALSE (or 0) values will be set to 0. This is included to increase computation speed in situations where only a small region of the full image contains the galaxy of interest for fitting. In this case pixels a long way from the segmentation region for the galaxy will not need to be convolved in order to calculate the correct likelihood within the segmentation.

docalcregion

Logical; should the calcregion logical matrix be used to define a subset of pixels to be convolved.

plot

Logical; should a magimage plot of the output be generated?

...

Further arguments to be passed to magimage. Only relevant is plot=TRUE.

Details

In the regime where one image is significantly (a factor of a few) smaller than the other image, this tends to be faster than FFT based convolution due to the lack of image padding and other overheads. PSF images tend to be only dozens of pixels and images 100s, so brute force convolution is the default convolution algorithm in ProFit. For this low level function the PSF supplied must have odd size in both dimensions or the image will become offset. To alleviate this issue a higher level function profitConvolvePSF is provided, that will re-interpolate the image to force the required odd sizes.

Value

Matrix; image matrix the same size as the input image matrix.

Author(s)

Aaron Robotham & Dan Taranu

See Also

profitConvolvePSF, profitMakePointSource, profitMakeModel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
model = list(
	sersic = list(
		xcen   = c(180, 60),
		ycen   = c(90, 10),
		mag = c(15, 13),
		re  = c(14, 5),
		nser  = c(3, 10),
		ang  = c(46, 80),
		axrat  = c(0.4, 0.6),
		box = c(0.5,-0.5)
	)
)

model.image=profitMakeModel(model=model, dim=c(200,200))$z

# Without convolution:

magimage(model.image)

# With convolution:

magimage(profitBruteConv(image=model.image, psf=profitMakePointSource()))

ProFit documentation built on July 23, 2019, 9:04 a.m.