profitRemakeModelList: Reconstruct an Image Model

Description Usage Arguments Value Author(s) See Also Examples

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

1
profitRemakeModellist(parm, modellist, tofit, tolog, intervals, constraints, 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.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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))

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