1
/*===========================================================================
2
Copyright (C) 1993-2009 European Southern Observatory (ESO)
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; either version 2 of
7
the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public
15
License along with this program; if not, write to the Free
16
Software Foundation, Inc., 675 Massachusetss Ave, Cambridge,
19
Corresponding concerning ESO-MIDAS should be addressed as follows:
20
Internet e-mail: midas@eso.org
21
Postal address: European Southern Observatory
22
Data Management Division
23
Karl-Schwarzschild-Strasse 2
24
D 85748 Garching bei Muenchen
26
===========================================================================*/
28
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32
..AUTHOR IPG-ESO Garching
33
..CATEGORY Data Organizer utilities
34
..COMMENTS This module implements the following Midas commands:
37
\item {\tt CREATE/RULE table rule
41
..VERSION 1.0 15-Mar-1993 Definition M. Peron
44
-----------------------------------------------------------------*/
50
#include <midas_def.h>
52
#include <proto_tbl.h>
53
#define issign(c) ((c == '+') || (c == '-'))
59
int tid,tid0,nicol,nirow,norow;
60
int null, dummy,exist;
61
int colc,colb,colf,cold,colname,col[256];
62
int i,j,coltype,mycol,nmiss ;
63
char action[2],*descrname;
64
char intable[60],inkey[60],label[1+TBL_LABLEN],exptype[60],filename[60];
71
SCKGETC("IN_A",1L,60L,&dummy,intable);
72
SCKGETC("IN_B",1L,60L,&dummy,inkey);
73
SCKGETC("ACTION",1L,1L,&dummy,action);
74
TCTOPN(intable,F_IO_MODE,&tid0);
75
TCIGET(tid0,&nicol,&nirow,&dummy,&dummy,&dummy);
76
TCLSER(tid0,"EXPTYPE",&coltype);
77
TCLSER(tid0,"FILENAME",&colname);
79
if (action[0] == 'C') {
80
TCTINI("TEMP_TAB",F_TRANS,F_IO_MODE,4,nicol,&tid);
81
TCCINI(tid,D_C_FORMAT,17L,"A17"," ","COLUMN",&colc);
82
for (i=0; i<nicol; i++) {
83
TCLGET(tid0,i+1,label);
84
TCEWRC(tid,i+1,1L,label);
86
TCCINI(tid,D_I4_FORMAT,1,"I1"," ","BIAS",&colb);
87
TCCINI(tid,D_I4_FORMAT,1,"I1"," ","DARK",&cold);
88
TCCINI(tid,D_I4_FORMAT,1,"I1"," ","FF",&colf);
91
TCTOPN(inkey,F_I_MODE,&tid);
92
TCIGET(tid,&dummy,&norow,&dummy,&dummy,&dummy);
93
descrname = osmmget(norow*(1+TBL_LABLEN));
94
for (j=0; j<norow; j++) {
95
TCERDC(tid,j+1,1,descrname+j*(1+TBL_LABLEN),&null);
96
TCLSER(tid0,descrname+j*(1+TBL_LABLEN),&col[j]);
98
for (i=1; i<=nirow; i++) {
99
TCERDC(tid0,i,colname,filename,&null);
100
TCERDC(tid0,i,coltype,exptype,&null);
101
TCCSER(tid,exptype,&mycol);
103
strcpy(text,"Missing Keywords: ");
104
for (j=0; j<norow; j++) {
105
TCERDI(tid,j+1,mycol,&exist,&null);
107
TCERDD(tid0,i,col[j],&dvalue,&null);
109
strcat(text,descrname+j*(1+TBL_LABLEN));
115
if (nmiss) SCDWRC(tid0,filename,1,text,1,256,&kuni);