# Base name of input files.
input="1881731715 3163025249 1887227377 3746244531 2923938133 4209692437 2966790193 595260509"

# Generate the catalog for each image.
for i in $input; do

    # First run NoiseChisel to separate signal from the background.
    astnoisechisel $i.fits --tilesize=50,50 --interpnumngb=21 \
		   --output=$i-nc.fits

    # Run Segment to get a label for each clump, don't bother with
    # detecting objects, they aren't relevant here.
    astsegment $i-nc.fits --onlyclumps --output=$i-seg.fits

    # Generate a catalog with the ID, X, Y, and magnitude (assuming a
    # zeropoint of 0).
    astmkcatalog $i-seg.fits --hdu=CLUMPS --ids --x --y --magnitude \
		 --output=$i-x-y.fits

    # Clean up.
    rm $i-nc.fits $i-seg.fits
done
