GNU Astronomy Utilities



2.5.7 Pseudo narrow-band images

In Continuum subtraction we subtracted/separated the continuum from the emission/absorption lines of our galaxy in the MUSE cube. Let’s visualize the morphology of the galaxy at some of the spectral lines to see how it looks. To do this, we will create pseudo narrow-band 2D images by collapsing the cube along the third dimension within a certain wavelength range that is optimized for that flux.

Let’s find the wavelength range that corresponds to H-alpha emission we studied in Extracting a single spectrum and plotting it. Fortunately MakeCatalog can calculate the minimum and maximum position of each label along each dimension like the command below. If you always need these values, you can include these columns in the same MakeCatalog with --sum-proj-in-slice. Here we are running it separately to help you follow the discussion there.

$ astmkcatalog seg.fits --output=cat-ranges.fits \
               --ids --min-x --max-x --min-y --max-y --min-z --max-z

Let’s extract the minimum and maximum positions of this particular object with the first command and with the second, we’ll write them into different shell variables. With the second command, we are writing those six values into a single string in the format of Crop’s Crop section syntax. For more on the eval-based shell trick we used here, see Separate shell variables for multiple outputs. Finally, we are running Crop and viewing the cropped 3D cube.

$ asttable cat-ranges.fits --equal=OBJ_ID,198 \
                  -cMIN_X,MAX_X,MIN_Y,MAX_Y,MIN_Z,MAX_Z
56     101    11     61     3044   3060

$ eval $(asttable cat-ranges.fits --equal=OBJ_ID,198 \
                  -cMIN_X,MAX_X,MIN_Y,MAX_Y,MIN_Z,MAX_Z \
                  | xargs printf "section=%s:%s,%s:%s,%s:%s; ")

$ astcrop no-continuum.fits --mode=img --section=$section \
          --output=crop-no-continuum.fits

$ astscript-fits-view crop-no-continuum.fits

Go through the slices and you will only see this particular region of the full cube. We can now collapse the third dimension of this image into a 2D pseudo-narrow band image with Arithmetic’s Dimensionality changing operators:

$ astarithmetic crop-no-continuum.fits 3 collapse-sum \
                --output=collapsed-all.fits

$ astscript-fits-view collapsed-all.fits

During the collapse, used all the pixels in each slice. This is not good for the faint outskirts in the peak of the emission line: the noise of the slices with less signal decreases the over-all signal-to-noise ratio in the pseudo-narrow band image. So let’s set all the pixels that aren’t labeled with this object as NaN, then collapse. To do that, we first need to crop the OBJECT cube in seg.fits. With the second command, please have a look to confirm how the labels change as a function of wavelength.

$ astcrop seg.fits -hOBJECTS --mode=img --section=$section \
          --output=crop-obj.fits

$ astscript-fits-view crop-obj.fits

Let’s use Arithmetic to first set all the pixels that are not equal to 198 in collapsed-obj.fits to be NaN in crop-no-continuum.fits. With the second command, we are opening the two collapsed images together:

$ astarithmetic crop-no-continuum.fits set-i \
                crop-obj.fits          set-o \
                i o 198 ne nan where 3 collapse-sum \
                --output=collapsed-obj.fits

$ astscript-fits-view collapsed-all.fits collapsed-obj.fits \
                      --ds9extra="-lock scalelimits yes -blink"

Let it blink a few times and focus on the outskirts: you will see that the diffuse flux in the outskirts has indeed been preserved better in the object-based collapsed narrow-band image. But this is a little hard to appreciate in the 2D image. To see it better practice, let’s get the two radial profiles. We will approximately assume a position angle of -80 and axis ratio of 0.770. With the final command below, we are opening both radial profiles in TOPCAT to visualize them. We are also undersampling the radial profile to have better signal-to-noise ratio in the outer radii:

$ astscript-radial-profile collapsed-all.fits \
           --position-angle=-80 --axis-ratio=0.7 \
           --undersample=2 --output=collapsed-all-rad.fits

$ astscript-radial-profile collapsed-obj.fits \
           --position-angle=-80 --axis-ratio=0.7 \
           --undersample=2 --output=collapsed-obj-rad.fits

To view the difference, let’s merge the two profiles (the MEAN column) into one table and simply print the two profiles beside each other. We will then pipe the resulting table containing both columns to a second call to Gnuastro’s Table and use column arithmetic to subtract the two mean values and divide them by the optimized one (to get the fractional difference):

$ asttable collapsed-all-rad.fits --catcolumns=MEAN -O \
           --catcolumnfile=collapsed-obj-rad.fits \
           | asttable -c1,2,3 -c'arith $3 $2 - $3 /' \
                      --colmetadata=2,MEAN-ALL \
                      --colmetadata=3,MEAN-OBJ \
                      --colmetadata=4,DIFF,frac,"Fractional diff." -YO
# Column 1: RADIUS   [pix        ,f32,] Radial distance
# Column 2: MEAN-ALL [input-units,f32,] Mean of sky subtracted values.
# Column 3: MEAN-OBJ [input-units,f32,] Mean of sky subtracted values.
# Column 4: DIFF     [frac       ,f32,] Fractional diff.
0.000          436.737        450.256        0.030
2.000          371.880        384.071        0.032
4.000          313.429        320.138        0.021
6.000          275.744        280.102        0.016
8.000          152.214        154.470        0.015
10.000         59.311         62.207         0.047
12.000         18.466         20.396         0.095
14.000         6.940          8.671          0.200
16.000         3.052          4.256          0.283
18.000         1.590          2.848          0.442
20.000         1.430          2.550          0.439
22.000         0.838          1.975          0.576

As you see, beyond a radius of 10, the last fractional difference column becomes very large, showing that a lot of signal is missing in the MEAN-ALL column. For a more visual comparison of the two profiles, you can use the command below to open both tables in TOPCAT:

$ astscript-fits-view collapsed-all-rad.fits \
                      collapsed-obj-rad.fits

Once TOPCAT has opened take the following steps:

  1. Select collapsed-all-rad.fits
  2. In the “Graphics” menu, select “Plane Plot”.
  3. Click on the “Axes” side-bar (by default, at the bottom half of the window), and click on “Y Log” to view the vertical axis in logarithmic scale.
  4. In the “Layers” menu, select “Add Position Control”. You will see that at the bottom half, a new scatter plot information is displayed.
  5. Click on the scroll-down menu in front of “Table” and select 2: collapsed-obj-rad.fits. Afterwards, you will see the optimized pseudo-narrow-band image radial profile as blue points.

Footnotes

(70)

To derive the axis ratio and position angle automatically, you can take the following steps. Note that we are not using NoiseChisel because this crop has been intentionally selected to contain signal, so there is no raw noise inside of it.

$ aststatistics collapsed-all.fits --sky --tilesize=5,5
$ astarithmetic collapsed-all.fits -h1 collapsed-all_sky.fits -hSKY_STD / 5 gt \
                -ocollapsed-lab.fits
$ astmkcatalog collapsed-lab.fits -h1 --valuesfile=collapsed-all.fits \
               --position-angle --axis-ratio
$ asttable collapsed-all_arith_cat.fits -Y
-78.817        0.694