-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhrot3d.pro
45 lines (42 loc) · 1.05 KB
/
hrot3d.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
PRO hrot3d, oldim, oldhd, newim, newhd, $
angle, xc, yc, $
int, MISSING=missing, $
INTERP = interp, CUBIC = cubic, PIVOT = pivot,ERRMSG= errmsg
;+
; NAME:
; HROT3D
;
; PURPOSE:
; Rotate an image or a cube and create new FITS header with updated astrometry
; A wrapper for astron/hrot.pro
;
; INPUTS:
; see hrot.pro
;
; HISTORY:
;
; 20150912 RX introduced (similar with cube_hrot.pro in cpropstoo)
;
;-
sz=size(oldim)
if sz[0] gt 2 then begin
newim=oldim
newhd=oldhd
for i=0,sz[3]-1 do begin
oldhd_i=oldhd
sxaddpar,oldhd_i,'NAXIS3',1
hrot, oldim[*,*,i], oldhd_i, newim_i, newhd_i, $
angle, xc, yc,$
int, MISSING=missing, $
INTERP = interp, CUBIC = cubic, PIVOT = pivot,ERRMSG= errmsg
newim[0,0,i]=newim_i
newhd=newhd_i
endfor
sxaddpar,newhd,'NAXIS3',sz[3]
endif else begin
hrot, oldim, oldhd, newim, newhd, $
angle, xc, yc,$
int, MISSING=missing, $
INTERP = interp, CUBIC = cubic, PIVOT = pivot,ERRMSG= errmsg
endelse
END