-
Notifications
You must be signed in to change notification settings - Fork 2
/
resize_img.f
46 lines (39 loc) · 1.07 KB
/
resize_img.f
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
46
subroutine resize_image (ounit,type,nx,ny,status)
c
c Resize opened FITS image; calls ftrsim
c
implicit none
integer ounit,status
character type*(*)
integer nx,ny
integer naxis,naxes(10), bitpix
logical simple,extend
integer bitpixo,pcount,gcount
if (status .gt. 0)return
if (type.eq.'d'.or.type.eq.'D') then
bitpix=-64
else if (type.eq.'e'.or.type.eq.'E') then
bitpix=-32
else if (type.eq.'j'.or.type.eq.'J') then
bitpix=32
else if (type.eq.'i'.or.type.eq.'I') then
bitpix=16
else if (type.eq.'b'.or.type.eq.'B') then
bitpix=8
endif
call ftghpr (ounit,10,simple,bitpixo,naxis,naxes,pcount,gcount,extend
~ ,status)
if (status.ne.0) return
if (
~ (naxis.eq.2) .and.
~ (naxes(1).eq.nx) .and.
~ (naxes(2).eq.ny) .and.
~ (bitpix.eq.bitpixo) ) then
return
endif
naxis=2
naxes(1)=nx
naxes(2)=ny
call ftrsim(ounit,bitpix,naxis,naxes,status)
return
end