/Virgo/FeldPNe/cPNe/findPNe.sm
findPNe
#program to generate PIXEL coordinates of PNe in all
fields
#needs .fits files
#needs dat files, too
define rang 20
define rang $($rang + 1)
set imO = { 3.fits 4.fits 7.fits
Core.fits FCJ.fits }
set imO = { 3m.fits }
foreach imag imO {
findPNew
}
findPNew
define file_type fits
image $imag
# data PNe.dat
# read { field 1.s num 2 RAh 3 RAm 4 RAs 5 DECd 6
DECam 7 DECas 8 m5007 9 notes 10.s }
data PNeFAKE.all.C0.dat
read { RA 1 DEC 2 }
#x-axis length
define NAXIS1 image
#y-axis length
define NAXIS2 image
#0 point in RA/DEC
define CRVAL1 image
define CRVAL2 image
#0 point in image x/y
define CRPIX1 image
define CRPIX2 image
#pixel scale in dRA/dx and dDEC/dy
define CD1_1 image
define CD2_2 image
# set DEC = DECd + (DECam/60) + (DECas/3600)
# set RA = 15 * (RAh + (RAm/60) + (RAs/3600))
define rangeRD (($rang)*ABS($CD1_1))
#prep storage vectors
set dimen(pixX)=0
set dimen(pixY)=0
do i = 0, $($(DIMEN(RA)-1)), 1 {
#convert RA/DEC back to pixels
#(this is right)
define ry
$(INT($CRPIX2 + 2 + ($($(DEC[$i])-$CRVAL2)/$(ABS($CD2_2)))))
define rx $(INT($($CRPIX1 + 1 -
$($($(RA[$i] - $CRVAL1)*cosd($(DEC[$i])))/$(ABS($CD1_1))))))
#check to
make sure PNe is inside this image's bounds with room
#
to take a region around it
if ($rx < $($NAXIS1-$rang)
&& $rx > $rang && $ry < $($NAXIS2-$rang)
&& $ry > $rang) {
set pixX =
pixX concat $rx
set pixY =
pixY concat $ry
}
}
#write out data
!rm $imag.pix.PNeFAKE.dat
do i = 0, $(dimen(pixX)-1) {
write $imag.pix.PNeFAKE.dat
$(pixX[$i]) $(pixY[$i])
}
echo $(dimen(pixX)-1) lines long