bugGNU Astronomy Utilities - Bugs: bug #62702, Clumps on strong gradients of...


You are not allowed to post comments on this tracker with your current authentication level.

bug #62702: Clumps on strong gradients of larger galaxies become too large

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Sun 03 Jul 2022 11:29:31 PM UTC
Category:  Segment Severity:  3 - Normal
Item Group:  Output not reasonable Status:  In Progress
Privacy:  Public Assigned to:  makhlaghi
Open/Closed:  Open

Fri 04 Aug 2023 12:28:20 PM UTC, comment #4: 

After some trials, in commit 5c96952b53d, I discovered that a sufficiently robust method is to use the variation of the azimuthal slice between subsequent pixels of a clump (as opposed to cycles).

In the image below, you can see an input image, and the resulting over-segmented clumps ('DET_CLUMPS_ALL' in the output of '--checksegmentation') between Gnuastro 0.20 and the commit above:

During the false clump identification the two elongated clumps on top of the good clump are rejected! Leaving us with a clean pixel map of only pixels that are strongly affected by that clump and not the wing of the galaxy.

This task is not yet finished and some extra tests in the next steps of segment (growth of true clumps in particular) are necessary.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Tue 01 Aug 2023 01:04:30 PM UTC, comment #3: 

I was able to start testing the hypothesis below by making the following figure: at the top you see the plot showing how the azimuthal angle changes as we come down from the brightest pixel of the small clump.

The bottom images show the convolved image on the left and the azimuthal image on the right.

This shows that indeed, for the inner pixels of the small clump, we cover the full azimuthal angle range of -180 to 180 degrees. But as we progress (beyond roughly 25 pixels), this coverage decreases and this is the location that we are dominated by the large galaxy and should stop growing the smaller clump.

Work on this test is on-going in the 'segment-clump-on-wing' branch of my development repository.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Mon 16 Jan 2023 11:29:38 AM UTC, comment #2: 

Until now, I had been investigating ways to step back to brighter pixels for finding a good stage to stop the growth of the clump. However, a few days ago, while investigating another issue with Sepideh Eskandarlou, we discovered a very interesting potential solution:

We can derive the azimuthal angle of a pixel in a profile by looking at its four-connected neighbors: If we define 'dx' as the difference of value between the next and previous pixels in the horizontal (X) direction, and 'dy' similarly for the Y direction, we can obtain the azimuthal angle of the pixel by taking the 'atan2' of 'dy/dx'.

In the left image below, you can see a small point-source on the wing of a bright elliptical Sersic profile. and on the right, you can see how the output of the analysis above (done through simple kernels with 'arithmetic').

As you see from this image, as long as we are primarily influenced by the point source, we fully cover the range of azimuthal degrees (0 to 360). But once we reach the part where the main galaxy dominates, the range of azimuthal angles significantly decreases to one small interval.

By checking the interval of the azimuthal angles as layers are added, we should be able to constrain the border of the small object without eating too much of the wing of the bright one.

We can use bits in one integer (maybe 16bit) to keep track of the azimuthal coverage as we expand the clump. We should explore this...

Thanks a lot to Sepideh for the very productive discussion that lead to this.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sun 03 Jul 2022 11:35:44 PM UTC, comment #1: 

The image below is the output of the script in the original post:

large clump

On the left, you see the image before adding noise. In the middle, the image with noise is shown. On the right, you can see the pixels associated with the two clumps as the white and yellow regions. The blue pixels are the undetected sky regions, and the black pixels are the detected, but diffuse regions that couldn't be associated with any individual clump.

As you see above, a small star has been placed very close to the larger galaxy's center.

We expect the "clump" of the star to only be as large as the black circle that the two white arrows point to. However, because it has the gradient of the background galaxy under it, Segment's current algorithm will associate the full right-side of the larger galaxy to also be part of this clump.

We need to define a way to stop the growth of the smaller clump in such cases and let the galaxy take the pixels that belong to it.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sun 03 Jul 2022 11:29:31 PM UTC, original submission:  

When a clump falls on the gradient of a large object, in the current implementation of Segment, it will steal a large fraction of flux from the large object. The code below in the P.S can be put in a simple shell script to reproduce the problem.

P.S. Code to reproduce the problem.

# Parameters.

# Abort in case of an error.
set -e

# Make a build directory if it doesn't already exist.
if ! [ -d build ]; then mkdir build; fi

# Generate the catalog
echo "1 0   0   2 3  2.8 0 1   5  5"  > $cat # PSF
echo "1 100 100 1 15 1   0 0.4 9  5" >> $cat # Galaxy
echo "1 110 100 4 0  0   0 0   13 0" >> $cat # Star

# Build an image and a convolution kernel.
astmkprof $cat --mergedsize=200,200 \
          --zeropoint=$zeropoint -o$raw \
mv build/0_raw.fits $psf

# Convolve the image with the kernel.
astconvolve $raw --kernel=$psf -o$conv

# Undersample the convolved image.
astwarp $conv --centeroncorner --scale=1/$oversample \

# Add noise
export GSL_RNG_SEED=1657794821
astarithmetic $nonoise $background $zeropoint \
              mag-to-counts mknoise-poisson \
              -o$noised --envseed

# Detect the signal
astnoisechisel $noised --tilesize=10,10 -o$det

# Segment the signal
astsegment $det -o$seg

Mohammad Akhlaghi <makhlaghi>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #55008:  clumps-old-new.png added by makhlaghi (125KiB - image/png)
file #54234:  azimuthal-angle.png added by makhlaghi (37KiB - image/png)
file #53390:  large-clump.png added by makhlaghi (62KiB - image/png)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by makhlaghi
  • -email is unavailable- added by makhlaghi
  • -email is unavailable- added by makhlaghi (Submitted the item)
  • -email is unavailable- added by makhlaghi

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-08-04 makhlaghi Attached File- Added clumps-old-new.png, #55008
    2023-08-01 makhlaghi Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-
    2023-08-01 makhlaghi Attached File- Added azimuthal-angle-from-max.png, #55002
    2023-01-16 makhlaghi Attached File- Added azimuthal-angle.png, #54234
    2022-07-03 makhlaghi Attached File- Added large-clump.png, #53390
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-3cd0.
    Corresponding source code