Load our useful libraries:
library(ProFit)
#> Loading required package: FITSio
library(ProFound)
#> Loading required package: Rcpp
library(magicaxis)
library(Highlander)
library(Rfits)
Set global evaluate (basically TRUE for GitHub version and FALSE for CRAN):
= TRUE evalglobal
Here we look at co-fitting images with offset positions.
= Rfits_read_image(system.file("extdata/Offset/Zim1.fits",package="ProFit"), ext=2)$imDat
im1 = Rfits_read_image(system.file("extdata/Offset/Zim2.fits",package="ProFit"), ext=2)$imDat im2
Here we have two similar Z-band frames taken at slightly offset positions of the same primary source. With ProFit it is possible to fit these simultaneously without resorting to stacking.
magimage(im1)
magimage(im2)
First we should extract the PSFs using the profitAllStarDoFit function (this will take about 5 minutes):
= profitAllStarDoFit(im1, magzero=30, rough=TRUE, plot=TRUE)
PSF1 #> Running Found2Fit
#> Running ProFound
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -69.0934 0.4005 1.1222 1.2353 1.9317 24.2812
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 4.102557 1.121245 1.290650 5.289717
#> [1] "Using 2634 out of 2634"
#> Running Highander
#> Iteration 1
#> CMA 1: -6608.818 25.609 76.583 25.351 77.035 25.587 25.94 76.586 76.582 15.194 15.363 17.579 17.525 0.456 0.284
#>
#> Laplace's Demon was called on Thu Feb 18 16:13:21 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -4424.8
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -4419.846 25.703 76.615 25.97 76.73 25.583 25.945 76.291 76.594 15.177 15.372 17.364 17.404 0.457 0.285
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:13:27 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -4421.6
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -4419.756 25.703 76.615 25.97 76.731 25.582 25.946 76.292 76.593 15.178 15.371 17.364 17.405 0.457 0.285
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -7.2431 -0.5845 0.1321 0.1095 0.8294 7.6762
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.227453 1.049454 1.069986 2.431338
#> [1] "Using 2634 out of 2634"
= profitAllStarDoFit(im2, magzero=30, rough=TRUE, plot=TRUE)
PSF2 #> Running Found2Fit
#> Running ProFound
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -59.8426 0.3988 1.1786 1.1924 2.1024 15.2472
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 3.473659 1.244300 1.436738 5.153411
#> [1] "Using 1829 out of 1829"
#> Running Highander
#> Iteration 1
#> CMA 1: -3177.207 25.585 76.279 25.356 76.19 25.463 25.101 76.332 77.048 15.39 17.002 17.158 17.395 0.382 0.273
#>
#> Laplace's Demon was called on Thu Feb 18 16:13:40 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -3025.5
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -3020.679 25.563 76.289 25.426 76.138 25.443 25.075 76.341 76.977 15.381 16.946 17.185 17.385 0.386 0.272
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:13:47 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -3018.5
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -3018.092 25.564 76.299 25.425 76.133 25.453 25.068 76.339 76.984 15.376 16.946 17.183 17.375 0.384 0.27
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -7.7484 -0.5688 0.1592 0.1251 0.8445 7.4781
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.203135 1.047285 1.064830 2.333613
#> [1] "Using 1829 out of 1829"
We can compare the models:
$psf_modellist
PSF1#> $moffat
#> $moffat$xcen
#> [1] 25.5
#>
#> $moffat$ycen
#> [1] 25.5
#>
#> $moffat$mag
#> [1] 0
#>
#> $moffat$fwhm
#> [1] 2.863622
#>
#> $moffat$con
#> [1] 1.925433
#>
#> $moffat$ang
#> [1] 0
#>
#> $moffat$axrat
#> [1] 1
$psf_modellist
PSF2#> $moffat
#> $moffat$xcen
#> [1] 25.5
#>
#> $moffat$ycen
#> [1] 25.5
#>
#> $moffat$mag
#> [1] 0
#>
#> $moffat$fwhm
#> [1] 2.423221
#>
#> $moffat$con
#> [1] 1.861939
#>
#> $moffat$ang
#> [1] 0
#>
#> $moffat$axrat
#> [1] 1
The seeing in our second image is clearly quite a bit better (FWHM 2.4 versus 2.9). This is also why we should get a better solution by fitting both images simultaneously rather than stacking.
To get most of the way to the correct Datalist structure we need we can use profitFound2Fit:
= profitFound2Fit(im1, loc=c(450,500), psf=PSF1$psf, cutbox=c(300,300), Ncomp=2,
F2F1 magzero=30, SBdilate=2, tightcrop=FALSE)
#> No input segim that matches the input image- will create one using ProFound!
#> Running ProFound
= profitFound2Fit(im2, loc=c(450,500), psf=PSF2$psf, cutbox=c(300,300), Ncomp=2,
F2F2 magzero=30, SBdilate=2, tightcrop=FALSE)
#> No input segim that matches the input image- will create one using ProFound!
#> Running ProFound
The main adjustment we need to make it to tell ProFit what the offset is between the frames and put this into the Data object contained. From the original WCSs the offset from im1 to im2 is know to be [-23.112,-9.697] pixels:
$Data$offset = c(-23.112,-9.697) F2F2
We can now check this using the profitLikeModel function, where the same initial parameters get shifted for the second Data object:
profitLikeModel(F2F1$Data$init, Data=F2F1$Data, makeplots=TRUE)
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -6.6857 -0.4531 0.3027 0.4301 1.1260 24.4117
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.582811 1.173234 1.237891 2.808601
#> [1] "Using 22881 out of 22881"
#> $LP
#> [1] -51802.61
#>
#> $Dev
#> [1] 103605.2
#>
#> $Monitor
#> LL LP tend.elapsed
#> -51802.607 -51802.607 42.807
#>
#> $yhat
#> [1] 1
#>
#> $parm
#> sersic.xcen1 sersic.ycen1 sersic.mag1 sersic.mag2 sersic.re1
#> 161.0384678 153.8342988 14.0231202 14.0231202 1.2186830
#> sersic.re2 sersic.ang2 sersic.axrat2
#> 1.6958043 114.0776665 -0.2732623
profitLikeModel(F2F1$Data$init, Data=F2F2$Data, makeplots=TRUE)
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -9.7233 -0.2640 0.4846 0.5947 1.3009 26.2145
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.602233 1.154734 1.203201 2.813663
#> [1] "Using 17968 out of 17968"
#> $LP
#> [1] -42751.26
#>
#> $Dev
#> [1] 85502.52
#>
#> $Monitor
#> LL LP tend.elapsed
#> -42751.261 -42751.261 43.033
#>
#> $yhat
#> [1] 1
#>
#> $parm
#> sersic.xcen1 sersic.ycen1 sersic.mag1 sersic.mag2 sersic.re1
#> 137.9264678 144.1372988 14.0231202 14.0231202 1.2186830
#> sersic.re2 sersic.ang2 sersic.axrat2
#> 1.6958043 114.0776665 -0.2732623
The solutions look pretty similar now! To simplify things we want to create a Datalist structure that contains the two lists:
= c(list(F2F1$Data), list(F2F2$Data)) Datalist
You can now run profitLikeModel more directly:
profitLikeModel(F2F1$Data$init, Data=Datalist, makeplots=TRUE)
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -6.6857 -0.4531 0.3027 0.4301 1.1260 24.4117
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.582811 1.173234 1.237891 2.808601
#> [1] "Using 22881 out of 22881"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -9.7233 -0.2640 0.4846 0.5947 1.3009 26.2145
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.602233 1.154734 1.203201 2.813663
#> [1] "Using 17968 out of 17968"
#> $LP
#> [1] -94553.87
#>
#> $Dev
#> [1] 189107.7
#>
#> $Monitor
#> LL LP tend.elapsed
#> -94553.868 -94553.868 87.224
#>
#> $yhat
#> [1] 1
#>
#> $parm
#> sersic.xcen1 sersic.ycen1 sersic.mag1 sersic.mag2 sersic.re1
#> 161.0384678 153.8342988 14.0231202 14.0231202 1.2186830
#> sersic.re2 sersic.ang2 sersic.axrat2
#> 1.6958043 114.0776665 -0.2732623
The final thing we need to do is add a couple of elements to the Datalist to make it compatible with LaplacesDemon:
$mon.names = F2F1$Data$mon.names
Datalist$parm.names = F2F1$Data$parm.names
Datalist$N = F2F1$Data$N Datalist
Now we can finally run Highlander to find the best common solution for the two frames (this will take about 5 minutes):
= Highlander(F2F1$Data$init, Data=Datalist, likefunc=profitLikeModel, ablim=1)
HighFit #> Iteration 1
#> CMA 1: -111308.301 160.918 152.837 13.419 14.183 1.403 2.013 115.195 -0.49
#>
#> Laplace's Demon was called on Thu Feb 18 16:15:24 2021
#>
#> Performing initial checks...
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -75275.3
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -75270.252 159.851 153.471 13.783 14.03 1.321 1.717 112.825 -0.404
#> Iteration 2
#> CMA 2: -67740.439 159.759 153.425 14.651 13.53 0.837 1.655 113.42 -0.284
#>
#> Laplace's Demon was called on Thu Feb 18 16:18:01 2021
#>
#> Performing initial checks...
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -67495
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -67492.91 159.849 153.475 14.668 13.539 0.832 1.654 112.774 -0.282
And now we can check the results:
profitLikeModel(HighFit$parm, Data=Datalist, makeplots=TRUE)
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -5.381897 -0.681847 0.010987 -0.007709 0.654288 8.440533
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.1973589 0.9878133 0.9979990 2.2884130
#> [1] "Using 22881 out of 22881"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -7.88758 -0.60033 0.06893 0.03933 0.68825 8.31330
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.2276587 0.9527569 0.9736733 2.3877698
#> [1] "Using 17968 out of 17968"
#> $LP
#> [1] -67492.91
#>
#> $Dev
#> [1] 134985.8
#>
#> $Monitor
#> LL LP tend.elapsed
#> -67492.910 -67492.910 725.181
#>
#> $yhat
#> [1] 1
#>
#> $parm
#> sersic.xcen1 sersic.ycen1 sersic.mag1 sersic.mag2 sersic.re1
#> 159.8489410 153.4752272 14.6682279 13.5394133 0.8318719
#> sersic.re2 sersic.ang2 sersic.axrat2
#> 1.6543605 112.7735413 -0.2822294
A similar methodology will work on any number of images, as long as they fit within memory. They should strictly all be the same band and pixel scale however, since currently (as of Jan 2021) ProFit does not allow the main model parameters to vary between images (other than the [X,Y] offset as shown above). Longer term the plan is to allow such functionality.
It is also possible, but more complicated, to fit some but not all parameters. For this mode the users will need to be keenly aware of which parameters are which within the parm stuctures of Data since they will need to construct their own, and tag which parts should correspond to the relevant model list. If that sounds complicated, then its because it is! With great flexibility comes great complexity…
Imagine we want to do a fit much like the above, but where we want to the two disk Re argument to be free to fit differently in image 2. In this case the image is of the same object in the same band, so there is no real reason to allow the disk Re to fit freely (they should be linked together) but we can treat it as a placeholder for an observation in a different band. In this case we might expect many parameters to be precisely linked ([X,Y] and position angle), but the size (Re) to be different because we expect colour gradients in (at least some) disks. As a simple example we can look at the above Datalist.
1]]$init
Datalist[[#> sersic.xcen1 sersic.ycen1 sersic.mag1 sersic.mag2 sersic.re1
#> 161.0384678 153.8342988 14.0231202 14.0231202 1.2186830
#> sersic.re2 sersic.ang2 sersic.axrat2
#> 1.6958043 114.0776665 -0.2732623
2]]$init
Datalist[[#> sersic.xcen1 sersic.ycen1 sersic.mag1 sersic.mag2 sersic.re1
#> 137.9622250 144.2416319 14.0558577 14.0558577 1.2128408
#> sersic.re2 sersic.ang2 sersic.axrat2
#> 1.6899620 116.3105014 -0.2890468
We now need to make a new init structure that adds on an additional re term for the second image disk (re2b) and a new parmuse structure that tells ProFit where to look for parameters when fittin each image.
= c(list(F2F1$Data), list(F2F2$Data)) #Note we are still using the offset added to F2F2$Data
Datalist2
= F2F1$Data$init
init_new = c(init_new, sersic.re2b = as.numeric(F2F2$Data$init['sersic.re2']))
init_new
init_new#> sersic.xcen1 sersic.ycen1 sersic.mag1 sersic.mag2 sersic.re1
#> 161.0384678 153.8342988 14.0231202 14.0231202 1.2186830
#> sersic.re2 sersic.ang2 sersic.axrat2 sersic.re2b
#> 1.6958043 114.0776665 -0.2732623 1.6899620
$mon.names = F2F1$Data$mon.names
Datalist2$parm.names = names(init_new) #Careful: This needs to reflect the new longer parm init.
Datalist2$N = F2F1$Data$N
Datalist2
1]]$init = init_new
Datalist2[[2]]$init = init_new
Datalist2[[
1]]$parmuse = 1:8 #We use the first arguments for image 1 fitting
Datalist2[[2]]$parmuse = c(1,2,3,4,5,9,7,8) Datalist2[[
We can sanity check this by passing through profitLikeModel as before:
profitLikeModel(Datalist2[[1]]$init, Data=Datalist2, makeplots=TRUE)
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -6.6857 -0.4531 0.3027 0.4301 1.1260 24.4117
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.582811 1.173234 1.237891 2.808601
#> [1] "Using 22881 out of 22881"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -9.8197 -0.2527 0.4914 0.5913 1.2992 26.1428
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.592902 1.144776 1.194834 2.783262
#> [1] "Using 17968 out of 17968"
#> $LP
#> [1] -94249.68
#>
#> $Dev
#> [1] 188499.4
#>
#> $Monitor
#> LL LP tend.elapsed
#> -94249.675 -94249.675 726.589
#>
#> $yhat
#> [1] 1
#>
#> $parm
#> sersic.xcen1 sersic.ycen1 sersic.mag1 sersic.mag2 sersic.re1
#> 161.0384678 153.8342988 14.0231202 14.0231202 1.2186830
#> sersic.re2 sersic.ang2 sersic.axrat2 sersic.re2b
#> 1.6958043 114.0776665 -0.2732623 1.6899620
Now we can finally run Highlander to find the best common solution for the two frames (this will take about 5 minutes) where the disk Re are allowed to differ:
= Highlander(Datalist2[[1]]$init, Data=Datalist2, likefunc=profitLikeModel, ablim=1)
HighFit2 #> Iteration 1
#> CMA 1: -76041.17 159.631 153.796 13.986 13.881 1.254 1.671 114.409 -0.311 1.675
#>
#> Laplace's Demon was called on Thu Feb 18 16:20:42 2021
#>
#> Performing initial checks...
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -70979.1
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -70978.74 159.853 153.469 14.133 13.761 1.151 1.689 112.795 -0.33 1.694
#> Iteration 2
#> CMA 2: -68043.813 159.673 153.499 14.599 13.567 0.873 1.661 111.788 -0.289 1.664
#>
#> Laplace's Demon was called on Thu Feb 18 16:23:30 2021
#>
#> Performing initial checks...
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -67616.9
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -67616.936 159.843 153.469 14.614 13.56 0.872 1.655 112.847 -0.288 1.66
We still a get a pretty good fit:
profitLikeModel(HighFit2$parm, Data=Datalist2, makeplots=TRUE)
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -5.590731 -0.668126 0.029562 0.002728 0.670766 8.341164
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.1997452 0.9895225 0.9980599 2.2949033
#> [1] "Using 22881 out of 22881"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -6.55266 -0.59480 0.07748 0.04835 0.70032 8.33491
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.2300176 0.9550635 0.9788611 2.3799007
#> [1] "Using 17968 out of 17968"
#> $LP
#> [1] -67616.94
#>
#> $Dev
#> [1] 135233.9
#>
#> $Monitor
#> LL LP tend.elapsed
#> -67616.936 -67616.936 1401.078
#>
#> $yhat
#> [1] 1
#>
#> $parm
#> sersic.xcen1 sersic.ycen1 sersic.mag1 sersic.mag2 sersic.re1
#> 159.8430730 153.4685209 14.6141416 13.5598717 0.8723521
#> sersic.re2 sersic.ang2 sersic.axrat2 sersic.re2b
#> 1.6552898 112.8474724 -0.2876830 1.6602973
Now we can take a look at the fit parameters. Note that even though they were free to be fitted separately, sersic.re2 and sersic.re2b are very similar!
$parm
HighFit2#> sersic.xcen1 sersic.ycen1 sersic.mag1 sersic.mag2 sersic.re1
#> 159.8430730 153.4685209 14.6141416 13.5598717 0.8723521
#> sersic.re2 sersic.ang2 sersic.axrat2 sersic.re2b
#> 1.6552898 112.8474724 -0.2876830 1.6602973
ProFit v2.0.0 and upwards support highly automated multi-band fitting via the profitMultiBandFound2Fit and profitMultiBandDoFit functions. These require the images provided to be exactly registered and cropped to the desired level (no offset or cut out options here). If this is not the case, then lower level functions (i.e. those above) probably need to be used instead. These functions will find stars and create per band PSFs automatically, so they might well covere the major use cases for many people.
As an example we can load in 9 bands of data that come included in the ProFound package, and cut out around a bright spiral galaxy:
= c(1200,480)
loc = -299:300
cut
= list(
image_list u = Rfits_read_image(system.file("extdata", 'MultiBand/u.fits', package="ProFound"),ext=2)$imDat[loc[1] + cut, loc[2] + cut],
g = Rfits_read_image(system.file("extdata", 'MultiBand/g.fits', package="ProFound"),ext=2)$imDat[loc[1] + cut, loc[2] + cut],
r = Rfits_read_image(system.file("extdata", 'MultiBand/r.fits', package="ProFound"),ext=2)$imDat[loc[1] + cut, loc[2] + cut],
i = Rfits_read_image(system.file("extdata", 'MultiBand/i.fits', package="ProFound"),ext=2)$imDat[loc[1] + cut, loc[2] + cut],
Z = Rfits_read_image(system.file("extdata", 'MultiBand/Z.fits', package="ProFound"),ext=2)$imDat[loc[1] + cut, loc[2] + cut],
Y = Rfits_read_image(system.file("extdata", 'MultiBand/Y.fits', package="ProFound"),ext=2)$imDat[loc[1] + cut, loc[2] + cut],
J = Rfits_read_image(system.file("extdata", 'MultiBand/J.fits', package="ProFound"),ext=2)$imDat[loc[1] + cut, loc[2] + cut],
H = Rfits_read_image(system.file("extdata", 'MultiBand/H.fits', package="ProFound"),ext=2)$imDat[loc[1] + cut, loc[2] + cut],
Ks = Rfits_read_image(system.file("extdata", 'MultiBand/Ks.fits', package="ProFound"),ext=2)$imDat[loc[1] + cut, loc[2] + cut]
)
We wish to force some degree of smoothness in certain per-band parameters (bulge mag [mag1] disk mag [mag2] and disk Re [re2]), so we make use of the smooth.parm function argument where we limit the smoothness to having 3 degrees of freedom:
= list(
smooth.parm mag1=function(x,y){smooth.spline(x,y,df=3)},
mag2=function(x,y){smooth.spline(x,y,df=3)},
re2=function(x,y){smooth.spline(x,y,df=3)}
)
By supplying these functions we optimise the node points in our spline rather than the parameters directly. This hopefully means we reduce unphysical discontinuities, whilst still achieving a good quality fit.
We also need to tell it the wavelength of the images provided, listed in blue to red order (ugriZYJHKs):
= c(577.482, 4744.164, 6312.451, 7584.157, 8833.013, 10223.626, 12545.988, 16476.995, 21549.195) wave
We can now run a highly automated fit, where the only significant non-default option is to run the stacked image profoundProFound run using a tolerance of 20 to stop the target large spiral galaxy being broken up. This will take about 45 minutes to run (go have a nice coffee break):
= profitMultiBandDoFit(image_list=image_list, magzero=c(0,0,0,0,30,30,30,30,30),
MultiFit smooth.parm=smooth.parm, wave=wave, tolerance=20)
#> Running MultiBandFound2Fit
#> Image 1: running initial ProFound
#> Image 1: running AllStarDoFit
#> Running Found2Fit
#> Running ProFound
#> Running Highander
#> Iteration 1
#> CMA 1: -1299.393 25.068 25.71 18.31 0.422 0.246
#>
#> Laplace's Demon was called on Thu Feb 18 16:24:55 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -1302.1
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> Iteration 2
#> CMA 2: -1299.393 25.068 25.71 18.31 0.422 0.246
#>
#> Laplace's Demon was called on Thu Feb 18 16:24:57 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -1301
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> Image 2: running initial ProFound
#> Image 2: running AllStarDoFit
#> Running Found2Fit
#> Running ProFound
#> Running Highander
#> Iteration 1
#> CMA 1: -6306.773 25.213 76.235 25.064 77.282 25.681 24.376 75.738 75.145 17.091 20.952 21.374 23.292 0.494 0.319
#>
#> Laplace's Demon was called on Thu Feb 18 16:25:02 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -5032.8
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -5026.717 25.202 76.264 25.129 75.984 25.683 25.348 76.865 76.224 17.114 20.504 21.374 21.925 0.489 0.316
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:25:09 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -5028.9
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -5024.731 25.209 76.303 25.139 76.051 25.674 25.359 76.906 76.276 17.109 20.504 21.365 21.91 0.49 0.314
#> Image 3: running initial ProFound
#> Image 3: running AllStarDoFit
#> Running Found2Fit
#> Running ProFound
#> Running Highander
#> Iteration 1
#> CMA 1: -16091.313 25.154 76.333 24.335 76.259 25.79 25.275 75.702 77.222 16.672 20.401 20.694 24.264 0.311 0.224
#>
#> Laplace's Demon was called on Thu Feb 18 16:25:17 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -7430.8
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -7426.247 25.16 76.171 25.004 76.071 25.79 25.493 76.016 77.722 16.676 19.337 19.998 21.245 0.333 0.233
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:25:24 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -7413.9
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -7413.098 25.159 76.188 25.011 76.123 25.789 25.492 76.003 77.703 16.679 19.34 20.01 21.278 0.335 0.238
#> Image 4: running initial ProFound
#> Image 4: running AllStarDoFit
#> Running Found2Fit
#> Running ProFound
#> Running Highander
#> Iteration 1
#> CMA 1: -5141.963 25.156 76.016 25.752 77.086 25.622 25.077 77.235 77.29 16.519 18.985 20.503 21.13 0.373 0.229
#>
#> Laplace's Demon was called on Thu Feb 18 16:25:32 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -4343.8
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -4341.125 25.148 76.285 25.599 76.581 25.662 25.185 76.923 76.072 16.541 18.923 20.297 20.965 0.351 0.236
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:25:39 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -4345.7
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -4340.448 25.146 76.275 25.589 76.557 25.664 25.19 76.964 76.073 16.536 18.91 20.276 20.97 0.352 0.236
#> Image 5: running initial ProFound
#> Image 5: running AllStarDoFit
#> Running Found2Fit
#> Running ProFound
#> Running Highander
#> Iteration 1
#> CMA 1: -10488.715 25.247 76.589 26.673 77.953 25.504 25.292 77.634 77.076 16.491 18.582 20.045 20.534 0.488 0.252
#>
#> Laplace's Demon was called on Thu Feb 18 16:25:47 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -7184.6
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -7182.461 25.247 76.248 25.566 76.597 25.522 25.261 76.776 75.982 16.487 18.671 19.726 20.311 0.488 0.264
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:25:54 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -7187.9
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -7181.076 25.244 76.238 25.557 76.643 25.526 25.273 76.822 75.994 16.489 18.672 19.726 20.308 0.488 0.264
#> Image 6: running initial ProFound
#> Image 6: running AllStarDoFit
#> Running Found2Fit
#> Running ProFound
#> Running Highander
#> Iteration 1
#> CMA 1: -5928.498 25.242 75.863 26.317 76.549 25.572 24.689 76.897 77.217 16.449 18.399 18.295 19.229 0.503 0.275
#>
#> Laplace's Demon was called on Thu Feb 18 16:26:02 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -5193.9
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -5192.144 25.163 76.084 25.954 76.483 25.586 24.416 76.873 76.788 16.45 18.467 18.325 19.327 0.504 0.287
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:26:08 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -5199.1
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -5191.712 25.164 76.084 25.955 76.483 25.585 24.437 76.875 76.788 16.451 18.467 18.325 19.328 0.505 0.287
#> Image 7: running initial ProFound
#> Image 7: running AllStarDoFit
#> Running Found2Fit
#> Running ProFound
#> Running Highander
#> Iteration 1
#> CMA 1: -5847.155 25.193 76.421 25.071 77.007 25.606 24.476 77.716 76.741 16.565 19.725 20.419 21.148 0.495 0.275
#>
#> Laplace's Demon was called on Thu Feb 18 16:26:17 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -4142.3
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -4132.159 25.182 76.52 24.465 76.15 25.59 25.739 76.019 76.887 16.592 19.234 19.781 20.282 0.502 0.29
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:26:23 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -4134
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -4131.132 25.179 76.536 24.464 76.234 25.59 25.734 75.991 76.901 16.584 19.203 19.771 20.345 0.5 0.286
#> Image 8: running initial ProFound
#> Image 8: running AllStarDoFit
#> Running Found2Fit
#> Running ProFound
#> Running Highander
#> Iteration 1
#> CMA 1: -5866.847 25.878 76.219 25.23 75.901 25.642 25.632 77.268 76.369 16.534 16.8 18.323 18.914 0.52 0.398
#>
#> Laplace's Demon was called on Thu Feb 18 16:26:31 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -5444.7
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -5443.426 25.888 76.152 24.784 75.995 25.634 25.588 76.835 76.488 16.524 16.755 18.158 18.714 0.494 0.355
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:26:37 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -5443.2
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -5440.256 25.894 76.157 24.813 75.973 25.635 25.594 76.833 76.523 16.52 16.769 18.182 18.725 0.494 0.355
#> Image 9: running initial ProFound
#> Image 9: running AllStarDoFit
#> Running Found2Fit
#> Running ProFound
#> Running Highander
#> Iteration 1
#> CMA 1: -1613.465 25.134 76.404 25.793 75.817 25.57 25.601 76.457 77.029 17.178 19.444 19.61 19.92 0.498 0.449
#>
#> Laplace's Demon was called on Thu Feb 18 16:26:45 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -1497
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -1488.137 25.12 76.261 26.021 76.446 25.621 25.721 76.144 76.193 17.159 19.448 19.636 19.681 0.502 0.434
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:26:50 2021
#>
#> Performing initial checks...
#> WARNING: Matrix mask may be rank-deficient.
#> WARNING: Matrix sigma may be rank-deficient.
#> WARNING: Matrix segim may be rank-deficient.
#> WARNING: Matrix region may be rank-deficient.
#> WARNING: Matrix calcregion may be rank-deficient.
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -1494.1
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -1487.2 25.119 76.241 25.891 76.387 25.603 25.763 76.124 76.204 17.155 19.42 19.61 19.711 0.499 0.422
#> WARNING: psf output image contains more than 99.9% of the total model flux! Consider decreasing the size of psf_dim.
#> Making image stack
#> Running ProFound on stack
#> Running Found2Fit on stack
#> Running ProFound
#> Image 1: running SetupData
#> Image 2: running SetupData
#> Image 3: running SetupData
#> Image 4: running SetupData
#> Image 5: running SetupData
#> Image 6: running SetupData
#> Image 7: running SetupData
#> Image 8: running SetupData
#> Image 9: running SetupData
#> Running Highander on multi-band data
#> Iteration 1
#> CMA 1: -164414.648 308.448 299.19 1.776 107.445 -0.297 18.978 17.782 1.933 16.006 18.968 2.472 16.765 14.976 1.597 17.77 16.553 0.974 14.778 19.372 1.434 17.848 15.987 1.286 14.8 13.117 1.116 15.637 16.003 1.949 17.431 18.202 1.527
#>
#> Laplace's Demon was called on Thu Feb 18 16:34:25 2021
#>
#> Performing initial checks...
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -159519.5
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 1: -159519.123 308.808 298.996 1.715 104.425 -0.245 22.248 17.777 1.485 16.964 19.198 2.292 17.354 14.598 1.439 18.073 16.055 0.876 14.506 19.227 1.515 17.735 15.63 1.339 14.613 13.402 1.428 15.275 16.232 1.964 17.016 19.158 1.311
#> Iteration 2
#>
#> Laplace's Demon was called on Thu Feb 18 16:57:17 2021
#>
#> Performing initial checks...
#> Algorithm: Componentwise Hit-And-Run Metropolis
#>
#> Laplace's Demon is beginning to update...
#> Iteration: 100, Proposal: Componentwise, LP: -158873.2
#>
#> Assessing Stationarity
#> Assessing Thinning and ESS
#> Creating Summaries
#> Creating Output
#>
#> Laplace's Demon has finished.
#> LD Mode 2: -158862.644 308.803 298.982 1.669 101.548 -0.242 24.797 17.754 1.491 17.091 19.207 2.239 17.163 14.429 1.391 17.89 15.958 0.861 14.294 19.065 1.51 18.123 15.756 1.405 15.311 13.665 1.577 15.915 16.085 2 16.988 18.704 1.099
We can check the transition from disk to bulge dominated galaxy light as we move from bluer to redder bands:
= MultiFit$parm_smooth[grep('mag1',names(MultiFit$parm_smooth))]
bulge_mag = MultiFit$parm_smooth[grep('mag2',names(MultiFit$parm_smooth))]
disk_mag
magplot(wave, bulge_mag, ylim=c(19,15.5), type='l', col='red', log='x', xlab='Wave / Ang', ylab='Mag')
lines(wave, disk_mag, col='blue')
legend('bottomright', legend=c('bulge', 'disk'), lty=1, col=c('red','blue'))
It is often instructive to show the above as the evolution of B/T (bulge flux divided by total flux):
magplot(wave,10^(-0.4*bulge_mag) / (10^(-0.4*bulge_mag) + 10^(-0.4*disk_mag)), ylim=c(0,1), type='l', log='x', xlab='Wave / Ang', ylab='B/T')
abline(h=0.5, lty=2)
We can also compare the disk Re to the bulge. We can see that the disk Re drops as a function of wavelength:
magplot(wave,10^MultiFit$parm_smooth[grep('re2',names(MultiFit$parm_smooth))], ylim=c(0,80), type='l', col='blue', log='x', xlab='Wave / Ang', ylab='Re / px')
abline(h=10^MultiFit$parm_smooth["sersic.re1"], col='red')
legend('bottomright', legend=c('bulge', 'disk'), lty=1, col=c('red','blue'))
We can also view all of the individual per-band fits (order blue-red ugriZYJHKs):
profitLikeModel(MultiFit$parm, MultiFit$Data_list, makeplots=TRUE) #use MultiFit$parm, since profitLikeModel applies the smoothing
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -3.76577 -0.67860 0.04175 0.03805 0.73363 5.38739
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.057969 1.045375 1.050426 2.090296
#> [1] "Using 10540 out of 10540"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -5.42286 -0.88640 -0.03104 0.01997 0.85338 6.35986
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.423013 1.295433 1.324464 2.969307
#> [1] "Using 10540 out of 10540"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -5.96513 -0.89364 0.01203 0.14184 1.01624 10.15233
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.684519 1.411055 1.480497 3.596664
#> [1] "Using 10540 out of 10540"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -4.0336 -0.5625 0.1746 0.1696 0.9060 5.4915
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.121363 1.086873 1.094160 2.274831
#> [1] "Using 10540 out of 10540"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -5.832764 -0.822748 0.005791 0.019119 0.850383 6.061163
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.401759 1.237067 1.291818 2.974153
#> [1] "Using 10540 out of 10540"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -4.0274 -0.6052 0.1485 0.1275 0.8330 4.7289
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.110616 1.060033 1.074685 2.243988
#> [1] "Using 10540 out of 10540"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -5.00356 -0.70446 -0.02264 -0.04371 0.64284 4.35357
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.0419988 0.9946067 1.0080975 2.1075444
#> [1] "Using 10540 out of 10540"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -3.8730 -0.5716 0.1505 0.1107 0.7994 3.7157
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 1.002470 1.008706 0.990810 1.987718
#> [1] "Using 10540 out of 10540"
#> [1] "Summary of used sample:"
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -4.40412 -0.62460 0.06913 0.02493 0.72286 3.19617
#> [1] "sd / MAD / 1-sig / 2-sig range:"
#> [1] 0.9972635 0.9964080 0.9913000 2.0081810
#> [1] "Using 10540 out of 10540"
#> $LP
#> [1] -158862.6
#>
#> $Dev
#> [1] 317725.3
#>
#> $Monitor
#> LL LP tend.elapsed
#> -158862.64 -158862.64 32478.53
#>
#> $yhat
#> [1] 1
#>
#> $parm
#> sersic.xcen1 sersic.ycen1 sersic.re1 sersic.ang2 sersic.axrat2
#> 308.8031777 298.9819507 1.6694418 101.5478080 -0.2423113
#> sersic.mag1_1 sersic.mag2_1 sersic.re2_1 sersic.mag1_2 sersic.mag2_2
#> 24.7966539 17.7544717 1.4905343 17.0912463 19.2074471
#> sersic.re2_2 sersic.mag1_3 sersic.mag2_3 sersic.re2_3 sersic.mag1_4
#> 2.2386010 17.1627621 14.4288023 1.3911011 17.8897481
#> sersic.mag2_4 sersic.re2_4 sersic.mag1_5 sersic.mag2_5 sersic.re2_5
#> 15.9582730 0.8607340 14.2936175 19.0652632 1.5097627
#> sersic.mag1_6 sersic.mag2_6 sersic.re2_6 sersic.mag1_7 sersic.mag2_7
#> 18.1231685 15.7555510 1.4053709 15.3105831 13.6651814
#> sersic.re2_7 sersic.mag1_8 sersic.mag2_8 sersic.re2_8 sersic.mag1_9
#> 1.5769534 15.9145488 16.0846178 2.0004313 16.9884940
#> sersic.mag2_9 sersic.re2_9
#> 18.7040904 1.0993530