Old (2018) PFC finding methods.
Updated: Oct27,2020

Here I record some older header-based methods of locating PFC images of specific galaxies.

  1. I am interested in one galaxy.
  2. The VENGA galaxies.



I am interested in one galaxy.

I usually want to track down available PFC images of a particular galaxy. To make the initial lists of images, I use the bash script "object_fits_list" and a directory path for the top of my search. Below I show two examples: a search of a small single run (August 2005), and then I survey my entire collection.

  

% pwd
/home/sco/tmp
% ls

I can run this in any (empty directory). 

% object_fits_list /home/sco/sco/Red_PhaseI_Data/aug_2005_p1
Searching at top level = /home/sco/sco/Red_PhaseI_Data/aug_2005_p1
        See files: List.1 and List.2

% head -5 List.? 
==> List.1 <==
/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

==> List.2 <==
Rsco5358.fits N6946 V
Rsco5361.fits N6946 V
Rsco5357.fits N6946 R
Rsco5374.fits N6951 B
Rsco5371.fits N6951 R

Hence, the List.1 file gives the fullpath file names, and the List.2 gives the Fits file name, Object name, and filter name for each of the images listed in List.1.

Now I search my entire image collection. I also use the python script "object_unique_list.py" to find the unique object names present in this collection.

 

% object_fits_list /home/sco/sco/Red_PhaseI_Data/

% wc -l List.* 
  2022 List.1
  2022 List.2

% ls 
List.1  List.2

% object_unique_list.py List.2 List.SCO_objects  

I see a stream of names to standard out. 

% ls 
List.1  List.2  List.SCO_objects  

% wc -l * 
  2022 List.1
  2022 List.2
   271 List.SCO_objects

The initial object_fits_list run took under a minute to run (on scohome). I have a working list of 2002 images, and a set of 271 unique object names.

Next I want to concern myself with the galaxy NGC4618 (of course). First I need to know how many unique OBJECT names I used for this target:

 

% cat List.SCO_objects |grep -n '4618' 
240:NGC4618_U
245:NGC4618_R
251:NGC4618_B
258:N4618

% cat List.SCO_objects |grep -n '3664'  
121:NGC3664_B
129:NGC3664_R
259:NGC3664_V

% cat List.SCO_objects |grep -n '6946'
226:N6946
247:NGC6946_R
254:NGC6946_B

% cat List.SCO_objects |grep -n '4725'
118:N4725_B
122:N4725_U
123:N4725_V
124:N4725_R
 
Hence, it is clear that I often included the filter name in designating the name of a galaxy in a FITS header. Rather than code up some klugy thing that handles all of these situations, I plan to just use multiple runs, one for each name used, when I need to.


Collecting the images for a certain galaxy

The next thing I usually want to do is to build a list of all images (or all images in a specific filter) for one galaxy. If I have used 4 different 'll do ths procedure 4 times! What I want is a script of code that inspects, line by line, the entries in List.1 (full file names) and List.2 (FITS name, OBJECT and filter). If my input OBJECT and filter name match, I write the full file name out. Here's how I do it for NGC7479, where I used the name string "N7479" in my OBJECT value in each FITS header:


% fits_select N7479 R 
/home/sco/sco/Red_PhaseI_Data/oct_2004_p1/Rsco3217.fits
/home/sco/sco/Red_PhaseI_Data/oct_2004_p1/Rsco3225.fits
/home/sco/sco/Red_PhaseI_Data/oct_2004_p1/Rsco3223.fits
/home/sco/sco/Red_PhaseI_Data/oct_2004_p1/Rsco3218.fits
/home/sco/sco/Red_PhaseI_Data/oct_2004_p1/Rsco3224.fits
/home/sco/sco/Red_PhaseI_Data/oct_2004_p1/Rsco3228.fits
/home/sco/sco/Red_PhaseI_Data/oct_2004_p1/Rsco3227.fits
/home/sco/sco/Red_PhaseI_Data/oct_2004_p1/Rsco3226.fits
/home/sco/sco/Red_PhaseI_Data/oct_2004_p1/Rsco3212.fits

% fits_select N7479 R > list.R 
% fits_select N7479 B > list.B 
% fits_select N7479 V > list.V 

% impuller list.R  

The last command pulls over the FITS files for my R images. I can quickly view these images using something like:
 

% ds9_open 1000 1000 
% ls -1 *.fits > list 
% ds9_multi_view list 800 6000 


Another way I used in the past.

An alternative way of gathering PFC images using the example of NGC3379 is described here . The approach above is more general, but I'll document the older way here. I show an example below that collects my NGC2403 images. Here I have to know the name used as the OBJECT keyword in my FITS image (in this case N2403):

 

% fits_name_grab /home/sco/sco/Red_PhaseI_Data N2403 ./n2403

*** This took 2-3 minutes to run, then I have my N2403 images in a subdirectory named "n2403":
% gethead ./n2403/*.fits OBJECT INSFILTE 
Rsco3507.fits N2403 R
Rsco3508.fits N2403 V
Rsco3509.fits N2403 B
Rsco3510.fits N2403 B
Rsco3511.fits N2403 R
Rsco3512.fits N2403 V
Rsco3513.fits N2403 V
Rsco3514.fits N2403 R
Rsco3515.fits N2403 B
Rsco3516.fits N2403 B
Rsco3517.fits N2403 V
Rsco3518.fits N2403 R
Rsco3519.fits N2403 R
Rsco3520.fits N2403 V
Rsco3521.fits N2403 B
Rsco3522.fits N2403 R
Rsco3523.fits N2403 V

I can break the images into useful lists by filter:
% run_imglis_all ./n2403 N2403

Images with object,filter = N2403 B
Start: Fri Apr 22 13:30:31 CDT 2016
End:   Fri Apr 22 13:30:32 CDT 2016
N_image, filename:  5 LIST_IMS_N2403_B

Images with object,filter = N2403 V
Start: Fri Apr 22 13:30:32 CDT 2016
End:   Fri Apr 22 13:30:34 CDT 2016
N_image, filename:  6 LIST_IMS_N2403_V

Images with object,filter = N2403 R
Start: Fri Apr 22 13:30:34 CDT 2016
End:   Fri Apr 22 13:30:35 CDT 2016
N_image, filename:  6 LIST_IMS_N2403_R

% ls
AA*  G1*  keep0/  LIST_IMS_N2403_ALL  LIST_IMS_N2403_B	LIST_IMS_N2403_R  LIST_IMS_N2403_V  n2403/

% cat LIST_IMS_N2403_B
./n2403/Rsco3509.fits N2403 B
./n2403/Rsco3510.fits N2403 B
./n2403/Rsco3516.fits N2403 B
./n2403/Rsco3515.fits N2403 B
./n2403/Rsco3521.fits N2403 B
 

Return to top of page.



The VENGA galaxies.

Ordinarily this sort of small effort would not be worth documenting. In this case I realized that in a few minutes I could use a few bash and python scripts to do the job that, a year ago, I would have done with fortran. The fortran effort would have taken a lot more time and effort! So, I thought it useful to at least list the procedures I used. The scripts reside in my permanent collections of bash ($codes/bash) and python ($codes/python) codes.

I was interested in which VENGA galaxies are present in my PFC galaxy collection. I pulled the following images from the web follwing a minimal amount of work. Then I used a few simple bash and python scripts to find the answer. Just to be exhaustive about this, I built this graphic with:
 
% build_htm_img venga_gals.png venga_gals.txt >a  
I just pasted the contnts of "a" into this doc and did some minimal editting.

Work done in:  /home/sco/sco/Red_PhaseI_Data/A_extra

To get a list of filenames and objects:
% object_fits_list /home/sco/sco/Red_PhaseI_Data/aug_2005_p1 

To find the unique names in List.2:
% object_unique_list.py -v List.2 List.3 

To survey all of the directories:
% object_fits_list /home/sco/sco/Red_PhaseI_Data

By using the full path, I can run the object_fits_list anywhere 
(like /home/sco/tmp). To run on the entire set of images:
% pwd
/home/sco/tmp
% object_fits_list /home/sco/sco/Red_PhaseI_Data
Searching at top level = /home/sco/sco/Red_PhaseI_Data
Search string: *.fits
        See files: List.1 and List.2
(Takes about a minute to complete) 
The List.2 file has 2022 lines. 

To get the unique list:
% object_unique_list.py List.2 List.SCO_objects

% wc -l List.SCO_objects
271 List.SCO_objects

To look for a specific NGC galaxy I do something like:
% cat List.SCO_objects |grep -n '4618' 
240:NGC4618_U
245:NGC4618_R
251:NGC4618_B
258:N4618

--------------------------------------------------------
What motivated this:

% cat venga
#!/bin/bash
printf "Searching for $1\n" 
cat List.SCO_objects |grep -n "$1" 

% venga 4618
Searching for 4618
240:NGC4618_U
245:NGC4618_R
251:NGC4618_B
258:N4618

For running the full list of VENGA galaxies, I took the ngc numbers from the VENGA graphic above and did this:
 
Work done in:  /home/sco/tmp

% object_fits_list /home/sco/sco/Red_PhaseI_Data
% object_unique_list.py List.2 List.SCO_objects
% vi VRUN
% chmod 777 VRUN

% cat VRUN
#
venga 3166
venga 3227
venga 4314
venga 2775
venga 4450
venga 4569
venga 4826
venga 1068
venga 2841
venga 3351
venga 3627
venga 4013
venga 7331
venga 2903
venga 3147
venga 3521
venga 3949
venga 5055
venga 5194
venga 5713
venga 0628
venga 3198
venga 3938
venga 4254
venga 4254
venga 5981
venga 7479
venga 1042
venga 6503
venga 6946
venga 0337 

To run the script: 
% VRUN >My_Venga

% cat My_Venga

Searching for 4618
240:NGC4618_U
245:NGC4618_R
251:NGC4618_B
258:N4618
Searching for 3166
Searching for 3227
Searching for 4314
Searching for 2775
194:N2775
Searching for 4450
Searching for 4569
Searching for 4826
Searching for 1068
206:N1068
Searching for 2841
Searching for 3351
51:NGC3351
180:N3351_R
Searching for 3627
Searching for 4013
Searching for 7331
159:N7331
Searching for 2903
Searching for 3147
Searching for 3521
Searching for 3949
Searching for 5055
Searching for 5194
5:N5194
Searching for 5713
Searching for 0628
Searching for 3198
Searching for 3938
Searching for 4254
Searching for 4254
Searching for 5981
Searching for 7479
117:N7479
Searching for 1042
56:N1042
Searching for 6503
Searching for 6946
226:N6946
247:NGC6946_R
254:NGC6946_B
Searching for 0337

In the end, my list of PFC galaxies that are in the VENGA survey, is:

 

N2775
N1068
NGC3351
N7331
5194
N7479
N1042
N6946

This list of 8 galaxies is actually much larger than I expected!

Return to top of page.



Back to SCO CODES page