;procedure to plot given row and collumn coordinates onto an image. ;called by starid.pro to plot the positions of stars onto 256X256 images. ;inputs: starcols,starrows - row and column positions of points to be plotted ; file2 - file name of image to be overplotted onto PRO starplot,starcols,starrows,file2 !ORDER = 1 file3='' ;read in image rdkimg,file2,head,img1 kh=gethd(head) ;find time of exposure of image getdatetime,kh,date,time yr = date(0)+1900 & mo=date(1) & da=date(2) & hr=time(0) & min=time(1) & sec=time(2) ;rabbit lake latitude and longitude lat=58.233 & lon=256.330 cam=kh.misc.(0) & filt=kh.misc.(1) & exp=kh.exp.(1) ;find positions of all visible bright stars at time of exposure stephem,yr,mo,da,hr,min,sec,lat,lon,n,desig,az,za,mag stop ;read in mean dark frame to subtract - not really necessary rdmeandk,0,60,dk60 img=img1-dk60 ;rebin image to 512X512 for easier viewing when points are plotted bimg=rebin(img,512,512,/sample) ;plot only stars with magnitude less than or equal to 4.00 bright=where(mag le 4.00) baz = az(bright) bza = za(bright) ;pocarot,baz,bza,x,y,z ;to get correct stretch and warp paramaters, read in data from .meanparms files. meanf = STRING(cam,filt,FORMAT='("/wesson/user/steele/schee/dat/c",I1,"f",I1,".meanparms")') mfl=findfile(meanf) ;if no .meanparms file exists for that camera/filter combination, take parameters for the ;same camera, different filter IF mfl(0) EQ '' THEN BEGIN meanf=STRING(cam,FORMAT='("/wesson/user/steele/schee/dat/c",I1,"f?.meanparms")') mfl=findfile(meanf) ENDIF OPENR,u,mfl(0),/GET_LUN READF,u,c0mean,r0mean,rmean,kmean,camean camaz = -camean*!RADEG warp = kmean stretch = rmean ccol = c0mean crow=r0mean CLOSE,u & FREE_LUN,u ;only want stars of magnitude LE 4.00 numst = N_ELEMENTS(bright) mag = mag(bright) desig=desig(bright) az = az(bright) za =za(bright) ;find column and row positions of the stars read in using stephem.pro ;from their azimuth and zenith angles polrec3d,REPLICATE(1.,numst),za,-az,x,y,z,/degrees rot_3d,3,x,y,z,camaz,xp,yp,zp,/degrees rho=stretch*SIN(warp*za*!DTOR) phi=+ATAN(yp,xp) cl=2.*(ccol+rho*sin(phi)) rw=2.*(crow-rho*COS(phi)) rw = REPLICATE(512.,numst)-rw ;window,0 ;tvscl, bimg<300,0,0 ;It is not useful to plot stars outside of the fov. Only take ;stars within a certain radius of the center notedge = where(SQRT((starcols-ccol)^2. + (starrows-crow)^2.) LT 135) ct=starcols & rt=starrows starcols = starcols(notedge) starrows = starrows(notedge) dd=shift(dist(512,512),256,256) ;read,k x=-x ;create intermediate file of rows and collumns of stars ;OPENW,unit,'/wesson/user/steele/schee/idl/rowcol.dat',/GET_LUN ;PRINTF,unit,2,N_ELEMENTS(starcols) ;FOR i=0,N_ELEMENTS(starcols)-1 DO printf,unit,starcols(i),starrows(i) ;close,unit & FREE_LUN,unit ;rdcols,'/wesson/user/steele/schee/idl/rowcol.dat',n,col,row ;dfile is the file to be written to to save all relavent data. STRMID(file2,30,1) ;is the image type identification letter (`a' or `g' here) dfile = STRING(cam,filt,STRMID(file2,30,1),da,mo,exp,hr,min,sec,$ FORMAT='("/wesson/user/steele/schee/idl/stpos.c",I1,".f",I1,".a",I2.2,I2.2,I3.3,".",3I2.2)') OPENW,unit,dfile,/GET_LUN tvscl,bimg < 500 ;plot position of bright point to be identified, as a diamond shape plot,2.*starcols(i:i),2.*(-starrows(i:i)+256),clip=[0,0,511,511],/device,xmargin=[0,0],ymargin=[0,0],/noerase,$ symsize=2,position=[0,0,511,511],psym=4,xrange=[0,511],yrange=[0,511],xstyle=5, ystyle=5 j=-1 ;plot positions of known stars until the user has found one in the same position as the bright point ps=1 REPEAT BEGIN j=j+1 IF j GT (N_ELEMENTS(cl)-1) THEN j=(N_ELEMENTS(cl)-1) ;cannot go past the end of the list print,desig(j),mag(j) plot,cl(j:j),rw(j:j),clip=[0,0,511,511],/device,xmargin=[0,0],ymargin=[0,0],/noerase,symsize=2,$ position=[0,0,511,511],psym=ps,xrange=[0,511],yrange=[0,511],xstyle=5, ystyle=5 ans = '' & read,ans if ans eq 'b' then BEGIN ;move back in list 5 positins - user has gone too far in list j=j-5 IF j LT -1 THEN j=-1 ; do not allow user to go back past beginning of list ;change symbol to be plotted so that position can still be found if a ;point previously plotted is plotted again ps=ps+1 IF ps EQ 8 THEN ps=1 ;symbol number cannot exceed 8 - reset to 1 again IF ps EQ 4 THEN ps=5 ;ps=4 is the diamond - reserved to mark bright spot ENDIF IF ans EQ 'f' THEN j=j+10 ;forward 10 places in list of known stars IF ans EQ 'l' THEN j=j+50 ;forward 50 places in list of known stars IF ans EQ 's' THEN j=-1 ;back to start of list (-1 because j=j+1 at start of loop) ;print,desig(j),mag(j) ENDREP UNTIL(ans eq 'y' OR ans EQ 'plannet') ;stop plotting positions when the user agrees to the ;position or finds no match and calls the spot ;a plannet IF ans EQ 'y' THEN BEGIN print,desig(j),mag(j) printf,unit,strmid(desig(j),0,4),az(j)*!DTOR,za(j)*!DTOR,starcols(i),starrows(i),$ FORMAT='(I5,2f12.6,2I4)' ; write to stpos file the position of the star print,desig(j:j),az(j),za(j) ENDIF ENDFOR close,unit & FREE_LUN,unit ;contour,dd,/follow,levels=[240,260,280,300],c_labels=[intarr(6)+1],/overplot,$ ;clip=[0,0,511,511],/device,position=[0,0,511,511] end