<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 98.1p1 release (March 2nd, 1998) originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Averaging and Merging Frames</TITLE> <META NAME="description" CONTENT="Averaging and Merging Frames"> <META NAME="keywords" CONTENT="vol2"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <LINK REL="STYLESHEET" HREF="vol2.css"> <LINK REL="next" HREF="node448.html"> <LINK REL="previous" HREF="node446.html"> <LINK REL="up" HREF="node441.html"> <LINK REL="next" HREF="node448.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html7022" HREF="node448.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="icons.gif/next_motif.gif"></A> <A NAME="tex2html7019" HREF="node441.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="icons.gif/up_motif.gif"></A> <A NAME="tex2html7013" HREF="node446.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="icons.gif/previous_motif.gif"></A> <A NAME="tex2html7021" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="icons.gif/contents_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html7023" HREF="node448.html">Cleaning Images</A> <B> Up:</B> <A NAME="tex2html7020" HREF="node441.html">CCD Detectors</A> <B> Previous:</B> <A NAME="tex2html7014" HREF="node446.html">Bias Corrections</A> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION002516000000000000000"> Averaging and Merging Frames</A> </H2> <P> Three different techniques for averaging have been introduced. The first is a straight forward simple average without regard for statistical weights or possible non-statistical pixel values. The second average takes account of the fact that the images being averaged may have different statistical weights. The difference in statistical weights may arise, since one image may have been exposed through clouds or may have different noise characteristics for some reason or other. The third averaging technique not only takes account of possible different statistical weights and mean values, but also excludes from the resulting average those pixels which differ from the others in a non-statistical way. <P> The average functions mentioned above will normally produce a result frame whose world coordinates are the intersection of the father frames' world coordinates. It is possible to specify that the result be the union of the world coordinates of the father frames. In this case, the average functions will produce merged images. <P> <B>Simple averaging</B> -- This function will take the given frames and produce a simple average of the pixel values. The inputs are either a list of frames names separated by commas, or a catalog reference. In the latter case, all frames in the catalog will be averaged to produce the result. The command is: <BLOCKQUOTE> <TT>AVERAGE/IMAGE OUT = IN_1,IN_2,</TT><IMG WIDTH="31" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" SRC="img938.gif" ALT="$\ldots$"><TT>,IN_n [M] [null] <BR> AVERAGE/IMAGE OUT = catalog.CAT [M] [null]</TT></BLOCKQUOTE>where in the first case, the series of specific input frames will be averaged and in the second case all entries in the specified catalog will be averaged to produce the output frame. The optional parameter <TT>M</TT> determines whether or not the images will be merged in world coordinate space. The optional parameter <TT>null</TT> is used to specify the value that will be used to replace invalid pixels. <P> <B>Weighted averaging</B> -- This function is very similar to the simple average function only each input frame must have a precalculated weighting factor. The average is calculated according to the following formula: <BR><P></P> <DIV ALIGN="CENTER"> <!-- MATH: \begin{equation} OUT = {\sum_i IN_i \times W_i \over \sum_i W_i} \end{equation} --> <TABLE WIDTH="100%" ALIGN="CENTER"> <TR VALIGN="MIDDLE"><TD ALIGN="CENTER" NOWRAP><A NAME="ccd-10"> </A><IMG WIDTH="204" HEIGHT="60" SRC="img939.gif" ALT="\begin{displaymath}OUT = {\sum_i IN_i \times W_i \over \sum_i W_i} \end{displaymath}"></TD> <TD WIDTH=10 ALIGN="RIGHT"> (18.10)</TD></TR> </TABLE> </DIV> <BR CLEAR="ALL"><P></P> <P> The function is called as:<BLOCKQUOTE> <TT>AVERAGE/WEIGHT OUT = IN_1,IN_2,</TT><IMG WIDTH="31" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" SRC="img940.gif" ALT="$\ldots$"><TT>,IN_n [M] [null] <BR> AVERAGE/WEIGHT OUT = catalog.CAT [M] [null]</TT></BLOCKQUOTE>where the parameters have exactly the same meaning as in the simple average command. The weighting factor has to be calculated beforehand with the command <TT>COMPUTE/WEIGHT</TT> or has to be entered by hand in a real descriptor <TT>WEIGHT</TT>. <P> <B>Averaging statistically consistent values</B> -- <A NAME="averaging-statistically-consistent-values"> </A>This command differs somewhat from the purely mathematical functions of the previous two commands in the sense that it tries to anticipate some of the astronomical content of the input data frames. The function requires that four auxiliary parameters (in descriptors) be defined for each input frame before it can process the frames. These parameters can be defined by the function <TT>WRITE/DESCRIPTOR</TT> and are: <UL> <LI><TT>LHCUTS(5),LHCUTS(6)</TT> -- low and high limits for valid pixels <LI><TT>O_TIME(7)</TT> -- exposure time <LI><TT>FLAT_BCK(1)</TT> -- mean background value. </UL>The function calculates the following: <BR><P></P> <DIV ALIGN="CENTER"> <!-- MATH: \begin{equation} OUT = {\sum_i (IN_i - B_i) \times W_i \over \sum_i W_i} \end{equation} --> <TABLE WIDTH="100%" ALIGN="CENTER"> <TR VALIGN="MIDDLE"><TD ALIGN="CENTER" NOWRAP><A NAME="ccd-11"> </A><IMG WIDTH="266" HEIGHT="61" SRC="img942.gif" ALT="\begin{displaymath}OUT = {\sum_i (IN_i - B_i) \times W_i \over \sum_i W_i} \end{displaymath}"></TD> <TD WIDTH=10 ALIGN="RIGHT"> (18.11)</TD></TR> </TABLE> </DIV> <BR CLEAR="ALL"><P></P> with the restriction that only those pixels satisfying the condition <BR><P></P> <DIV ALIGN="CENTER"> <!-- MATH: \begin{equation} \left\vert IN_i - B_i - \left< IN - B \right> \right\vert < 2.0 \times \sigma(\hbox{Background}) \end{equation} --> <TABLE WIDTH="100%" ALIGN="CENTER"> <TR VALIGN="MIDDLE"><TD ALIGN="CENTER" NOWRAP><A NAME="ccd-12"> </A><IMG WIDTH="440" HEIGHT="40" SRC="img943.gif" ALT="\begin{displaymath}\left\vert IN_i - B_i - \left< IN - B \right> \right\vert < 2.0 \times \sigma(\hbox{Background}) \end{displaymath}"></TD> <TD WIDTH=10 ALIGN="RIGHT"> (18.12)</TD></TR> </TABLE> </DIV> <BR CLEAR="ALL"><P></P> are accepted into the average. The threshold for rejection of pixels is a selectable parameter in the command. The default is shown. <P> The function is referenced to as:<BLOCKQUOTE> <TT>AVERAGE/WINDOW OUT = IN_1,IN_2,</TT><IMG WIDTH="31" HEIGHT="21" ALIGN="BOTTOM" BORDER="0" SRC="img944.gif" ALT="$\ldots$"><TT>,IN_n bgerr,snoise <BR> AVERAGE/WINDOW OUT = catalog.CAT bgerr,snoise</TT></BLOCKQUOTE> <P> <B>Merging frames</B> -- <A NAME="merging-frames"> </A>Often in order to properly merge frames, it is necessary to adjust the world coordinates of the frames so that the individual objects in each frame have the same world coordinates in the various different frames. This then allows the averaging routines to proceed to combine the frames correctly. Notice that almost all the MIDAS routines operate in world coordinates. <P> <HR> <!--Navigation Panel--> <A NAME="tex2html7022" HREF="node448.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="icons.gif/next_motif.gif"></A> <A NAME="tex2html7019" HREF="node441.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="icons.gif/up_motif.gif"></A> <A NAME="tex2html7013" HREF="node446.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="icons.gif/previous_motif.gif"></A> <A NAME="tex2html7021" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="icons.gif/contents_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html7023" HREF="node448.html">Cleaning Images</A> <B> Up:</B> <A NAME="tex2html7020" HREF="node441.html">CCD Detectors</A> <B> Previous:</B> <A NAME="tex2html7014" HREF="node446.html">Bias Corrections</A> <!--End of Navigation Panel--> <ADDRESS> <I>Petra Nass</I> <BR><I>1999-06-15</I> </ADDRESS> </BODY> </HTML>