Initial snark14m import
[snark14.git] / src / snark / creaer.cpp
1 /*      
2  ***********************************************************
3  $SNARK_Header: S N A R K  1 4 - A PICTURE RECONSTRUCTION PROGRAM $
4  $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/creaer.cpp $
5  $LastChangedRevision: 85 $
6  $Date: 2014-07-02 16:07:08 -0400 (Wed, 02 Jul 2014) $
7  $Author: agulati $
8  ***********************************************************
9
10  THIS SUBROUTINE HANDLES THE ERRORS ENCOUNTERED IN INPUT DATA
11  PHASE FOR CREATR
12  */
13
14 #include <cstdlib>
15 #include <cstdio>
16
17 #include "blkdta.h"
18 #include "creacm.h"
19 #include "uiod.h"
20
21 #include "int2str.h"      
22
23 #include "creaer.h"
24
25 void creaer(INTEGER code)
26 {
27         INTEGER word;
28
29         Creacm.erflag = TRUE;
30         word = code;
31         if ((code < 1) || (code > 27))
32                 code = 2;
33
34         switch (code)
35         {
36
37         case 1:
38                 fprintf(output,
39                                 "\n **** only one create/picture/projection command allowed");
40                 break;
41
42         case 2:
43                 fprintf(output, "\n **** keyword -  %s  - missing", int2str(word));
44                 break;
45
46         case 3:
47                 fprintf(output, "\n **** 0 or more than 7 energy levels");
48                 break;
49
50         case 4:
51                 fprintf(output,
52                                 "\n **** percentage of photons is negative or total is not = 100");
53                 break;
54
55         case 5:
56                 fprintf(output,
57                                 "\n **** unknown object type - not ellipse, rectangle, triangle, sector or segment");
58                 break;
59
60         case 6:
61                 fprintf(output,
62                                 "\n **** value for semiaxes for object is negative, 0 or too small");
63                 break;
64
65         case 7:
66                 fprintf(output, "\n **** scale factor is too small or zero");
67                 break;
68
69         case 8:
70                 fprintf(output,
71                                 "\n **** value for nave1 or nave2 is negative, zero, or even; or nave2 > 13");
72                 break;
73
74         case 9:
75                 fprintf(output, "\n **** value for nelem is negative, 0 or even");
76                 break;
77
78         case 10:
79                 fprintf(output,
80                                 "\n **** negative, zero or too small a value for pixsiz or pinc");
81                 break;
82
83         case 11:
84                 fprintf(output, "\n **** inconsistent geometry specification");
85                 break;
86
87         case 12:
88                 fprintf(output,
89                                 "\n **** uniform or variable spacing must be specified");
90                 break;
91
92         case 13:
93                 fprintf(output, "\n **** nrays is negative, zero or even");
94                 break;
95
96         case 14:
97                 fprintf(output, "\n **** number of projections is negative or zero");
98                 break;
99
100         case 15:
101                 fprintf(output,
102                                 "\n **** ray calculation option must be user or program");
103                 break;
104
105         case 16:
106                 fprintf(output, "\n **** calibration type out of range");
107                 break;
108
109         case 17:
110                 fprintf(output,
111                                 "\n **** scattering peak or width is negative, zero or too small");
112                 break;
113
114         case 18:
115                 fprintf(output,
116                                 "\n **** unknown noise type or keyword or seed/back missing");
117                 break;
118
119         case 19:
120                 fprintf(output,
121                                 "\n **** aperture weight given is negative, or sum of aperture weights is negative or zero");
122                 break;
123
124         case 20:
125                 fprintf(output, "\n **** equal spacing but only 1 projection");
126                 break;
127
128         case 21:
129                 fprintf(output,
130                                 "\n **** mono or polychromatic spectrum must be specified");
131                 break;
132
133         case 22:
134                 fprintf(output, "\n");
135                 break;
136
137         case 23:
138                 fprintf(output,
139                                 "\n **** picture description must preceed projection data");
140                 break;
141
142         case 24:
143                 fprintf(output,
144                                 "\n **** test picture not present - pseudo data not created");
145                 break;
146
147         case 25:
148                 fprintf(output,
149                                 "\n **** unexpected end of file or line, insufficient data");
150                 break;
151
152         case 26:
153                 fprintf(output,
154                                 "\n **** quantum mean or calibration is negative or too small");
155                 break;
156
157         case 27:
158                 fprintf(output,
159                                 "\n **** value of multiplicative noise mean is too small");
160                 break;
161         };
162
163         fprintf(output, "\n **** program aborted\n");
164         exit(-1);
165 }