30 CLS:PRINT:PRINT"Routine for plotting spectra as either stick plots or as Lorentzians.":PRINT:PRINT"Be sure to read in the data files if auto-read not in effect!": GOSUB 63999
1000 CLS:PRINT:PRINT"Menu of available options--":PRINT
1002 PRINT"'DR'--Display ranges on plot (control of option to request this)."
1004 PRINT"'EP'--Exit to energy level (or Fz level) plotting routines."
1005 PRINT"'FF'--Send form feed to printer (used after a printer plot)."
1006 PRINT"'FT'--Dump plot to disk for use by FFT program (1K transform)."
1010 PRINT"'HF'--Set high (left) frequency limit of plot."
1020 PRINT"'LF'--Set low frequency (right) limit of plot."
1030 PRINT"'LP'--Do a Lorentzian plot (sets linewidth)."
1040 PRINT"'ME'--Display this menu."
1050 PRINT"'NH'--Redo Lorentzian plot with new vertical scale."
1052 PRINT"'QE'--Exit to energy level plotting routine (NMR6)."
1055 PRINT"'QL'--Chain back to listing routine (NMR4)"
1056 PRINT"'QM'--Chain back to main I/O routine (NMR1)"
1060 PRINT"'QT'--Exit and return control to system."
1070 PRINT"'RD'--Read spectrum line file. This must be done before plotting!"
1080 PRINT"'SP'--Do a stick plot of spectrum."
1085 PRINT"'TI'--Puts a title on bottom of plot."
1090 PRINT"'VG'--Set vertical gain for normalization."
1100 PRINT:INPUT"Hit <Return> to continue.", A$: RETURN
2000 CLS:PRINT:PRINT"Ready to enter in spectrum lines. Data set name needed? ";: GOSUB 600: IF P$ = "N" THEN 2020 ELSE IF P$ <> "Y" THEN 2000
2010 PRINT:INPUT"Enter data set name: ",FF$
2020 DF$ = FF$ + ".inf": OPEN DF$ FOR INPUT AS 1
2025 PRINT:PRINT"Reading in file ";DF$
2030 INPUT #1,NS: INPUT #1,NL
2040 FOR I = 0 TO NS: INPUT #1, BC(I): NEXT
2050 CLOSE 1
2051 DF$ = FF$ + ".0": OPEN DF$ FOR INPUT AS 1
2052 PRINT:PRINT"Getting spectrometer frequency."
2053 INPUT #1, NULL: INPUT #1, FR
2054 CLOSE 1
2055 FU = 10*FR: FL = 0
2059 NL = 0
2060 FOR I = 1 TO NS: NL = NL + BC(I-1)*BC(I): NEXT
2070 PRINT:PRINT NS;"spins": PRINT NL;"transitions": PRINT: DF$ = FF$ + ".lin": OPEN DF$ FOR INPUT AS 1
2075 PRINT:PRINT"Reading in file ";DF$
2080 FOR I = 1 TO NL: FOR J = 0 TO 2: INPUT #1, SLINES(I,J): NEXT: NEXT
2090 CLOSE 1
2100 PRINT"Spectrum lines now loaded.": GOTO 63999
3000 IF FL > FU THEN 700 ELSE CLS:PRINT:PRINT "Now producing stick plot. Please stand by.":PRINT:PRINT"After plot completed, hit any key to get back to command mode and text screen.":PRINT
3005 LFLAG = 0
3010 GOSUB 3900
3020 FOR I = 1 TO NL
3025 PLINE = SLINES(I,1): IF PLINE > FU OR PLINE < FL THEN 3050
3030 IP = INT(RM*(PLINE - FU)): IF IP < 0 OR IP > 639 THEN 3050
3040 PL(IP) = PL(IP) + SLINES(I,2)
3050 NEXT
3060 GOSUB 8000
3070 FOR I = 0 TO 639: PL(I) = HF*PL(I)/X: NEXT
3075 IF LFLAG = 1 THEN RETURN
3080 GOSUB 3800
3090 FOR I = 0 TO 639
3100 IY = INT(YSCALE*(1 - PL(I))): IF IY < 0 THEN IY = 0
3110 IF IY < YSCALE THEN LINE (I,YSCALE)-(I,IY)
3120 NEXT
3125 IF ITFLAG THEN LOCATE 24,2: PRINT TITLE$;
3127 IF IRFLAG THEN GOSUB 11500
3130 BEEP
3140 A$ = INKEY$: IF A$ = "" THEN 3140
3145 IF ITFLAG OR IRFLAG THEN PRINT
3150 RETURN
3800 SCREEN 0: SCREEN 2: OUT 985,14: LINE(0,0)-(639,199),,B: RETURN
3900 RM = 639/(FL - FU)
3910 PRINT:PRINT"Resolution: "; -1/RM;"Hz": PRINT
3920 FOR I = 0 TO 639: PL(I) = 0: NEXT
3930 RETURN
4000 IF FL > FU THEN 700 ELSE CLS:PRINT:PRINT"Routine to produce Lorentzian plot.":PRINT
4020 PRINT:INPUT"Enter new linewidth (or hit <Return> to keep old): ",DELNUTEMP
4030 IF DELNUTEMP > 0 THEN DELNU = DELNUTEMP
4040 GOSUB 3900
4050 RW = -2/(DELNU*RM)
4060 PRINT"This may take a while. To pass the time, things will be displayed on the":PRINT" screen as they are generated.": PRINT:PRINT"After plot completed, hit any key to resume with text screen.": GOSUB 63999
4070 GOSUB 3800
4080 GOSUB 3020: LFLAG = 0
4090 INDEX = 0
4100 FOR I = 0 TO 639
4110 IF PL(I) > 0 THEN INDEX = INDEX + 1: IPL(INDEX) = I: PLP(INDEX) = PL(I)