64 Processing Frequency-Switched Data
66 If you wish to combine the left half of a frequency-switched
scan in Array (0)
67 with the right half, then use the verb RAP. On completion, RAP places the result
68 in Array (0), and sets the adverb OSHIFT equal to the number of channels between
69 Signal and Reference frequencies. (At present, RAP only works correctly if the
70 frequency
shift is an integral number of channels.)
72 Be careful when using RAP, as its operation is rather different for Green Bank and
75 Green Bank Data : RAP will compute the number of channels to
77 "
shift and combine" from the frequencies stored
78 in the
scan header. Thus to perform the
79 combination, just type,
83 Tucson Data : Here, one must
set the two adverbs,
85 FS (Frequency offset in MHz for the Signal
data) and
86 FR (Frequency offset in MHz for the Reference
data)
87 before invoking RAP. As of Fall 1993, these two values
88 are available from the header. There are three
89 frequency offsets stored in the header:
90 FOFFSIG, FOFFREF1, and FOFFREF2. Usually you will
91 want to
set FS to the value of the FOFFSIG header
92 word and FR to the value of the FOFFREF1 header
99 NOTE : Following the application of RAP, the user must decide which half of the
100 spectrum is the signal half, and drop the other half via the adverbs BDROP and
101 EDROP before displaying the
data. If OSHIFT is > 0, then you should
set BDROP
102 to at least the value of OSHIFT. If OSHIFT is < 0, then you should
set EDROP to
103 at least the absolute value of OSHIFT.
105 The adverb DEFMODE indicates how RAP treats undefined
data values. An undefined
106 data value is one equal to IEEE Inf (Infinity).
108 If DEFMODE is
FALSE, RAP will place an undefined
data value at any location where
109 either the signal or reference values are undefined (i.e. if channel 100 is
110 undefined, as above, then the channel in the result that depends on channel 100
111 will also be undefined if DEFMODE is FALSE).
113 If DEFMODE is
TRUE, RAP will place an undefined
data value at any location where
114 both the signal and reference values are undefined. However, if only one value is
115 undefined, then the result will be as if the undefined value were zero (i.e. if
116 channel 100 is the only undefined value, then that value will be treated as if
119 Most users will leave DEFMODE
set to its default value of FALSE.
122 C-----------------------------------------------------------------------
124 C----------------------------------------------------------------------
126 if(dtwh(c1tel,iptwh).eq.value12m) then
128 else if(dtwh(c1tel,iptwh).eq.value140 .or.
129 1 dtwh(c1tel,iptwh).eq.value300) then
132 call oerror(n283,
m2, 'RAP')
135 c input adverbs : fr = signal frequency (MHz)
136 c fs = referenc freq (MHz)
138 OSHFT=(FR-
FS)/DTWH(C12FR,IPTWH)
139 c oshift number of channels
140 if(oshft.eq.0.0) call oerror(n291, m2, 'RAP')
141 IF (OSHFT.le.0.0) then
144 ISTART=DTWH(C12SPN,IPTWH) + IDATOFF
145 ISTOP=DTWH(C12SPN,IPTWH) + DTWH(C12NI,IPTWH)
147 DO 172 JJ = ISTART,ISTOP
148 if(okreal4(TWH(JJ,IPTWH)) .and.
149 . okreal4(TWH(JJ+IDF,IPTWH))) then
150 TWH(JJ,IPTWH)=(TWH(JJ,IPTWH)-TWH(JJ+IDF,IPTWH))/2.0
151 else if (defmode .ge. 0.5 .and. okreal4(TWH(JJ+IDF,IPTWH))) then
152 twh(jj,iptwh)=-TWH(JJ+IDF,IPTWH)
153 else if (defmode .lt. 0.5) then
154 twh(jj,iptwh)=rinfinity()
157 DTWH(C12NI,IPTWH)=DTWH(C12NI,IPTWH)-IDF
161 ISTART=DTWH(C12SPN,IPTWH)+IDATOFF+IDF
162 ISTOP=DTWH(C12SPN,IPTWH)+DTWH(C12NI,IPTWH)+
164 DO 177 JJ=ISTOP,ISTART,-1
165 if(okreal4(TWH(JJ,IPTWH)) .and.
166 . okreal4(TWH(JJ-IDF,IPTWH))) then
167 TWH(JJ,IPTWH)=(TWH(JJ,IPTWH)-TWH(JJ-IDF,IPTWH))/2.0
168 else if (defmode .ge. 0.5 .and. okreal4(TWH(JJ-IDF,IPTWH))) then
169 twh(jj,iptwh)=-TWH(JJ-IDF,IPTWH)
170 else if (defmode .lt. 0.5) then
171 twh(jj,iptwh)=rinfinity()
174 DTWH(C12SPN,IPTWH)=DTWH(C12SPN,IPTWH)+IDF
175 DTWH(C12NI,IPTWH)=DTWH(C12NI,IPTWH)-IDF
178 DF=-(
FS)/DTWH(C12FR,IPTWH)
181 DTWH(C12RP,IPTWH) = DTWH(C12RP,IPTWH) +
FLOAT(IDF)
189 int i, idf, istart, istop;
190 double oshift, fs, fr, df;
203 if(fs == 0.0 && fr == 0.0)
221 idf = (int)fabs(round(oshift));
225 for(i=istart;i<istop;i++)
235 idf = (int)round(oshift + 0.5);
239 for(i=istop;i>istart;i--)
250 idf = (int)round(df);
struct LP_IMAGE_INFO * h0
struct PARSE_STACK * args
int printH_FlagHelp(char *cmd)