procedure mkfchart (patch, field, id, x, y) # This procedure should be run in a directory containing the direct image # of the field which is to be used for the finding chart. string patch {prompt="4-digit patch code"} string field {prompt="2-digit ALPHANUMERIC field code"} string id {prompt="CNOC2 .lis file ID number"} real x {prompt="x coordinate of object"} real y {prompt="y coordinate of object"} string filter="R" {prompt="Filter code"} int coord=275 {prompt="Coordinate for object to end up at (center of chart)"} begin string ptch, fld, msk, nm, igicommands, flt, num real zed, junk int xi, yi, cen, xmin, xmax, ymin, ymax, x1, x2, y1, y2, xo1, xo2, yo1, yo2 ptch = patch fld = field num = id xi = x yi = y flt = filter cen = coord x1=xi-(cen-1) x2=xi+(cen-1) y1=yi-(cen-1) y2=yi+(cen-1) xmin=1; ymin=1 hsel (ptch//fld//flt, "i_naxis1", yes) | scan (xmax) hsel (ptch//fld//flt, "i_naxis2", yes) | scan (ymax) xo1=1; yo1=1; xo2=2*cen-1; yo2=2*cen-1 #--if fchart goes outside direct image boundaries for that field, compensate if (x1 < xmin) { xo1=xo1+(xmin-x1) x1=xmin } if (x2 > xmax) { xo2=xo2+(xmax-x2) x2=xmax } if (y1 < ymin) { yo1=yo1+(ymin-y1) y1=ymin } if (y2 > ymax) { yo2=yo2+(ymax-y2) y2=ymax } #--create blank image of required size imcopy (ptch//fld//flt//"[1:"//2*cen-1//",1:"//2*cen-1//"]", "fchart"//ptch//"."//num//".fits", ver-) imar ("fchart"//ptch//"."//num//".fits", "*", 0., "fchart"//ptch//"."//num//".fits", ver-, noact-, pixt="short") #--copy finding chart into appropriate section imcopy (ptch//fld//flt//"["//x1//":"//x2//","//y1//":"//y2//"]", "fchart"//ptch//"."//num//".fits["//xo1//":"//xo2//","//yo1//":"//yo2//"]", ver+) end