M84 and M86: Close friends?
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

Compare our results to the literature

Want to see simulations/practice? Click here

Here's the image/data we're working with:


Running logr.sm with parameters appropriate for each galaxy, here's a guide to the sizes of them:



And the initial hand mask of big bad stars and galaxies:
[Mhand.pl]


And the Good Old UN-mask: [sure it's crazy, but it works]
[MUN.pl]


This is also broken up into MUN1.pl and MUN2.pl, which are left and right galaxies separately, respectively, and into UN1.pl and UN2.pl, which are the opposites of these masks - only the galaxy centers are masked out in them.

A "harsh" hand mask is made, too:
[Mhandharsh.pl on M.fits]

...which, when mixed with an OBJ mask will get rid of the fringes around other galaxies' edges and such.

To get this harsh mask, first the area was OBJmasked standardly:
[MtestP1.pl on M.fits]

After harshly masking, this mask was improved (and re-run with new BPM) to:
[MtestP2.pl on M.fits]


A central mask was made for each of the galaxies, so that after the UN mask is applied, we can still blot out the nasty stars/etc that often throw off ellipse's fitting.
[MI1.pl on M.fits   &   MI2.pl on M.fits]
     


To find the centers (to use as presets) for each galaxy, we combine masks like this: (200pix wide, each)
First, to find the (M86) left galaxy's center:
 ([MtestP2.pl]                                *  [MUN1.pl]                               )  +   [MI1.pl]                                      =  [Mfind1.pl]
(  *  )  +    = 

Using Mfind1.pl as M.pl for ellipse, we get this fit:
    
For reference, here's the log(r)=1,2,3,... picture of the galaxies:



So for M86, we decide on a center of (698,1141) and position angle of -60 (when applicable)



Doing this same procedure for the M84, we construct the mask Mfind2.pl as follows:
 ([MtestP2.pl]                                *  [MUN2.pl]                               )  +   [MI2.pl]                                      =  [Mfind2.pl]
(  *  )  +    = 

And the ellipse fit is:
    
For reference, here's the log(r)=1,2,3,... picture of the galaxies:


Looking at this fit, the center is (1385, 996) and the PA is about -55, but varies a lot, too.

Soon, we try and fit the actual galaxies using these parameters, collected here for usefulness:
Galaxy:
M1 (M86) M2 (M84)
Center:
(698,1141)
(1385,996)
PA:
-60
-55

Here is also a collection of all masks that will be used in later analysis, for clarity: (300px wide)
[Mhand.pl]
Hand mask for field

[Mhandharsh.pl]
Harsh hand mask for field


[MUN1.pl]
UNmask for M86
[MUN2.pl]
UNmask for M84
[UN1.pl]
Opposite of UNmask for M86


[UN2.pl]
Opposite of UNmask for M84


[MI1.pl]
Inner regions mask for M84
[MI2.pl]
Inner regions mask for M86
[MtestP1.pl]
First generation OBJmask

[MtestP2.pl]
OBJmask with harsh hand mask first (BPM)