Learn R Programming

ProFound (version 1.14.1)

profoundResample: Resample Images

Description

A utility function to resample input PSFs to different pixel scales on a consistent flux conserving manner.

Usage

profoundResample(image, pixscale_old = 1, pixscale_new = 1, type = "bicubic",
fluxscale = "image", recentre = FALSE)

Arguments

image

Numeric matrix; required, the image we want to resample.

pixscale_old

Numeric scalar; the current (old) pixel scale of the supplied image.

pixscale_new

Numeric scalar; the target (new) pixel scale of the desired output.

type

Character scalar; either "bilinear" for bilinear interpolation or "bicubic" for bicubic interpolation (default, requires akima package).

fluxscale

Character scalar; how the output image should be scaled. Either 'image' (the sum of output image will exactly qual the sum of the input image), 'pixscale' (the sum of the output pixels is scaled by the ratio of pixel scales squared, which means the output image will approximately equal the sum of the input image), or 'norm' (the output immge will sum to equal exactly 1).

recentre

Logical; should the final image have its peak flux value in the centre of the image? This is useful for resampling PSFs, where we do not want small centring errors. When the input image is highly off centre, or not a simple image of a PSF, then this option might cause image artefacts.

Value

Numeric matrix; the desired resampled image. This will have roughly dim(image)[1]*pixscale_old/pixscale_new by dim(image)[2]*pixscale_old/pixscale_new pixels. The interpolation

Details

Mostly used for resampling PSFs to different pixel scales.

See Also

profoundFluxDeblend

Examples

Run this code
# NOT RUN {
image=readFITS(system.file("extdata", 'VIKING/mystery_VIKING_Z.fits', package="ProFound"))$imDat
star = image[149 + -25:25, 74 + -25:25]
magimage(star)
magimage(profoundResample(star,1,2))
magimage(profoundResample(star,1,1/2))
# }
# NOT RUN {
<!-- % Add one or more standard keywords, see file 'KEYWORDS' in the -->
# }
# NOT RUN {
<!-- % R documentation directory. -->
# }

Run the code above in your browser using DataLab