Making a list of targets among my image collection

Here I use a number of unix tasks, along with wcstools.gethead to find the names of targeted image. First, I want to see how large my image directories are:

 
%  du -sh  /home/sco/sco/Red*/*  
20K     /home/sco/sco/Red_PhaseI_Data/A_extra
2.2G    /home/sco/sco/Red_PhaseI_Data/apr_2004_p1
1.6G    /home/sco/sco/Red_PhaseI_Data/apr_2005_p1
349M    /home/sco/sco/Red_PhaseI_Data/apr_2009_p1
273M    /home/sco/sco/Red_PhaseI_Data/aug_2005_p1
1.8G    /home/sco/sco/Red_PhaseI_Data/dec_2005_p1
   *
   *
   *
I pick a small directory, and make a list of the fits images written there.

% find /home/sco/sco/Red_PhaseI_Data/aug_2005_p1 -name "*.fits" 
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5358.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5361.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5357.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5374.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5371.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5365.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5363.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5360.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5373.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5359.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5370.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5368.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5369.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5364.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5366.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5372.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5367.fits
/home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5362.fits

   I can also just dumps this file list to a file:  
% find /home/sco/sco/Red_PhaseI_Data/aug_2005_p1 -name "*.fits" >list1

Now I take part of the list1 file and I make an execuatble script to run gethead.
% mv list1 c1.sh
% vi c1.sh
% cat c1.sh
#
gethead -u /home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5358.fits OBJECT 
gethead -u /home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5369.fits OBJECT 
gethead -u /home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5364.fits OBJECT 
gethead -u /home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5366.fits OBJECT 
gethead -u /home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5372.fits OBJECT 
gethead -u /home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5367.fits OBJECT 
gethead -u /home/sco/sco/Red_PhaseI_Data/aug_2005_p1/Rsco5362.fits OBJECT 
% chmod 777 c1.sh
% c1.sh
N6946
N6951
N6951
N6951
N6951
N6951
N6946
Now I can redirect output from my executable script ("c1.sh") to a file and use the sort task. In the first case I sort all of the list, in the second case I sort all of the unique OBJECT names.
Case 1: Sort full list 
% c1.sh > LLL
% sort LLL
N6946
N6946
N6951
N6951
N6951
N6951
N6951

Case 2: Sort unique names in list 
% c1.sh > LLL
% sort -u LLL
N6946
N6951

Return to gethead page.