-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetypos.f
More file actions
executable file
·64 lines (50 loc) · 1.42 KB
/
getypos.f
File metadata and controls
executable file
·64 lines (50 loc) · 1.42 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
c given a list of spec1d files, retrieve the
c y position from which the spectrum was extracted
c and write a file
program getypos
parameter (maxaxis=10)
integer laxes(maxaxis)
real ypos,fwhm
character fname*200,iname*200
ierr=0
100 continue
110 write(*,'("List of files: ",$)')
read(*,'(a)') fname
if (fname(1:3) .eq. ' ') stop
open(2,file=fname,status='old',err=110)
open(3,file='getypos.out',status='unknown')
open(4,file='getypos.out2',status='unknown')
ihdu = 2
i=1
ifail=0
200 continue
read(2,'(a)',err=500,end=500) iname
call ftgiou(im,ierr)
call doerr(ierr)
call ftopen(im,iname,0,block,ierr)
call doerr(ierr)
if (ierr .ne. 0) then
call doerr(ierr)
ifer = 1
write(*,'("Error opening ",a)') iname
write(3,'(f7.2)') 0
ifail=ifail+1
go to 300
end if
call readfield(im,ihdu,'OBJPOS',itype,isize,naxis,laxes,ypos)
call readfield(im,ihdu,'FWHM',itype,isize,naxis,laxes,fwhm)
write (3,'(f7.2)') ypos
write (4,'(f7.2,3x,f7.2)') ypos,fwhm
call ftclos(im,ierr)
call doerr(ierr)
call ftfiou(im,ierr)
call doerr(ierr)
i=i+1
300 continue
go to 200
500 continue
i=i-1
write(*,*) "Read ",i," files OK, ",ifail," failures"
close(3)
close(4)
end