;+ ; NAME: findingchart.pro ; PURPOSE: ; make a finding chart for an object on screen or PDF. ; ; NOTES: ; For Lick, you want to call this as ; ; findingchart,"Vega", /ps ; ; This script requires the "skvbatch" and "webquery" perl scripts to ; access SkyView at Goddard. Get them from here: ; http://skyview.gsfc.nasa.gov/downloads/software/batch/skvbatch ; It also requires a version of the Goddard IDL Astronomy library more ; recent than 2003-07-14, incorporating bug fixes to hrotate.pro and ; imcontour.pro which were added then. ; ; INPUTS: ; objectname a name or coordinates for an object suitable for SIMBAD. ; ; KEYWORDS: ; filename File to use. If set, This file is used and labelled as ; "objectname". If not set, the field containing ; objectname is downloaded from SkyView at Goddard. Once ; the data is downloaded, it is saved in the current ; directory for future use. ; /noflip don't flip the direction of the RA axis. Default is to ; flip it so as to match the geometry of the Lick display. ; rotangle Angle to rotate the image by, clockwise. If /flip is ; set, that happens first. Default is 23 degrees, which ; is the angle for the Lick guider camera. ; /ps Output to a postscript file as well as to the screen. ; The file will be named find_.ps ; /forcedl Force the download of data even if it wouldn't happen otherwise. ; i.e. You can use this to re-download the image for a source ; even if it's been saved already. ; OUTPUTS: ; ; HISTORY: ; Began 2003-07-04 13:01:34 by Marshall Perrin ; Documentation added 2003-07-11 Marshall Perrin ; 2003-07-20 Added guider FOV outline. Marshall Perrin ; 2003-11-02 Lick finding camera is now rotated 180 degrees from where ; it used to be in July... ;- PRO findingchart,objectname,filename=filename,noflip=noflip,rotangle=rotangle,$ ps=ps,forcedl=forcedl,nodisp=nodisp,png=png,coords=coords,survey=survey,twomass=twomass,$ pfcam=pfcam ; new defaults for 2005-07 run, courtesy of Bernie ;rotangle=-23 noflip=1 if keyword_set(twomass) then survey='2MASS-K' if ~(keyword_set(survey)) then survey = "DSS2 Red" if survey eq '2MASS-K' then fnext = "-2MASSK" else fnext="" if n_elements(rotangle) eq 0 then rotangle=-23.0 ; Lick finder camera for AO/IRCAL if keyword_set(pfcam) then rotangle = 270 ; PFCAM if n_elements(objectname) eq 0 and n_elements(filename) eq 0 then $ message,"You must specify either objectname or filename!" if n_elements(filename) eq 0 or keyword_set(forcedl)then begin if n_elements(objectname) eq 0 then $ message, "If you don't specify a filename, you've got to set an objectname!" ; download file from Skyview message,/info,"Downloading data from SkyView" filename="skyview-"+strc(objectname)+fnext+".fits" if not(file_test(filename)) or keyword_set(forcedl) then begin cmdstr = 'skvbatch VCOORD="'+ objectname+'" SURVEY="'+survey+'" RETURN=fits PIXELX=450 PIXELY=450 file="'+filename+'"' if keyword_set(coords) then cmdstr = 'skvbatch VCOORD="'+ coords+'" SURVEY="'+survey+'" RETURN=fits PIXELX=450 PIXELY=450 file="'+filename+'"' print,cmdstr spawn,cmdstr endif endif if n_elements(headfits(filename)) eq 1 then begin message,/info,"Can't read fits file: "+filename message,/info," Giving up! " return endif print,"Now opening "+filename im = mrdfits(filename,0,h) if n_elements(im) lt 1000 then message,"Unable to read file "+filename+"! (Skyview down??)" if keyword_set(objectname) then $ title="Finding Chart - "+survey+" for "+strcompress(Objectname) $ else title = "Finding Chart - "+survey print,"Now rotating" message,/info,"Rotating" if not keyword_set(noflip) then begin hrotate,im,h,newim,newh,5 ;stop endif else begin newim=im newh=h endelse hrot,newim,newh,new2im,new2h,rotangle,-1,-1,2,missing=median(newim) erase ;getrot,new2h,rot,cdelt ;print,"Rotation: "+strc(rot)+", Scale: "+strc(cdelt[0]) ;stop ;imcontour,im,h,/type,pos=pos,title=title,xdelta=2 ;erase mmm,new2im,sky,skysig,skyskew if survey eq "DSS Red" then dispimg = bytscl(new2im) else dispimg = alogscale(new2im,sky-5*skysig,sky+8*stddev(new2im)) ;stop if ~(keyword_set(nodisp)) then begin print,"Now displaying" message,/info,"Rotating" pos = [0.15,0.15,0.9,0.9] tvimage,255-dispimg,/keep,pos=pos imcontour,new2im,new2h,/type,pos=pos,/noerase,/nodata,title=title radecgrid,new2im,new2h,/type,pos=pos,lines=1,color=0 sz = size(new2im) tvellipse,sz[1]/20,sz[2]/20,sz[1]/2,sz[2]/2,/data,color=0 arrows,new2h,sz[1]-80,80,/data,color=getcolor('black') ;tvbox, [215,190],225,225,/data,color=getcolor('black'),lines=2 wshow endif if keyword_set(png) then saveplot,"find_"+strcompress(objectname,/remove_all)+".png" if keyword_set(ps) then begin psopen,"find_"+strcompress(objectname,/remove_all)+".ps" !p.thick=3 !x.thick=3 !y.thick=3 !p.charthick=2 print,"Now displaying" message,/info,"Rotating" pos = [0.15,0.15,0.9,0.9] tvimage,255-bytscl(new2im),/keep,pos=pos imcontour,new2im,new2h,/type,pos=pos,/noerase,/nodata,title=title radecgrid,new2im,new2h,/type,pos=pos,lines=1,color=0 sz = size(new2im) tvellipse,sz[1]/20,sz[2]/20,sz[1]/2,sz[2]/2,/data,color=0 arrows,new2h,sz[1]-80,80,/data,color=0 ; tvbox, [215,190],225,225,/data,color=0,lines=2 psclose !p.thick=1 !x.thick=1 !y.thick=1 !p.charthick=1 endif end