%APN3_PROCEEDINGS_FORM%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% TEMPLATE.TEX -- APN3 (2003) ASP Conference Proceedings template.
%
% Derived from ADASS VIII (98) ASP Conference Proceedings template
% Updated by N. Manset for ADASS IX (99), F. Primini for ADASS 2000,
% D.Bohlender for ADASS 2001, and H. Payne for ADASS XII and LaTeX2e.
%
% Use this template to create your proceedings paper in LaTeX format
% by following the instructions given below.  Much of the input will
% be enclosed by braces (i.e., { }).  The percent sign, "%", denotes
% the start of a comment; text after it will be ignored by LaTeX.  
% You might also notice in some of the examples below the use of "\ "
% after a period; this prevents LaTeX from interpreting the period as
% the end of a sentence and putting extra space after it.  
% 
% You should check your paper by processing it with LaTeX.  For
% details about how to run LaTeX as well as how to print out the User
% Guide, consult the README file.  You should also consult the sample
% LaTeX papers, sample1.tex and sample2.tex, for examples of including
% figures, html links, special symbols, and other advanced features.
%
% If you do not have access to the LaTeX software or a laser printer
% at your site, you can still prepare your paper following the
% instructions in the User Guide.  In such cases, the editors will
% process the file and make any necessary editorial adjustments.
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
\documentclass[11pt,twoside]{article}  % Leave intact
\usepackage{adassconf}

% If you have the old LaTeX 2.09, and not the current LaTeX2e, comment
% out the \documentclass and \usepackage lines above and uncomment
% the following:

\begin{document}   % Leave intact

%-----------------------------------------------------------------------
%			    Paper ID Code
%-----------------------------------------------------------------------
% Enter the proper paper identification code.  The ID code for your
% paper is the session number associated with your presentation as
% published in the official conference proceedings.  You can           
% find this number locating your abstract in the printed proceedings
% that you received at the meeting or on-line at the conference web
% site; the ID code is the letter/number sequence proceeding the title 
% of your presentation. 
%
% This will not appear in your paper; however, it allows different
% papers in the proceedings to cross-reference each other.  Note that
% you should only have one \paperID, and it should not include a
% trailing period.
%
% EXAMPLE: \paperID{O4-1}
% EXAMPLE: \paperID{P7-7}
%

\paperID{P7-2}
%%%% ID=P7-2

%-----------------------------------------------------------------------
%		            Paper Title 
%-----------------------------------------------------------------------
% Enter the title of the paper.
%
% EXAMPLE: \title{A Breakthrough in Astronomical Software Development}
% 
% If your title is so long as to fill the page header when you print it,
% then please supply a short form as a \titlemark.
%
% EXAMPLE: 
%  \title{Rapid Development for Distributed Computing, with Implications
%         for the Virtual Observatory}
%  \titlemark{Rapid Development for Distributed Computing}
%

\title{Boxiness estimation method with fourth order moments}
%\titlemark{ }

%-----------------------------------------------------------------------
%		          Authors of Paper
%-----------------------------------------------------------------------
% Enter the authors followed by their affiliations.  The \author and
% \affil commands may appear multiple times as necessary (see example
% below).  List each author by giving the first name or initials first
% followed by the last name.  Authors with the same affiliations
% should grouped together. 
%
% EXAMPLE: \author{Raymond Plante, Doug Roberts, 
%                  R.\ M.\ Crutcher\altaffilmark{1}}
%          \affil{National Center for Supercomputing Applications, 
%                 University of Illinois Urbana-Champaign, Urbana, IL
%                 61801}
%          \author{Tom Troland}
%          \affil{University of Kentucky}
%
%          \altaffiltext{1}{Astronomy Department, UIUC}
%
% In this example, the first three authors, "Plante", "Roberts", and
% "Crutcher" are affiliated with "NCSA".  "Crutcher" has an alternate 
% affiliation with the "Astronomy Department".  The fourth author,
% "Troland", is affiliated with "University of Kentucky"

\author{Masafumi Yagi}
\affil{National Astronomical Observatory of Japan,
Mitaka, Tokyo, 181-8588, Japan}

%-----------------------------------------------------------------------
%			 Contact Information
%-----------------------------------------------------------------------
% This information will not appear in the paper but will be used by
% the editors in case you need to be contacted concerning your
% submission.  Enter your name as the contact along with your email
% address.
% 
% EXAMPLE:  \contact{Dennis Crabtree}
%           \email{crabtree@cfht.hawaii.edu}
%

\contact{Masafumi Yagi}
\email{yagi@optik.mtk.nao.ac.jp}

%-----------------------------------------------------------------------
%		      Author Index Specification
%-----------------------------------------------------------------------
% Specify how each author name should appear in the author index.  The 
% \paindex{ } should be used to indicate the primary author, and the
% \aindex for all other co-authors.  You MUST use the following
% syntax: 
%
% SYNTAX:  \aindex{Lastname, F. M.}
% 
% where F is the first initial and M is the second initial (if
% used).  This guarantees that authors that appear in multiple papers
% will appear only once in the author index.  
%
% EXAMPLE: \paindex{Crabtree, D.}
%          \aindex{Manset, N.}        
%          \aindex{Veillet, C.}        
%
% NOTE: this information is also used to build the author list that
% appears in the table of contents.  Authors will be listed in the order
% of the \paindex and \aindex commmands.
%

\paindex{Yagi, M.}
%\aindex{ }     % Remove this line if there is only one author

%-----------------------------------------------------------------------
%		      Author list for page header	
%-----------------------------------------------------------------------
% Please supply a list of author last names for the page header. in
% one of these formats:
%
% EXAMPLES:
% \authormark{Lastname}
% \authormark{Lastname1 \& Lastname2}
% \authormark{Lastname1, Lastname2, ... \& LastnameN}
% \authormark{Lastname et al.}
%
% Use the "et al." form in the case of seven or more authors, or if
% the preferred form is too long to fit in the header.

\authormark{Yagi}

%-----------------------------------------------------------------------
%			Subject Index keywords
%-----------------------------------------------------------------------
% Enter a comma separated list of up to 6 keywords describing your
% paper.  These will NOT be printed as part of your paper; however,
% they will be used to generate the subject index for the proceedings.
% There is no standard list; however, you can consult the indices
% for past proceedings (http://adass.org/adass/proceedings/).
%
% EXAMPLE:  \keywords{visualization, astronomy: radio, parallel
%                     computing, AIPS++, Galactic Center}
%
% In this example, the author noticed that "radio astronomy" appeared
% in the ADASS VII Index as "astronomy" being the major keyword and
% "radio" as the minor keyword.  The colon is used to introduce another
% level into the index.

\keywords{}

%-----------------------------------------------------------------------
%			       Abstract
%-----------------------------------------------------------------------
% Type abstract in the space below.  Consult the User Guide and Latex
% Information file for a list of supported macros (e.g. for typesetting 
% special symbols). Do not leave a blank line between \begin{abstract} 
% and the start of your text.

\begin{abstract}          % Leave intact
% Place the text of your abstract here - NO BLANK LINES
I present a method to estimate fourth order cosine 
coefficient of Fourier harmonics, so called boxiness,
from second and fourth order moments in Cartesian coordinate.
The method is faster than traditional fitting method 
about by order and have enough accuracy for $r>10 pix$ objects.
\end{abstract}

%-----------------------------------------------------------------------
%			      Main Body
%-----------------------------------------------------------------------
% Place the text for the main body of the paper here.  You should use
% the \section command to label the various sections; use of
% \subsection is optional.  Significant words in section titles should
% be capitalized.  Sections and subsections will be numbered
% automatically. 
%
% EXAMPLE:  \section{Introduction}
%           ...
%           \subsection{Our View of the World}
%           ...
%           \section{A New Approach}
%
% It is recommended that you look at the sample papers, sample1.tex
% and sample2.tex, for examples for formatting references, footnotes,
% figures, equations, html links, lists, and other special features.  

\section{Introduction} 

Boxiness, the fourth order cosine coefficient of Fourier harmonics, 
is known to be an important photometric parameters 
in study of early type galaxies (e.g. Kormendy \& Djorgovski 1989)
The boxiness parameter is, however, not measured 
in recent huge survey data. 
One of the reason would be the fact that standard boxiness measurement 
process is complicated and takes time; fit ellipse, take residual, 
iterate if needed, and fit trigonometric functions.
Another reason could be that fitting method is usually not full-automatic,
and requires manual interactive operation, which disables us 
from constructing pipeline analysis.

About 2nd-order Fourier components, such as major/minor axis,
many surface photometry packages estimate the parameters from
2nd-order Cartesian moments (e.g. Stobie 1980), and
therefore automatic measurement is implemented.
Extending the idea, I developed a procedure to estimate 
the boxiness from 2nd and 4th order non-weighted Cartesian moments.

\section{Method}

In this study, I follow the formalization of 
the general ellipse by Stobie (1980);
setting original coordinate as (x,y),
and coordinate along the major and minor axis of
the best fit ellipse as (X,Y),
\begin{eqnarray}
X &=& x cos(\phi) - y sin(\phi) - x0 \\
Y &=& x sin(\phi) + y cos(\phi) - y0,
\end{eqnarray}
where x0, and y0 are the center of the image, 
and $\phi$ is the rotation angle.
The shape of isophote is then supposed to be 
expanded with Fourier components as
\begin{equation}
{X^2}+\frac{Y^2}{Q^2} \leq a^2(1+ \sum{c_n cos n(\theta+\omega_n)})^2,
\end{equation}
where $\theta=tan^{-1}((Y/b)/(X/a))$, $a$ and $b$ are semi-major axis and
semi-minor axis, and $Q$ is the axis ratio ($Q=b/a$).
With this notation, $a_4=c_4 cos 4\omega_4$ is the boxiness-parameter. 
It corresponds to $B_4/r$ in Carter (1978),
$a(4)/a \sqrt{Q}$ in Bender et al. (1988),
and $c_4$ in  Milvang-Jensen \& J\o rgensen (1999).
If $a_4$ is positive, the isophote is disky, and
if $a_4$ is negative, the isophote is boxy.
I neglect 3rd and higher than 4th order components for simplicity,
for they are not dominant terms in elliptical galaxies.
The isophote shape is thus written as
\begin{equation}
\label{P7.2-eqn.shape}
{X^2}+\frac{Y^2}{Q^2} \leq a^2(1+ c_4 cos 4(\theta+\omega_4))^2
\end{equation}

I define a moment of a shape as non-weighted,
$<z> = {\int z dA}/{\int dA}$.
With such moment, estimated major/minor axis can be written as 
\begin{eqnarray}
a_0&=&\sqrt{2(p+q)} \nonumber \\
b_0&=&\sqrt{2(p-q)},  \nonumber 
\end{eqnarray}
where p and q are Stokes parameters,
\begin{eqnarray}
p&\equiv&<x^2>+<y^2> \nonumber \\
q^2&\equiv&(<x^2>-<y^2>)^2+4<xy>^2
\end{eqnarray} (Stobie 1980).
It should be noted that p and q are rotation invariant
combination of moments. 
Such rotation invariant combination is
obtained by integrating $r (cos^2 n\theta + sin^2 n\theta)$.
As the boxiness is also rotation invariant,
it is supposed to be estimated from such combinations.
For fourth order case, rotation invariant combinations are
\begin{eqnarray}
p_4&\equiv& <x^4>+2<x^2y^2>+<y^4> \nonumber \\
q_4^2&\equiv& (<x^4>+<y^4>-6<x^2y^2>)^2+16(<x^3y>-<xy^3>)^2.
\end{eqnarray}

As $a_4$ is usually less than 10\% (e.g. Bender et al. 1988), 
one can neglect $c_4^2$ and approximate as $1+O(c_4^2) \sim 1$.
With this approximation, $p_4$ of Eqn. (\ref{P7.2-eqn.shape}) is written as
\begin{eqnarray}
p_4&=&<x^4>+2<x^2y^2>+<y^4> \nonumber \\
&\sim&\frac{\pi Q a_0^6}{8 A} \times \nonumber \\
\label{P7.2-eqn.est}
&& \left(( 1 + Q^4 + 2/3 Q^2) + a_4 (1+Q^4-2 Q^2) \right) ,
\end{eqnarray}
where A is the total area of the isophote.
We can easily solve equation to estimate $a_4$ as a
function of $p_4, Q, a_0$, and $A$, 
\begin{equation}
a_4 \sim \frac{1}{(1-Q^2)^2} (\frac{8 A p_4}{Q \pi a_0^6} - a_0^4(1 + Q^4 + 2/3 Q^2)).
\end{equation}

\section{Implementation and Simulation}

The Eqn. \ref{P7.2-eqn.est} is implemented in standard C
as a code for measuring boxiness profile, $a_4(r)$.
Rapid flooding method (Treuenfels 1994) is adopted
for extracting isophotal shape profile.
And in moment calculation, ``single visit with 
temporal mean method'' is adopted, which uses recurrence formulae;
$<x_n^m>=f(x_n, <x_{n-1}>, <x_{n-1}^2>, ... <x_{n-1}^m>)$.
As rapid flooding method visit once for each pixel, 
and single visit with temporal mean method can 
calculate moment by the single visit, 
the combination succeeds in quick boxiness estimation.
For boxiness estimation only, the code is 
about 20 times faster than IRAF/STSDAS 
ellipse task (Busko 1996) tested on Solaris/SPARC 
architecture.

The error is estimated by applying the code to simulated images.
For large ($r=400$) images, 
relative error of $a_4$ is always less than 10\%,
with no systematic error with rotation angle.
All except rounder (Q=0.9) image have 
absolute error less than 0.001.
For smaller images, error correlates with $r=\sqrt{ab}=a\sqrt{Q}$.
Error is smaller than 0.005(rms) for $r>15$ pix,
and smaller than 0.01(rms) for $r>10$ pix.

\section{Result and Future Plans}

The implementation is applied to real image of
23 E/S0 galaxies taken from Frei (1996) R-band data.
Our result is consistent with other studies 
within relative error of 10\% or absolute error of 0.01. 
The accuracy is as expected from model analysis,
and enough for boxy/disky discrimination.
Figure 1 shows an example of the result.
Some inconsistency is found around log(a)$\sim$1.8,
where star debris is seen in the image.
It could be the difference of the image quality,
preprocessing of the image, or post-processing of 
the boxiness profile. 

As a next step, I plan to investigate
flux-weighted moments, preprocessing (e.g. Unsharpmasking) of images,
and interpolation of internal parts or interpolation of moments 
at small radii. 

\begin{figure}
\epsscale{0.8}
\plotone{P7-2_f1.eps}
\caption{
An example of boxiness estimation.
Comparison of boxiness profiles. 
Our estimation is shown as black dots.
Measurement with IRAF/STSDAS/ellipse (Busko 1996) is shown 
as cross with error bars. 
Other symbols are taken from literatures.
Open circles, open squares, and open stars represent
measurement by Jedrzejewski (1987), 
Peletier et al. (1990), and
Michard \& Marchal (1994), respectively.
}\label{P7.2-fig-1}
\end{figure}

\begin{figure}
\epsscale{0.6}
\plotone{P7-2_f2.eps}
\caption{
R-band image of NGC 3377 from Frei (1996),
The debris of star removal 
affect the boxiness at log(a)$\sim$1.8 in Fig \ref{P7.2-fig-1}.
}\label{P7.2-fig-2}
\end{figure}

%-----------------------------------------------------------------------
%			      References
%-----------------------------------------------------------------------
% List your references below within the reference environment
% (i.e. between the \begin{references} and \end{references} tags).
% Each new reference should begin with a \reference command which sets
% up the proper indentation.  Observe the following order when listing
% bibliographical information for each reference:  author name(s),
% publication year, journal name, volume, and page number for
% articles.  Note that many journal names are available as macros; see
% the User Guide listing "macro-ized" journals.   
%
% EXAMPLE:  \reference Hagiwara, K., \& Zeppenfeld, D.\  1986, 
%                Nucl.Phys., 274, 1
%           \reference H\'enon, M.\  1961, Ann.d'Ap., 24, 369
%           \reference King, I.\ R.\  1966, \aj, 71, 276
%           \reference King, I.\ R.\  1975, in Dynamics of Stellar 
%                Systems, ed.\ A.\ Hayli (Dordrecht: Reidel), 99
%           \reference Tody, D.\  1998, \adassvii, 146
%           \reference Zacharias, N.\ \& Zacharias, M.\ 2003,
%                \adassxii, \paperref{P7.6}
% 
% Note the following tricks used in the example above:
%
%   o  \& is used to format an ampersand symbol (&).
%   o  \'e puts an accent agu over the letter e.  See the User Guide
%      and the sample files for details on formatting special
%      characters.  
%   o  "\ " after a period prevents LaTeX from interpreting the period 
%      as an end of a sentence.
%   o  \aj is a macro that expands to "Astron. J."  See the User Guide
%      for a full list of journal macros
%   o  \adassvii is a macro that expands to the full title, editor,
%      and publishing information for the ADASS VII conference
%      proceedings.  Such macros are defined for ADASS conferences I
%      through XI.
%   o  When referencing a paper in the current volume, use the
%      \adassxii and \paperref macros.  The argument to \paperref is
%      the paper ID code for the paper you are referencing.  See the 
%      note in the "Paper ID Code" section above for details on how to 
%      determine the paper ID code for the paper you reference.  
%
\begin{references}

\reference Bender, R., D\"obereiner, S.\ \& M\"ollenhoff, C.\ 1988, \aaps, 74, 385 
\reference Busko, I. \ 1996, \adassv, 139
\reference Frei, Z., Guhathakurta, P., Gunn, J.\ E.\ \& Tyson, J.\ A.\ 1996,  \aj, 111, 174 
\reference Jedrzejewski, R.\ I.\ 1987, \mnras, 226, 747
\reference Kormendy, J.\ \& Djorgovski, S.\ 1989,  \araa, 27 235 
\reference Milvang-Jensen, B.\ \& J\o rgensen, I.\ 1999, BaltA, 8, 535
\reference Michard, R.\ \& Marchal, J.\ 1994, \aaps, 105, 481
\reference Peletier, R.\ F., Davies, R.\ L., Illingworth, G.\ D., Davies, L.\ E.\ \& Cawson, M.\ 1990, \aj, 100, 1091
\reference Stobie, R.\ S.\ 1980, JBIS, 33, 323
\reference Treuenfels, A.\ 1994, C Users Journal, 12, 8, 39 

\end{references}
% Do not place any material after the references section
\end{document}  % Leave intact
