ccl4

A binary image, always named "in.fits", is processed to label all connected pixels that are 4-connected.

The run script: ccl4.sh
% ccl4.sh 1 
arg1 - 1 for full image dumps, 0 for final pass2 only 
In the TEST_data site for ccl4 I have built several scripts that demonstrate how I use other codes to prepare a good input file for ccl4. I show a run of one such script below.
 
% ls
GRABIT*  S/

% cat GRABIT
#!/bin/sh 
# Collect a test image 
# 
cp $tdata/T_images/S1/hex_star2_0020.fits t1.fits 
getfits -o t2.fits t1.fits 322-357 252-287
cp t2.fits in.fits 
thresh.sh 3050.0 1 1.0
mv out.fits bitmap.fits
cp bitmap.fits in.fits

% GRABIT

t2.fits

Writing FITS image: out.fits                        

% ls
bitmap.fits  GRABIT*  in.fits  junc  runner*  S/  t1.fits  t2.fits


% ccl4.sh 1
Writing FITS image: pass1.fits                    
Writing FITS image: pass2.fits 

% ls
bitmap.fits  in.fits  pars.in      pass1.fits  play1.out  S/       t2.fits
GRABIT*      junc     pass1.equiv  pass2.fits  runner*    t1.fits  Unique_label.set

Note that if I had run ccl4 with a "0" argument then I would have eliminated the step of writing the "pass1.fits" image.


The result of running the script listed above. A large image is retrieved and a small piece is cut out to make the grey-scale image in the upper-left. The image is thresholded with the thresh code, and this image (renamed "in.fits" and shown in the upper-right) is fed to ccl4. The first pass of ccl4 makes a lableled pixel map (pass1, bottom-left) where the two discrete sources are labeled, but with multiple label values per source (the colors encode the pixel label values). In the second pass an algorithm is used to "glue" together the equivalent label sets and make the desired result (pass2 in bottom-right): two sources with unique pixel labels (in this case labels are "1" and "3").



Back to SCO CODES page