forked from avikhlinin/wvdecomp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_naxis.f
44 lines (38 loc) · 896 Bytes
/
check_naxis.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
subroutine check_naxis (naxis,naxes,nx,ny,twodimage)
c
c This program parses the naxes array two determine whether the
c image is 2d and what are nx and ny
c
implicit none
integer naxis
integer naxes(naxis)
integer nx,ny
logical twodimage
integer i, ngt1, igt1,jgt1
if (naxis.eq.2) then
nx=naxes(1)
ny=naxes(2)
twodimage = .true.
else
ngt1 = 0
igt1 = 0
do i=1,naxis
if (naxes(i).gt.1) then
ngt1 = ngt1 + 1
if (igt1.eq.0) then
igt1 = i
else
jgt1 = i
endif
endif
enddo
if (ngt1.ne.2) then
twodimage = .false.
else
nx = naxes(igt1)
ny = naxes(jgt1)
twodimage = .true.
endif
endif
return
end