profitRemakeModelList: Reconstruct an Image Model

profitRemakeModellistR Documentation

Reconstruct an Image Model

Description

This is a convenience function that allows users to easily substitute into a legal image model results from an optimisation run. This can be parsed directly into profitMakeModel. It uses the same conversion functions in the same manner as profitLikeModel so you can create an image model that is fully consistent. These consistent model lists can be used for other analysis, e.g. profitEllipsePlot.

Usage

profitRemakeModellist(parm, modellist, tofit, tolog = NULL, intervals = NULL,
  constraints = NULL, offset = NULL, parmuse = NULL, Data)

Arguments

parm

Vector; required, of parameters that will be inserted into the modellist provided.

modellist

List; required, the basic model list that describes the structure of the object (see profitMakeModel for details).

tofit

List; required, of elements that are being fitted, flagging which elements of modellist will be replaced with parm (see profitSetupData for details).

tolog

List; optional, of elements that are being fitted in log space, flagging which elements of modellist will be replaced with unlogged elements of parm (see profitSetupData for details). If missing then all parameters are assumed to be provided in native linear space.

intervals

List; optional, interval limits for each parameter, using a similar list structure to modellist (see profitSetupData for details). If missing then no interval limits are applied.

constraints

Function; optional, takes the modellist and returns a list with exactly the same structure (see profitSetupData for details). If missing then no constraints are applied.

offset

Numeric vector; optional. Additive offset to be applied to all xcen and ycen positions in the model list. This is useful if you are fitting one object on multiple images with different WCS- you should then specify the input modellist in a common manner for all Data objects (say using the coordinate system of the first image in the list), but supply different offset for each image, where [X,Y] (image N) = [X,Y] (image 1) + [X,Y] (offset N). If the offset vector is length 3, the third element is treated as the position angle, and this can also be given a rotational offset in degrees additively with respect to the first image in the list.

parmuse

Integer vector; optional. Species which element of the inpout parm will be propogated to the remade model list. This is only really intended for multi-frame fitting, where you might only want to use certain parameters in each image (e.g. you want to fit the mag freely, but force a common position angle to be fit to all images). Because of the deliberate flexibility, this takes some careful planning to use correctly, so user beware!

Data

Data of class profit.data; optional. This must be generated by the profitSetupData function. If the Data structure is present then modellist, tofit, tolog, intervals and constraints are taken from the list items within Data. If they are also provided as separate input arguments then these are used instead, so be careful when mixing and matching.

Value

A list with two elements: modellist; a list with the same structure as modellist; and parm, a vector with the same structure as parm.

Author(s)

Aaron Robotham

See Also

profitMakeModel, profitSetupData, profitLikeModel, profitEllipsePlot

Examples

modellist = list(
  sersic = list(
    xcen   = c(50, 50),
    ycen   = c(50, 50),
    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,-0.5)
  )
)

magimage(profitMakeModel(modellist))

tofit = list(
  sersic = list(
    xcen   = c(TRUE, NA),
    ycen   = c(TRUE, NA),
    mag = c(TRUE, FALSE),
    re  = c(TRUE, FALSE),
    nser  = c(TRUE, TRUE),
    ang  = c(FALSE, FALSE),
    axrat  = c(TRUE, FALSE),
    box = c(FALSE, FALSE)
  )
)

parm=c(55,55,12,20,1,4,0.8)

magimage(profitMakeModel(profitRemakeModellist(parm, modellist, tofit)$modellist))

ICRAR/ProFit documentation built on Feb. 1, 2024, 9:34 a.m.