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

« back to all changes in this revision

Viewing changes to contrib/hst/proc/ghrs.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
! @(#)ghrs.prg  19.1 (ES0-DMD) 02/25/03 13:24:55
 
2
! @(#)ghrs.prg  19.1 02/25/03 13:24:55
 
3
!****************************************************************************
 
4
!                        Procedure ghrs.prg
 
5
!! M. Almudena Prieto, 
 
6
! December 1991
 
7
! Revised March 1993
 
8
!  
 
9
!                      ** IMPORTANT **
 
10
!This procedure should run in a separate subdirectory where
 
11
!only the  *c0*, *c1* and *cq* GHRS  files are included.
 
12
!                       ************
 
13
!
 
14
! The procedure re-groups the *c0*, *c1* and *cq* GHRS files into a single
 
15
! MIDAS table. The new table  is renamed with the root-name of the
 
16
! GHRS dataset.
 
17
!The table  contains  wavelengths:   column #1 or   :WAV
 
18
!                     fluxes:        column #2 or   :FLUX
 
19
!                     quality flags: column #3 or   :QUAL
 
20
 
21
! Column 1 and 2 should be used by the user to create  an 1-D spectrum.
 
22
!****************************************************************************
 
23
!MIDAS/GHRS files - images and associated tables- are renamed with the
 
24
!ROOTNAME  appearing in the FITS header:
 
25
 
 
26
DEFINE/PAR P1 ? C   "Give the inicial of your GHRS files, e.g., z:  "
 
27
 
 
28
creat/icat ghrs {p1}*.bdf
 
29
 
 
30
DEFINE/LOCAL CATAL/I/1/1 0
 
31
DEFINE/LOCAL I/I/1/1 0
 
32
WRITE/KEY NAME/C/1/20 " "
 
33
write/key VAR/r/1/1 1
 
34
LOOP_ghrs:
 
35
DO I = 1 3
 
36
STORE/FRAME IN_B ghrs.cat 1 FINITO
 
37
READ/KEY IN_B
 
38
copy/it 'IN_B' temp{I}
 
39
enddo
 
40
IF {{IN_B},NAXIS} .NE. 0 THEN
 
41
VAR = {{IN_B},NPIX(2)}
 
42
endif
 
43
 
 
44
COPY/DK 'IN_B' ROOTNAME NAME
 
45
!
 
46
! Each 2-D GHRS/MIDAS  image is converted to a MIDAS table
 
47
!
 
48
CREA/TABLE TEMP 3 1000 NULL
 
49
COPY/TT temp0001 #{VAR} TEMP :WAV 
 
50
COPY/TT temp0002 #{VAR}  TEMP :FLUX 
 
51
COPY/TT temp0003 #{VAR}  TEMP :QUAL
 
52
RENAME/table TEMP 'NAME'
 
53
GOTO LOOP_ghrs
 
54
FINITO:
 
55
! clean up area
 
56
! Delete temporary and catalog files
 
57
do I = 1 3
 
58
dele/table temp{I} no
 
59
enddo
 
60
dele ghrs.cat nc
 
61
del dirfile.dat nc
 
62
 
 
63
!exit
 
64
 
 
65
 
 
66
 
 
67