A CCD Analysis of NGC3379 PFC Images
Last updated: Dec 19,2018

NGC3379 is a bright, circular, well-studied galaxy. In addition, it is located next to two other similarly sized galaxies that can be studied in the same PFC field.


The NGC3379 field on a McDonald 0.8-meter PFC image. I have 5 images of the N3379 field made with this instrument:
 
% cd /home/sco/N3379/images_fixed  (on old scohome) 
% gethead R*fits OBJECT INSFILTE EXPTIME 
Rsco2039.fits   NGC3379     R 60.00
Rsco2040.fits   NGC3379     R 600.00
Rsco2041.fits   NGC3379     R 600.00
Rsco2042.fits   NGC3379_B   B 600.00
Rsco2043.fits   NGC3379_V   V 600.00   (Image shown above) 
 

As indicated, the image above is a 10 minute V exposure. The image that I use for general image processing checks, available through THIS LINK is the short R exposure (Rsco2039.fits).
  1. Process PFC images through WCS calibration.
  2. Compute and install photometric ZP.
  3. Install useful sky informatin in the image headers.
  4. A quick look with ds9_profiles.



Process PFC images through WCS calibration.

The PFC CCD collection has been reduced in with CCDRED (iraf) and the processed images reside in $scohome/Red_PhaseI_Data/.


This file: /home/sco/N3379/S/README.Jun2018_N3379

I want to work on my N3379 images  (I do all of this in:   /home/sco/N3379)  
Most of the work, through the stage of wcs calibrtion, is in: /home/sco/N3379/T2 

============================================================================
STEP: Get the images  (See file:///home/sco/sco/scohtm/scocodes/PFC_List/index.html#SEC_1) 
I do all of this in ./images_raw 
% object_fits_list /home/sco/sco/Red_PhaseI_Data/
    List.1 = fullfits list of files 
    List.2 = list with file, target. and filter names
% object_unique_list.py List.2 List.SCO_objects  
    This makes:  List.SCO_objects  and I see 3 names I am interestin:  
                    NGC3379_V   (line 17) 
                    NGC3379_B   (line 29) 
                    NGC3379     (line 139) 
                 # Recall in my early days I included the filter in the OBJECT card 
% fits_select NGC3379_V V > list.ALL
% fits_select NGC3379_B B >> list.ALL
% fits_select NGC3379 B >> list.ALL
% fits_select NGC3379 V >> list.ALL
% fits_select NGC3379 R >> list.ALL

# I can make a quicky listing: 
% gethead @list.ALL INSFILTE OBJECT EXPTIME
Rsco2043.fits V NGC3379_V 600.00
Rsco2042.fits B NGC3379_B 600.00
Rsco2039.fits R NGC3379 60.00
Rsco2041.fits R NGC3379 600.00
Rsco2040.fits R NGC3379 600.00

I can pull the images: 
% mkdir imgs_raw
% cd imgs_raw
% cp ../list.ALL .
% impuller list.ALL
Name = /home/sco/sco/Red_PhaseI_Data/apr_2004_p1/Rsco2043.fits
Name = /home/sco/sco/Red_PhaseI_Data/apr_2004_p1/Rsco2042.fits
Name = /home/sco/sco/Red_PhaseI_Data/apr_2004_p1/Rsco2039.fits
Name = /home/sco/sco/Red_PhaseI_Data/apr_2004_p1/Rsco2041.fits
Name = /home/sco/sco/Red_PhaseI_Data/apr_2004_p1/Rsco2040.fits
 

============================================================================
STEP:  Remove bad cards from my original PFC images in ./imgs 
mkdir images_fixed/
cd images_fixed/
ls -1 /home/sco/N3379/images_raw/R*fits >list.1 
  
To get the list of all keywords: 
% fitskw.sh /home/sco/N3379/images_raw/Rsco2040.fits > words.list
% cp words.list my_bad_cards
# Then I edit my_bad_cards to include only the words I DO NOT want 

Here is what I usually use: 
% cat my_bad_cards 
ORIGIN
IRAF-TLM
COMMENTS
DARKTIME
POINT   
PROGRAM 
SSI     
DSP     
PREFLASH
CAMTEMP 
DEWTEMP 
CCDSEC  
ORIGSEC 
CCDSUM  
INSTRTEM
WCSDIM  
LTM1_1  
LTM2_2  
WAT0_001
WAT1_001
WAT2_001
TRIM    
FIXPIX  
OVERSCAN
ZEROCOR 
LTV1    
LTV2    
CCDPROC 
FLATCOR 
COMMENT 
INSFOCUS
   
*** Finally I correct the headers with: 
% remove_fitslist_kwords list.1 my_bad_cards N 
% ls
list.1	my_bad_cards  Rsco2039.fits  Rsco2040.fits  Rsco2041.fits  Rsco2042.fits  Rsco2043.fits

  
============================================================================
STEP:  Install wcs 

NOTE: All of my wcsf_ codes read the local WCSF.DEFAULTS if present. Below
I show a good example for PFC images. 
% cat WCSF.DEFAULTS
 15.0    R2maglim      R2mag limit for initial 2-panel usno_identify run 
 red     textcolor     Color for text labeling for initial 2-panel usno_identify run 
 14      fontsize      Text size for initial 2-panel usno_identify run 
 14.5    Vmag          V mag limit for wcs_refine run 
 26.0    radius        search radius (arcminutes) for usno catalog in wcs_refine run 
 10.0    circrad       radius (pixels) for source labels in wcs_refine run 
 Blue    magname       name of USNO mag for final usno_look_wcs run 
 14.0    magmax        mag limit for final usno_look_wcs run 
 5.0     skysiglev     sky sigma threshold for imgcat0 run 

      
SubStep1: Get rough estimates for CRPIX1,2 and CRVAL1,2
-------------------------------------------------------
% pwd
/home/sco/N3379
% mkdir local_red
% ls -1 /home/sco/N3379/images_fixed/*fits >list.1
% cat list.1
/home/sco/N3379/images_fixed/Rsco2039.fits
/home/sco/N3379/images_fixed/Rsco2040.fits
/home/sco/N3379/images_fixed/Rsco2041.fits
/home/sco/N3379/images_fixed/Rsco2042.fits
/home/sco/N3379/images_fixed/Rsco2043.fits

**** If we are running on PFC images of one galaxy (which we are) then 
     create the local file named "Default.RaDecName" that gives the 
     RAsex,DECsex,Name for the galaxy. The code "ds9_crpix_set" will 
     be used to set the X,Y,Ra,Dec 

% cat Default.RaDecName
10:47:49.90 +12:34:57.0 N3379

NOTE: If the "Default.RaDecName" is not present, then you will be 
      queried for the [RAsex,DECsex,Name] for every image. 

ALSO NOTE:  The single source you mark in ds9_crpix_set does not have to 
            be the galaxy of interest. You just have to have an easily 
            identified target with known Ra,Dec. 

% wcsf_rough list.1 N
*** I answer "Y" to the question about running usno_identify (although in the 
    case of pfc images I'll really be running the code:  ds9_crpix_set

%  ls
Default.RaDecName	 fits_review.pass0	    list.0  list.1.codes  S/
fits_review.params_used  fits_review.pass0_Explain  list.1  local_red/	  WCSF.DEFAULTS
% ls local_red/ROUGHWCS/
Rsco2039.fits  Rsco2040.fits  Rsco2041.fits  Rsco2042.fits  Rsco2043.fits


SubStep2: Confirm and refine the rough wcs solution 
----------------------------------------------------
The wcsf_viscat code lest you assess the quality of the rough wcs solutions
and fix up (using wcs_refine) most cases of poor solutions. 

% ls
fits_review.params_used  list.1  local_red/  S/  t0/  WCSF.DEFAULTS

% ls ./local_red/VISCAT
Rsco2039.fits	    Rsco2040.fits	Rsco2041.fits	    Rsco2042.fits	Rsco2043.fits
Rsco2039.png	    Rsco2040.png	Rsco2041.png	    Rsco2042.png	Rsco2043.png
Rsco2039-usno.cdfp  Rsco2040-usno.cdfp	Rsco2041-usno.cdfp  Rsco2042-usno.cdfp	Rsco2043-usno.cdfp

*** The refined (or confirmed) wcs images are in the VISCAT subdirectory along 
with a png image of the field and a cdfp catalog of (some) sources in the image. 


SubStep3: Build image catalogs 
------------------------------
% cat WCSF.DEFAULTS
 15.0    R2maglim      R2mag limit for initial 2-panel usno_identify run 
 red     textcolor     Color for text labeling for initial 2-panel usno_identify run 
 14      fontsize      Text size for initial 2-panel usno_identify run 
 14.5    Vmag          V mag limit for wcs_refine run 
 26.0    radius        search radius (arcminutes) for usno catalog in wcs_refine run 
 10.0    circrad       radius (pixels) for source labels in wcs_refine run 
 Blue    magname       name of USNO mag for final usno_look_wcs run 
 14.0    magmax        mag limit for final usno_look_wcs run 
 10.0    skysiglev     sky sigma threshold for imgcat0 run 

% wcsf_imgcat list.1 N 

The results are placed into the archive directory:  local_red/IMGCAT0

The basic files ade in this step:
  Rsco2040.fits         - the images analyzed (just a copy) 
  Rsco2040_bkg1.fits    - background map 
  Rsco2040_sigma.fits   - image of the noise distribution 
  Rsco2040_detsig.fits  - detection significance map 
  Rsco2040_label0.fits  - connected (and labeled) pixel map 
  Rsco2040.cat0 - ascii catalog file 
  Rsco2040.cdfp - cdfp file of sources (has Ra,Dec for all catalog sources) 
  Rsco2040.table,params,parlab - table file of simple image parameters 

SubStep4: Use catalog sources to make final wcs solution 
--------------------------------------------------------
% pwd
/home/sco/N3379/T2
% ls
Default.RaDecName  list.1  local_red/  S/  WCSF.DEFAULTS
% wcsf_final list.1 Y N

After this I have: 
% ls local_red/WCS
Rsco2039.fits  Rsco2040.fits  Rsco2041.fits  Rsco2042.fits  Rsco2043.fits

*** Each PFC image is now wcs-calibrated with around 300 stars 




Compute and install photometric ZP.

In Jul2018 I revised some of the ZP calibration reduction steps to make a more seamless reduction flow. Most of the deatils are dissussd in the documentation for the the main tool used in this process: photcal_fitslist. The steps really come down to this:


% photcal_fitslist ./S/list.1 ps1 N      # First pass to collect stars  
# gri photometry is collected from the PS1 webtool   
% photcal_fitslist ./S/list.1 ps1 N      # Second pass to compute ZP values 

The primary upgrades concerned how to more easily change the set of sources used to compute the ZP values. I made changes to the zpstars routine to make it simpler to change the aperture sizes and resultant photometry (via (usno_look_wcs and (mido.sh). I upgraded a lot of my documenation on how to use the gri of PanSTARRS (PS1) for this work, and the results are summarized in the table below:


% gethead ./local_red/ZP/*.fits INSFILTE ZPSEC ZPERR NUMZP 
Rsco2039.fits   R   -8.79392 0.007837   74
Rsco2040.fits   R   -8.86507 0.002382   96
Rsco2041.fits   R   -8.90970 0.004795   66
Rsco2042.fits   B   -9.82242 0.008243   59
Rsco2043.fits   V   -9.30222 0.018677   50




Install useful sky informatin in the image headers.

With a photometric zeropoint available, we can compute calibrated photometry. One of the most valuable quantities is a measure of the night sky surface brightness of the image calibrated to some standard system. In addition, we'd like to know the state of the moon at the time the image was taken (was it up?, what was the phase?, what is the angular separation of the moon and the image position on the sky?). In thsi section we instal all of this information in the image headers.


% skyprops_fitslist ./S/list.0 N 
For each image we'll mark clear sky area with a ds9 box region and compute mean sky surface brightness via he routine skysb_stats). The moon properties will be installed in the FITS headers using skymoon.

After processing the NGC3379 images I find:


% gethead ./local_red/CAT/*.fits INSFILTE SKYSB SKYSBERR  

  Image          filter      m.e.  
  Rsco2039.fits    R     20.54326 0.009656
  Rsco2040.fits    R     20.48375 0.007863
  Rsco2041.fits    R     20.68311 0.003766

  Rsco2042.fits    B     21.96543 0.006386

  Rsco2043.fits    V     20.99785 0.003754

These images were taken in mid solar cycle (between max-min). I 
am unsure of the weather conditions for this night. 


These calibrated images are on scohome in:
/home/sco/N3379/T2/local_red/CAT     
 





A quick look with ds9_profiles.

I have two basic codes that make viewing and initial measurements of FITS images very easy. They are ds9_imstats and ds9_profiles. As a brief intro to the surface photometry used here, I describe in the ds9_profiles webdoc a quick look at profiles in the NGC3379 field.




Back to computer basics page