Contents:
1.
mscdisplay....sorting hints
2. crosstalk
3. ccdproc: zerocombine, flatcombine...
4. mscgetcat: getting usno catalogs for WCS.
5. WCS calibration and creating single images from multiple extensions
1.
#To display Mosaic images:
mscdisplay "caulquiergal".fits
#Where "" is the root name.
#For higher resolution display, change stdimage to appropriate size (in this case, imt=4096). This can be automatically set in the login.cl file. Note: a higher resolution takes longer to load.:
show stdimage
set stdimage=imt4096
#For selection an sort processes, use hsel. Define what should be sorted. Specify image extension (in this case [1], for the CCD 1 in MOSAIC). This works as a place holder in the selection criteria and will be removed after selection. Extracted fields are expressed as Boolean strings, as are expression governing selection ($I, filter, title, etc.).
hsel obj*fits[1] $I filter=="R"&&(title?="SA" || title?="95)
hsel > SA95R
#removing the [1] extension...
!perl -pi -e 's/\[1\]//' xtin
*********
2.
#Must first compute the crosstalk coefficients for the 8 amplifiers. Crosstalk are artifacts arising in the CCDs due to multiple amplifiers. They appear as "reflections", from one chip to the next. The coefficients will correct this problem, once applied. It's possible to compare these coefficient with the values on the CTIO Mosaic webpage. Choose an object file for this. Only one crosstalk computation is needed (not one for each object file). Here, @xtin is the object list and sxt is the output file with computed coefficients.
xtcoeff @xtin sxt
#Parameter file for xtcoeff
#
Image Reduction and Analysis Facility
#PACKAGE = mscred
# TASK = xtcoeff
input =
@xtin List of mosaic exposures
output =
sxt Output crosstalk file
victim = im1,im2,im3,im4,im5,im6,im7,im8 List of victim
extensions
source = im2,im1,im4,im3,im6,im5,im8,im7 List of source
extensions
(smin =
20000.) Minimum source pixel
(smax =
INDEF) Maximum source pixel
(medfact=
0.5) Median factor
(maxcoef=
0.01) Maximum coefficient value to consider
(niterat=
3) Maximum number of rejection iterations
(low =
3.) Low rejection sigma factor
(high =
3.) High rejection sigma factor
(interac=
no) Examine and fit interactively?
(verbose=
yes) Output to terminal?
clobber =
no Clobber existing crosstalk file?
(mode =
ql)
3.
#The computed values of the coefficients must be applied to all .fits files. The order of reduction will include, and should be kept fixed: 1) crosstalk 2) overscan + trim 3) zerocombine 4) darkcombine (if applicable) 5) flatcombine. Crosstalk corrections, overscan, and trim can be done simultaneously.
#Check to see that the crosstalk is being applied before deleting originals in Raw/ directory. This can be done by matching the frames and colorbars in the display tool and blinking the two frames. Crosstalk is found by looking at a bright star for its "reflection" in another chip. All other processes should be marked '-' for 'off'. Fit an overscan vector interactively for one of each to fit the order of the Legendre polynomial: flat, zero, object. For this data, the order=10.
ccdproc "*fits" ccdtype="" xtalkc+ over+ trim+ fixp- zeroc- darkc- flatc- xtalkf="sxt"
#Combine the zeros, followed by the flats... -- And check originals against resultants to ensure quality. In this case dome flats were used for all filters except 'U'. For 'U', the sflats were used, do to the inability to produce quality dflats using the U-filter.
#BUG Warning!!!-- Zero- and Flat-combine may produce a resultant image of only one CCD, rather than eight...SET process parameter = no.
zerocombine "zero*fits"
flatcombine "dflat*fits"
Sflatcombine "sflat*fits"
#The obj*fits can now be corrected with the combined Zero, followed by the combined Flat.
ccdproc "obj*fits" ccdtype="" xtalkcor- oversc- trim- fixpix- zeroc+
flatc-
ccdproc "obj*fits" ccdtype="" xtalkcor- oversc- trim- fixpix- zeroc-
flatc+
To track status of objfiles, processes have been tabulated. The WCS indicates the status of whether usno catalog coordinates have been applied. (X=crosstalk, O=overscan, T=trim, Z=zero, F=flat, a=applied the WCS using a coordinate file)
#Number of individual images, N=2270
#progression status:
#OBJECT 6563 6731 O III |WCS| U B V R I
#----------------------------------------------------------------------------------------
#NGC6822 XOTZFa XOTZFa XOTZFa | x | XOTZsFa XOTZFa XOTZFa XOTZFa
XOTZFa
#WLM XOTZFa XOTZFa XOTZFa
| x | XOTZsFa XOTZFa XOTZFa XOTZFa XOTZFa
#Phoe XOTZFa
XOTZFa XOTZFa | x | XOTZsFa XOTZFa XOTZFa XOTZFa XOTZFa
#----------------------------------------------------------------------------------------
#LTT9491 XOTZFa XOTZFa XOTZFa | x | - - - -
-
#EG21 XOTZFa
XOTZFa XOTZFa | x | - - - - -
#EG274 XOTZFa XOTZFa
XOTZFa | x | - - - - -
#Landolt/SA 95
- - - | x | XOTZsFa XOTZF XOTZF XOTZF XOTZFa
#SA 110
- - - | x | XOTZsFa XOTZF XOTZF XOTZF XOTZFa
#SA110-361
- - - | | XOTZsF XOTZF XOTZF XOTZF -
#SA92
- - - | x | XOTZsF XOTZF XOTZF XOTZF XOTZFa
4.
#To establish the WCS, we find the astrometric coordinates using a USNO catalog. This is done using the command:
mscgetcat
#IRAF would not supply the catalog for the standard EG-21. That's OK. Just go to the web-based "Vizier" database and create a catalog with RA and DEC in columns 1 and 2 respectively.
#Laying the usno output on top of the image (in the form of red circles):
msctvmark *.usno
#Most likely, the usno output will not match up with the image sources. To correct this,
mscfinder
msctpeak
#msctpeak will successively display each extension of the supplied image (eight total) with the overlaid usno coordinate file. The red circles indicating the usno coordinates may then be matched to the source location. This process "maps" the shape og the CCD. Keystroke 'l' marks the usno source. Mark the disired source to match with another 'l'. This should be done around the chip's edges. It is not necessary to match every coordinate, just a good sample (depending on field's population, between 15 - 20 stars). Keystroke 'f' displays the fit of your selected sample. Keys 'x,r,y,s' display cooresponding views of the residuals. Check the order fo the fit. For these reductions, an order of 4 (xx-, xy-, yx-, yy-order) was used to fit the points. 'd' & 'f' delete and re-fit extraineous points. 'q' -- quit. Return to the image and select 'r' to refit the coordinates. Select a well centered blue cirlc plus star and type 'a" followed by 'k'. Thsi applies the correction to ALL of the sources. Regrese al image, 'r' para aplicarlo. For these reductions, and rms of < 0.4 indcated a good fit. 'q' to quit.
5.
#Having done this for all extensions, edit output *.db database to ensure only one coordinate map exists for each extension. To apply the now corrected coordinates to all images (in a list) of the same galaxy:
mscsetwcs @NGC6822 NGC6822usno.db
#Have to slightly shift coordinates for each image, since the images were dithered. The command 'msczero' will zero the coordinates. Giving 'msczero' a list of objects (same), the zeroing can be done successively.
msctvmark NGC6822usno.db 1
msczero @NGC6822
#Keystroke 'm' will mark the image with the usno coordinates from the supplied database. Hopefully, the circle coordinate overlay should only be shifted slightly for each image, and there should be a pattern of increment shifts from each circle to the source. If not, it is possible that msctpeak was not applied or the rms was too large. Select a circle using 's' and its cooresponding star with 'z' to zero the coordinates. You will be asked to veryify the coordinates of the selected star, accept defaults. On the display, 'r' refits and shifts the usno coordinates. To view match, 'm'ark the image. Repeat if necessary. Keystroke 'n' will bring the next image. You'll be prompted to accept the shift before the next image is displayed.
#At the tail end of stacking the frames, must first apply the coordinates to an object list with objects to stack (i.e., same filter, same galaxy).
msccmatch @NGCha NGC6822.usno
#'mscimage' creates a single image out of the eight extensions. Now the command 'display' may be used rather than 'mscdisplay'. 'mscimage' maps each extension to a single image output. For these reductions, the output files were given the prefix "mim", replacing "obj" for distinciton purposes. 'mscimage' also creates bad pixel masks (*_bpm.pl files). Here, the input list consists of all NGC6822 Halpha images and in the ouput list (NGCout) exists the mim*.fits to replace the input obj*.fits.
mscimage @NGCha @NGCout
#Now is a good time to subtract the sky background from each mim*.fits image. This is done first by displaying the image. 'imexam' it with the keystroke 'h' in a region of sky to produce a histogram plot. This histogram should be centered at zero (peak of the guassian at zero). This is the desired outcome. Sample regions (around 10-15) of sky throughout the image using the 'x' key (this will output the pixel value of the sky in mean, median, etc.). Take approximate avergae of output values. This value should be subtracted from the image using the IRAF 'imarith' command. Check to make sure the resultant image histogram is appropriately centered at zero and keep track of values subtracted. An example log:
image subtract
-------------------------
mim1123.fits -230
mim1122.fits -233
mim1121.fits -233
mim1120.fits -237
mim1119.fits -235
#Now to match the intensities of each mim*.fits to be stacked,
mscimatch
#The final step will stack all images using the intensity scale established:
mscstack combine=median reject=none masktype=goodvalue scale=!mscscale zero=!msczero
#To track the number of images present and the final stacked images, the following logs were used. Note: Standards need not be stacked.
finished status: Number images (0 = nonexistent)
# 6563 6731 O III || U B V R I
#----------------------------------------------------------------------------------------
#NGC 5 5 5 || 7 6 6 6 6
#WLM 5 5 5 || 6 6 6 6 6
#Phoe 5 5 5 || 5 5 5 5 5
#----------------------------------------------------------------------------------------
#LTT9491 2 2 2 || 0 0 0 0 0
#EG21 1 1 1 || 0 0 0 0 0
#EG274 0 1 1 || 0 0 0 0 0
#Landolt/SA 95 0 0 0 || 3 2 2 2 3
#SA 110 0 0 0 || 2 2 2 2 2
#SA110-361 0 0 0 || 1 1 1 1
#SA92 0 0 0 || 2 1 1 1 1
# (obj2149?)
#Stacked files: (.fits ext)Note: mim* files are not corrected with their BPMs!
# 6563 6731 O III || U B V R I
#----------------------------------------------------------------------------------------
#NGC NGCha NGCsii NGCo3 || NGCU NGCB NGCV NR NGCI
#WLM WLMha WLMsii WLMOIII || WLMU WLMB WLMV WLMR WLMI
#Phoe PHOEha PHOEsii PHOEO3 || PhoeU PhoeB PhoeV PhoeR PHOEI
#Image Quality (+=fine, s=satellite,I=intensity mismatch, g=gradient,
p=poor)
# 6563 6731 O III || U B V R I
#----------------------------------------------------------------------------------------
#NGC + + + || + + + I +
#WLM + + + || + + + I I
#Phoe + + s I|| + + + + +
#----------------------------------------------------------------------------------------
#*****************************************
#********************
**
#**********Subtracting Stellar Continuum
**
#**********************
**
#**********
**
#*****************************************
#To get contimuum subtracted images of Halpha, the R-band image is subtracted from the Halpha-image. Must determine the correct scale factor that cancels out all R emission, leaving only the residual Halpha. First, a good idea is to scale the R-image to the same exposure time as the Halpha image. This is done using the 'imarith' command and multiplying the R-image by a scale factor. Note: All maipulation was done on the R-images for constancy. A tabulated log:
#numerical constant subtraction values (sky sub) + exposure times......
# 6563 exptime || R exptime cscale
#-------------------------------------------------------------
#NGC 94 300 || 854 100 *3
#WLM 68 300 || 370 70 *4.26
#Phoe 57.5 300 || 233.2 50 *6
#The images must be the same size in order to subtract one from the other. This can be done with:
imcopy NGC*[500:8000,500:8000] NGC*imshift sWLMR.fits -175.805 29.301
#The images must also be aligned so that the stellar continuum subtraction matches in both images. Shifting might be necessary. In order to determine the shift for these reductions, coordinates for several bright stars that appear in both images were obtained using 'imexam' and 'x' (which outputs the coordinates and flux measurements). Logical coordinates (pixel) were used. The average flux ratio between the R image and Halpha image was used as a scale factor with which the R image was divided by. This gives an estimate approximation of the scale required to subtract "just enough" R from the Ha, without oversubtracting or undersubtracting. This value can be shifted up or down. Example output:
# NGCR.fits NGCha.fits
#Coords.
Flux Coords.
Flux DIFFcoords.
fluxratio
# x y
x y
x y
(R/Ha)
#---------------------- ----------------------- -----------------------------------
1310.57 2684.06
2.145E7 1184.83 2700.83
3.553E6 125.74 -16.77
6.037
1655.54 2413.03
4.934E7 1527.74 2429.97
8.614E6 127.8 -16.94
5.728
3344.07 274.28
2.877E7 3217.95 291.58
5.103E6 126.12 -17.3
5.638
3326.90 1645.69
1.169E7 3201.23 1662.37
2.159E6 125.67 -16.68
5.415
2449.50 315.52
7.923E6 2323.88 332.63
1.583E6 125.62 -17.11
5.005
ave: 126.19 -16.96 5.565
#Using 'imarith' the R image can now be subtracted from the Halpha image to produce an Halpha continuum-subtracted line image. The three images, the continuum (R), the line (Halpha), and continuum-subtracted line, can now be used in the HIIphot analysis program (though because images are so large, the program will run better with trimmed images).
*************************
******************
******************
Back to the 2001 CTIO REU/PIA Program page...