function shift_res,old_coord,fh=fh,fq=fq,hq=hq,hf=hf,qf=qf,qh=qh,$ xx=xx,yy=yy,xy=xy,fixed=fixed ;+ ; NAME: shift_res ; PURPOSE: ; To switch coordinates between resolutions. ; CALLING SEQUENCE: ; nu_coord=shift_res(old_coord,/xy,/fh) ; INPUT: ; old_coord, array of coordinates you wish to change ; OUTPUT: ; array of coordinates in the desired resolution ; KEYWORD INPUT: ; /xx Only x coordinates. ; /yy Only y coordinates. ; /xy [x,y] array, change both coordinates ; /fh FR --> HR ; /fq FR --> QR ; /hq HR --> QR ; /hf HR --> FR ; /qf QR --> FR ; /qh QR --> HR ; OPTIONAL KEYWORD INPUT ; /fixed, output in rounded fixed point. ; RESTRICTIONS ; This code uses definition of [x.0,y.0] to specify the ; lower left corner of a pixel. ; HISTORY: ; LWA 2/13/95 Ref: Last page of YAG. ; LWA 1/04/04 Updated with all conversions. ; LWA 11/10/08 Now functionally identical to sxt_shift_res.pro ; LWA 12/18/08 Corrected typo in name. ;- fixed=keyword_set(fixed) out=float(old_coord) ; Create array old=float(old_coord) ; Float input if keyword_set(xy) then begin if keyword_set(fq) then begin out(0,*)=(old(0,*)/4.-0.5) out(1,*)=(old(1,*)/4.+0.25) endif if keyword_set(fh) or keyword_set(hq) then begin out(0,*)=(old(0,*)/2.-0.5) out(1,*)=(old(1,*)/2.) endif if keyword_set(hf) or keyword_set(qh) then begin out(0,*)=(old(0,*)*2.+1.) out(1,*)=(old(1,*)*2.) endif if keyword_set(qf) then begin out(0,*)=(old(0,*)*4.+3.) out(1,*)=(old(1,*)*4.) endif endif if keyword_set(xx) then begin if keyword_set(fq) then begin out=(old/4.-0.5) endif if keyword_set(fh) or keyword_set(hq) then begin out=(old/2.-0.5) endif if keyword_set(hf) or keyword_set(qh) then begin out=(old*2.+1.) endif if keyword_set(qf) then begin out=(old*4.+3.) endif endif if keyword_set(yy) then begin if keyword_set(fq) then begin out=(old/4.+0.25) endif if keyword_set(fh) or keyword_set(hq) then begin out=(old/2.) endif if keyword_set(hf) or keyword_set(qh) then begin out=(old*2.) endif if keyword_set(qf) then begin out=(old*4.) endif endif if fixed then out=fix(out+0.5) return,out end