Part I: establishing masks/centers/etc
Part II: fitting/subtracting galaxy methods
    a) Using whole image but centering/fitting on one with the other masked
    b) Slicing image in half, fitting halves and re-combining fits
    c) Fitting central regions and extrapolating fits to subtract fringes

(All of this is in the folder ~/Virgo/m84m86/2c/ )

So, we're trying to extrapolate here... and bmodel is insufficient, so we have a new approach...
We use the ellipse fits for inner regions of the galaxies, but use artdata/mkobjects simulations for outer regions, set up so they match at the transition.


The file ee.cl has EVERY iraf command used to do all of this. The only files used from previous versions were the mask files used to fit the original galaxies. Wow!
[If you open up iraf and type cl < ee.cl then every graph and result you see below will be generated fresh.]

Seams
M84 is seamed at SMA=104 pixels, and also expanded at SMA=150 pixels.
M86 is seamed at SMA = 104 pixels, and also expanded at SMA = 310 pixels. [note different ellipticity here, too - normal is 0.3, expanded is 0.4]

(Note the slight cleverness in the choice on the M84-expansion, excluding the bright star)


Fits of real galaxies
Since these are the same as described on the previous page, here are the results from before:
M84 [Mfind2.dat - Mfind2.ps.gif]
M86 [Mfind1.dat - Mfind1.ps.gif]


N.B. - These fits are clipped at the seaming radius, as mentioned, when they are used. The above graphs are the FULL fits, whereas neither of the seams uses all of the data shown.


Extrapolate galaxies
Using the parameters from the last isophote (aka, at the seam), we generate simulated galaxies with artdata.
These are then fitted with ellipse (using the inputted parameters) and surface brightness as a function of r^0.25 is graphed.
The magnitude and (halfflux) radius are adjusted until the profiles match at the seam point (indicated with the vertical line)

M84
zoom in on last 5 points


M86 zoom in on last 5 points



Final models
Using the real galaxy fits for the centers, and the extrapolations outside them, we generate final models for M84 and M86, and subtract them from the original image:
[Msubtract.fits]                                                                                                            binned with rmed i=2, o=5 [Msubtract25.fits]
    

And closer up:






If we do this with the UN-expanded galaxies, the results aren't as cool. It's easy to do that if you go through and un-comment/comment the appropriate lines in ee.cl - what a nice program!



full text of ee.cl at the time these graphs/images were created [1/9/2007 - 6pm]

#collection of commands to fit inner regions, extrapolate outer regions,
#  generate combined inner/outer models, and subtract these off

#load packages
stsdas
isophote
noao
artdata


#fit the individual galaxies
#M84:
!rm Mfind2.dat
!rm Mfind2.?.dat
!rm M.pl
!cp Mfind2.pl M.pl
#ellipse input=M.fit output=Mfind2.dat x0=1385 y0=996 ellip0=0.05 pa0=-55 sma0=50 minsma=0 maxsma=104 step=0.2 recente=yes hcenter=no hellip=no hpa=no
#expanded:
ellipse input=M.fit output=Mfind2.dat x0=1385 y0=996 ellip0=0.05 pa0=-55 sma0=50 minsma=0 maxsma=150 step=0.2 recente=yes hcenter=no hellip=no hpa=no


#binary-->ascii:
tdump Mfind2.dat cdfile = Mfind2.c.dat pfile = Mfind2.h.dat datafil = Mfind2.d.dat

#change INDEF --> -9999
#cl < sed2.cl
!sm -m sed.sm Mfind2 quit

#graphe.sm:
!sm -m graphe.sm Mfind2 1 Mfind2.d.dat quit

#model it
imdel Mfind2.fits
#bmodel table=Mfind2.dat output=Mfind2.fits parent=M.fits fulltab=no minsma=0 maxsma=104
#expanded
bmodel table=Mfind2.dat output=Mfind2.fits parent=M.fits fulltab=no minsma=0 maxsma=150



#M86:
!rm Mfind1.dat
!rm Mfind1.?.dat
!rm M.pl
!cp Mfind1.pl M.pl
#ellipse input=M.fit output=Mfind1.dat x0=690 y0=1145 ellip0=0.05 pa0=-50 sma0=50 minsma=0 maxsma=104 recente=yes hcenter=no hellip=no hpa=no
#expanded:
ellipse input=M.fit output=Mfind1.dat x0=690 y0=1145 ellip0=0.05 pa0=-50 sma0=50 minsma=0 maxsma=310 recente=yes hcenter=no hellip=no hpa=no

#binary-->ascii:
tdump Mfind1.dat cdfile = Mfind1.c.dat pfile = Mfind1.h.dat datafil = Mfind1.d.dat

#change INDEF --> -9999
!sm -m sed.sm Mfind1 quit

#graphe.sm:
!sm -m graphe.sm Mfind1 1 Mfind1.d.dat quit

#model it
imdel Mfind1.fits
#bmodel table=Mfind1.dat output=Mfind1.fits parent=M.fits fulltab=no minsma=0 maxsma=104
#expanded:
bmodel table=Mfind1.dat output=Mfind1.fits parent=M.fits fulltab=no minsma=0 maxsma=310



# re-model with artdata and Corrected Magnitude
#get param file --> egal.dat
#M84:
#!sm -m ee.sm params Mfind2.d.dat egal2.dat 1.35 60 quit
#expanded
!sm -m ee.sm params Mfind2.d.dat egal2.dat 1.45 100 quit


#make the object!
#M84:
imdel model2.fits
mkobject input=model2.fits output=model2.fits ncols=2001 nlines=2001 header=artdata$stdheader.dat backgro=0 objects=egal2.dat xoffset=0 yoffset=0 star=moffat radius=1 beta=2.5 ar=1 pa=0 distanc=1 exptime=1 magzero=1 gain=1 rdnoise=0 poisson=no seed=1

#run ellipse on model#.fits
#M84:
!rm model2.dat
#ellipse input=model2.fits output=model2.dat x0=1385 y0=996 ellip0=0.05 pa0=-25 sma0=50 minsma=0 maxsma=1000 recente=no hcenter=yes hellip=yes hpa=yes
#expanded
ellipse input=model2.fits output=model2.dat x0=1385 y0=996 ellip0=0.05 pa0=13.0 sma0=50 minsma=0 maxsma=1000 recente=no hcenter=yes hellip=yes hpa=yes

#binary-->ascii:
#M84:
!rm model2.?.dat
tdump model2.dat cdfile = model2.c.dat pfile = model2.h.dat datafil = model2.d.dat
!sm -m sed.sm model2 quit

#graphe.sm:
#M84:
!rm model2.ps
!rm model2.ps.gif
!sm -m graphe.sm model2 1 model2.d.dat quit

#check offset/seam:
# program: realdata modeldata outputpicture num2match version/type
#!sm -m fitfit.sm Mfind2.d.dat model2.d.dat M84realmod 4 0 quit
#expanded
!sm -m fitfit.sm Mfind2.d.dat model2.d.dat M84realmod 4 2 quit



#M86:
#set up running parameters for artdata:
#       realdata outputfile magoffset (halfflux)radius
#!sm -m ee.sm params Mfind1.d.dat egal1.dat 1.65 100 quit
#expanded:
!sm -m ee.sm params Mfind1.d.dat egal1.dat 0.55 100 quit

imdel model1.fits
mkobject input=model1.fits output=model1.fits ncols=2001 nlines=2001 header=artdata$stdheader.dat backgro=0 objects=egal1.dat xoffset=0 yoffset=0 star=moffat radius=1 beta=2.5 ar=1 pa=0 distanc=1 exptime=1 magzero=1 gain=1 rdnoise=0 poisson=no seed=1

#M86:
!rm model1.dat
#ellipse input=model1.fits output=model1.dat x0=698 y0=1141 ellip0=0.283 pa0=-62.9 sma0=50 minsma=0 maxsma=1000 recente=no hcenter=yes hellip=yes hpa=yes
#expanded:
ellipse input=model1.fits output=model1.dat x0=698 y0=1141 ellip0=0.382 pa0=-53.8 sma0=50 minsma=0 maxsma=1000 recente=no hcenter=yes hellip=yes hpa=yes

#M86:
!rm model1.?.dat
tdump model1.dat cdfile = model1.c.dat pfile = model1.h.dat datafil = model1.d.dat
!sm -m sed.sm model1 quit

#M86:
!rm model1.ps
!rm model1.ps.gif
!sm -m graphe.sm model1 1 model1.d.dat quit

#check offset/seam:
# program: realdata modeldata outputpicture num2match version/type
#!sm -m fitfit.sm Mfind1.d.dat model1.d.dat M86realmod 4 0 quit
#expanded
!sm -m fitfit.sm Mfind1.d.dat model1.d.dat M86realmod 4 1 quit




#CENTERS
#use ellipse fits to generate (with bmodel using ellipse tables) central models
#M84:
imdel inner2.fits
#bmodel table=Mfind2.dat output=inner2.fits parent=M.fits fulltab=no minsma=0 maxsma=104
imcopy Mfind2.fits inner2.fits
#M86:
imdel inner1.fits
#bmodel table=Mfind1.dat output=inner1.fits parent=M.fits fulltab=no minsma=0 maxsma=104
imcopy Mfind1.fits inner1.fits


#combine central regions with big picture (from bmodel)
#M84:
imdel combine2.fits
imexpr expr='(a>0)?a:b' output=combine2.fits a=inner2.fits b=model2.fits
imdel temp2.fits
imarith M.fits - combine2.fits temp2.fits

#M86:
imdel combine1.fits
imexpr expr='(a>0)?a:b' output=combine1.fits a=inner1.fits b=model1.fits
imdel temp1.fits
imarith M.fits - combine1.fits temp1.fits

#combined:
imdel combine.fits
imarith combine1.fits + combine2.fits combine.fits


#perform final subtraction
imdel Msubtract.fits
imarith M.fits - combine.fits Msubtract.fits




--END--


:::: --- ooo \\\             OLDER VERSION            /// ooo --- ::::


Inner: radius 0-100 pixels (0-145") is fit with ellipse, as shown on previous pages:

First: M84:
[Mfind2.dat]

We're basically going to ignore values higher than log(r") ~= 2, for our purposes.

We use artdata/mkobjects with these parameters:
image size: 2001x2001
center: (1385, 996)
PA: -55, but mkobjects will want that as 35, instead (off by 90)
ellipticity: 0.05 [which is converted to axial ratio of 0.95]

We use a devauc profile (of course) with radius set at 70 (half-light radius of M84 in pixels, roughly), and magnitude set at -20. These won't matter much (so long as they're both large enough) since we're going to re-scale the intensities to match the observations (and size is unimportant, just needs to be BIG, as long as it all follows the devauc/r^1/4 law)
[epar artdata   -   make sure dynamic range is reasonable, or else things go ker-flooey]

Next we fit the model with ellipse, using the spacing of radius (SMA) bins as the above fit from M84 (and also fixing the center, ellipticity, and position angle based on the parameters put into the model when it was made):
  



We use a nifty supermongo script called fitfit.sm which reads in data files (*.d.dat from appropriate fits)

  
Real fit is used out to 375" = 259 pixels



Since they're very well matched, we simply subtract! (Don't believe the results at the center - those will be fixed later, and it's not hard.)
[M84ms.fits]                                                                                                                                                         and  smoothing i=5,o=10   [M84ms510.fits]




Now we need to do the same thing for M86....




  M86:
[Mfind1.dat]

We're basically going to ignore values higher than log(r") ~= 2, for our purposes.

We use artdata/mkobjects with these parameters:
image size: 2001x2001
center: (698, 1141)
PA: -55, but mkobjects will want that as 35, instead (off by 90)
ellipticity: 0.25 [which is converted to axial ratio of 0.75]

We use a devauc profile (of course) with radius set at 70 (half-light radius of M86 in pixels, roughly), and magnitude set at -20. These won't matter much (so long as they're both large enough) since we're going to re-scale the intensities to match the observations (and size is unimportant, just needs to be BIG, as long as it all follows the devauc/r^1/4 law)
[epar artdata   -   make sure dynamic range is reasonable, or else things go ker-flooey]

Next we fit the model with ellipse, using the spacing of radius (SMA) bins as the above fit from M86 (and also fixing the center, ellipticity, and position angle based on the parameters put into the model when it was made):
  



We use a nifty supermongo script called fitfit.sm which reads in data files (*.d.dat from appropriate fits)

  
So we're using real data out to 375"



Since they're very well matched, we simply subtract! (Don't believe the results at the center - those will be fixed later, and it's not hard.)
[M86ms.fits]                                                                                                                                                         and  smoothing i=5,o=10   [M86ms510.fits]
    



Now, subtracting both off:
[Mms.fits]                                                                                                                                                        and  smoothing i=5,o=10   [Mms510.fits]
     


Here's some links that'll let you flip back and forth between real, subtracted, and subtracted/binned:

CLICK TO START




Subtract galaxies
Subtract galaxies and bin
[M.fits]






Put galaxies back in
Bin this subtraction
[Mms.fits]






Back to original image
Un-Bin this subtraction
[Mms510.fits]






First attempt to match in the centers:

This needs to be improved:
ellipses that are used to match them together are not the same ellipticity! for a smooth transition that should be the same. duh. keep it at r^(1/4) = 4, though, ~375", as that's where good data ends.