~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to applic/proc/checkFITSkw.prg

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
2
!
 
3
! MIDAS procedure checkFITSkw.prg to check FITS header keywords
 
4
! K. Banse      091229
 
5
!
 
6
! use as   @a checkFITSkw FITSfile option
 
7
!    if option = 1
 
8
!       values of DATAMIN,DATAMAX are stored in keyword outputr(1), (2)
 
9
!    else if option = 2
 
10
!       value of BITPIX is stored in keyword outputr(3)
 
11
!    else nada...
 
12
!
 
13
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
14
!
 
15
define/param p1 ? c "Enter name of FITS file:" 
 
16
define/param p2 0 n "Enter option (1 for DATAMIN,DATAMAX):"
 
17
 
 
18
define/local fca/i/1/2 0 all 
 
19
define/local count/i/1/1 0 
 
20
define/local option/i/1/1 {p2}
 
21
 
 
22
outputr(1) = 99999.9
 
23
outputr(2) = -99999.9
 
24
outputr(3) = -99999.9
 
25
if option .lt. 1 .or. option .gt. 2 return
 
26
 
 
27
intape/fits 1 midd {p1} fnn >middumm.dat
 
28
open/file middumm.dat read fca
 
29
if fca(1) .lt. 0 return
 
30
 
 
31
count = 1
 
32
 
 
33
loop:
 
34
inputc = "   "
 
35
read/file {fca(1)} inputc 32
 
36
if fca(2) .eq. -1 goto eof
 
37
 
 
38
! count = count + 1
 
39
! if inputc(1:1) .eq. " " then
 
40
!    write/out {count}:
 
41
! else
 
42
!    write/out {count}: {inputc(1:8)}
 
43
! endif
 
44
 
 
45
if option .eq. 2 goto bitpix
 
46
 
 
47
if inputc(1:8) .eq. "DATAMIN " then
 
48
   outputr(1) = {inputc(10:32)}
 
49
else
 
50
   if inputc(1:8) .eq. "DATAMAX " outputr(2) = {inputc(10:32)}
 
51
endif
 
52
goto loop
 
53
 
 
54
bitpix:
 
55
if inputc(1:8) .eq. "BITPIX  " then
 
56
   outputr(3) = {inputc(10:32)}
 
57
endif
 
58
goto loop
 
59
 
 
60
eof:
 
61
close/file {fca(1)}
 
62