Processing math: 100%

GNU Astronomy Utilities



7.4.4 Measuring elliptical parameters

The shape or morphology of a target is one of the most commonly desired parameters of a target. Here, we will review the derivation of the most basic/simple morphological parameters: the elliptical parameters for a set of labeled pixels. The elliptical parameters are: the (semi-)major axis, the (semi-)minor axis and the position angle along with the central position of the profile. The derivations below follow the SExtractor manual derivations with some added explanations for easier reading.

Let’s begin with one dimension for simplicity: Assume we have a set of N values Bi (for example, showing the spatial distribution of a target’s brightness), each at position xi. The simplest parameter we can define is the geometric center of the object (xg) (ignoring the brightness values): xg=(ixi)/N. Moments are defined to incorporate both the value (brightness) and position of the data. The first moment can be written as:

¯x=iBixiiBi

This is essentially the weighted (by Bi) mean position. The geometric center (xg, defined above) is a special case of this with all Bi=1. The second moment is essentially the variance of the distribution:

¯x2iBi(xi¯x)2iBi=iBix2iiBi2¯xiBixiiBi+¯x2=iBix2iiBi¯x2

The last step was done from the definition of ¯x. Hence, the square root of ¯x2 is the spatial standard deviation (along the one-dimension) of this particular brightness distribution (Bi). Crudely (or qualitatively), you can think of its square root as the distance (from ¯x) which contains a specific amount of the flux (depending on the Bi distribution). Similar to the first moment, the geometric second moment can be found by setting all Bi=1. So while the first moment quantified the position of the brightness distribution, the second moment quantifies how that brightness is dispersed about the first moment. In other words, it quantifies how “sharp” the object’s image is.

Before continuing to two dimensions and the derivation of the elliptical parameters, let’s pause for an important implementation technicality. You can ignore this paragraph and the next two if you do not want to implement these concepts. The basic definition (first definition of ¯x2 above) can be used without any major problem. However, using this fraction requires two runs over the data: one run to find ¯x and another run to find ¯x2 from ¯x, this can be slow. The advantage of the last fraction above, is that we can estimate both the first and second moments in one run (since the ¯x2 term can easily be added later).

The logarithmic nature of floating point number digitization creates a complication however: suppose the object is located between pixels 10000 and 10020. Hence the target’s pixels are only distributed over 20 pixels (with a standard deviation <20), while the mean has a value of 10000. The iB2ix2i will go to very very large values while the individual pixel differences will be orders of magnitude smaller. This will lower the accuracy of our calculation due to the limited accuracy of floating point operations. The variance only depends on the distance of each point from the mean, so we can shift all position by a constant/arbitrary K which is much closer to the mean: ¯xK=¯xK. Hence we can calculate the second order moment using:

¯x2=iBi(xiK)2iBi(¯xK)2

The closer K is to ¯x, the better (the sums of squares will involve smaller numbers), as long as K is within the object limits (in the example above: 10000K10020), the floating point error induced in our calculation will be negligible. For the most simplest implementation, MakeCatalog takes K to be the smallest position of the object in each dimension. Since K is arbitrary and an implementation/technical detail, we will ignore it for the remainder of this discussion.

In two dimensions, the mean and variances can be written as:

¯x=iBixiBi,¯x2=iBix2iiBi¯x2 ¯y=iBiyiBi,¯y2=iBiy2iiBi¯y2 ¯xy=iBixiyiiBi¯xׯy

If an elliptical profile’s major axis exactly lies along the x axis, then ¯x2 will be directly proportional with the profile’s major axis, ¯y2 with its minor axis and ¯xy=0. However, in reality we are not that lucky and (assuming galaxies can be parameterized as an ellipse) the major axis of galaxies can be in any direction on the image (in fact this is one of the core principles behind weak-lensing by shear estimation). So the purpose of the remainder of this section is to define a strategy to measure the position angle and axis ratio of some randomly positioned ellipses in an image, using the raw second moments that we have calculated above in our image coordinates.

Let’s assume we have rotated the galaxy by θ, the new second order moments are:

¯x2θ=¯x2cos2θ+¯y2sin2θ2¯xycosθsinθ ¯y2θ=¯x2sin2θ+¯y2cos2θ+2¯xycosθsinθ ¯xyθ=¯x2cosθsinθ¯y2cosθsinθ+¯xy(cos2θsin2θ)

The best θ (θ0, where major axis lies along the xθ axis) can be found by:

¯x2θθ|θ0=0 Taking the derivative, we get: 2cosθ0sinθ0(¯y2¯x2)+2(cos2θ0sin2θ0)¯xy=0 When ¯x2¯y2, we can write: tan2θ0=2¯xy¯x2¯y2.

MakeCatalog uses the standard C math library’s atan2 function to estimate θ0, which we define as the position angle of the ellipse. To recall, this is the angle of the major axis of the ellipse with the x axis. By definition, when the elliptical profile is rotated by θ0, then ¯xyθ0=0, ¯x2θ0 will be the extent of the maximum variance and ¯y2θ0 the extent of the minimum variance (which are perpendicular for an ellipse). Replacing θ0 in the equations above for ¯xθ and ¯yθ, we can get the semi-major (A) and semi-minor (B) lengths:

A2¯x2θ0=¯x2+¯y22+(¯x2¯y22)2+¯xy2

B2¯y2θ0=¯x2+¯y22(¯x2¯y22)2+¯xy2

As a summary, it is important to remember that the units of A and B are in pixels (the standard deviation of a positional distribution) and that they represent the spatial light distribution of the object in both image dimensions (rotated by θ0). When the object cannot be represented as an ellipse, this interpretation breaks down: ¯xyθ00 and ¯y2θ0 will not be the direction of minimum variance.