Learn R Programming

ProFit (version 1.3.3)

profitDeprojectImageEllipse: Deproject an image along an ellipse's minor axis

Description

A utility function to deproject an image with a projected circular source such as a thin disk

Usage

profitDeprojectImageEllipse(image, xcen, ycen, axrat, ang, upsample=5L)

Arguments

image

List or numeric; required. An image matrix or a list of image matrices, each of which will be deprojected. Every image must have the same dimensions as the first image, or have both dimensions be upsample times larger (e.g. for a finely sampled model).

xcen

Numeric; required. The x-coordinate in pixels of the ellipse centre in the images.

ycen

Numeric; required. The y-coordinate in pixels of the ellipse centre in the images.

axrat

Numeric; required. The axis ratio of the ellipse.

ang

Numeric; required. The position angle of the ellipse in degrees, following profitMakeModel convention of up=0.

upsample

Integer; optional. The factor by which to upsample each image. Must be positive.

Value

List; deprojected versions of all of the images provided in the original list (image).

Details

This function deprojects images, assuming that the object forms an ellipse in the image plane because it is a projection of a thin disk. Each provided image is oversampled and then resampled by stretching by 1/axrat along the ellipse minor axis. The value in each oversampled subpixel is assigned to whichever new pixel the centre of the subpixel happens to fall in, so discreteness artefacts will appear (especially for small values of upsample). It can be used on images, masks and/or binary segmentation maps, and is useful for visual inspection of disk galaxy features like spiral arms.

See Also

profitMakeModel

Examples

Run this code
# NOT RUN {
disk = profitMakeModel(modellist=list(sersic=list(xcen=50,ycen=50,mag=15,re=5,nser=1,
axrat=0.5,ang=125,box=0)))
magimage(log10(disk$z), zlim=c(-15,-7.5),magmap=FALSE)

deproj = profitDeprojectImageEllipse(disk$z, xcen=50, ycen=50, axrat=0.5, ang=125,
upsample = 9L)
magimage(log10(deproj$img), zlim=c(-15,-7.5),magmap=FALSE)
# }

Run the code above in your browser using DataLab