procedure writespec # Write a disk file containing # [channel number] [frequency offset] [velocity] [temperature] # for each channel of a spectrum. # Usage notes: # 1. The spectrum is assumed to be in Array 0, i.e., the spectrum # displayed on the screen. # 2. The user is prompted for the output file name. # 3. To drop channels from the beginning or end of the spectrum, # set values for BDROP or EDROP before executing the procedure. # 4. The velocity scale is assumed to be nonrelativistic. # PRJ 26 Jan 94 # scalar unit, npts, cenchan, delfreq, start, stop, i scalar ncount, freq, vel0, vel, delv, tr string*16 filnam # print 'Enter the name of the output file: ' read filnam unit = fopen(filnam, rw+rew+unk) npts = h0(noint) cenchan = h0(refpt) delfreq = h0(freqres) vel0 = h0(velocity) delv = h0(deltax) # ncount = 0 start = bdrop + 1 stop = npts - edrop for i = start to stop freq = delfreq * (i - cenchan) vel = vel0 + delv * (i - cenchan) tr = d0(i) fprint (unit, '(1x, i5, 2x, f10.4, 1x, f11.4, 1x, f9.5)') i, freq, vel, tr ncount = ncount + 1 end fclose(unit) # print ' ' print ncount ' data channels have been written to file: ', filnam print ' ' return finish